@include("../commons/styles.html") @include("../commons/images.html") @args() { List> items List> groupitems List> locitems Map info Locale locale String date_column String fromDate String toDate } @returnIf(items == null) @*Queries: * [ * { * "paramName" : "items", * "query" : [ * "SELECT", * "count(*) as backups,", * "count(case when state in ('0') then 1 else null end) as successful,", * "count(case when state in ('1') then 1 else null end) as warning,", * "count(case when state in ('3', 'c') then 1 else null end) as cancelled,", * "count(case when state in ('2', 'd', 'X') then 1 else null end) as error,", * "count(case when state in ('a') then 1 else null end) as active,", * "count(case when state in ('q') then 1 else null end) as queued,", * "count(case when state in ('w', 'W') then 1 else null end) as waiting", * "FROM", * "results", * "WHERE", * "@(dateRange:@(date_column))", * "AND", * "backup_type is not NULL", * "AND", * "fdi_type in ('F','C','I','D','FH','CH','IH','DH')", * "AND", * "original_saveset is NULL", * "AND", * "saveset not like 'V%'" * ] * }, * { * "paramName" : "items", * "condition" : [ * "@returnIf(location_id == null)" * ], * "query" : [ * "SELECT", * "count(*) as backups,", * "count(case when state in ('0') then 1 else null end) as successful,", * "count(case when state in ('1') then 1 else null end) as warning,", * "count(case when state in ('3', 'c') then 1 else null end) as cancelled,", * "count(case when state in ('2', 'd', 'X') then 1 else null end) as error,", * "count(case when state in ('a') then 1 else null end) as active,", * "count(case when state in ('q') then 1 else null end) as queued,", * "count(case when state in ('w', 'W') then 1 else null end) as waiting", * "FROM", * "results", * "WHERE", * "@(dateRange:@(date_column))", * "AND", * "client_id in (WITH RECURSIVE children(id) AS (SELECT l.id FROM locations l WHERE l.id=", * "@(location_id)", * " UNION ALL SELECT l.id from children c,locations l where l.parent=c.id) SELECT * FROM children)", * "AND", * "backup_type is not NULL", * "AND", * "fdi_type in ('F','C','I','D','FH','CH','IH','DH')", * "AND", * "original_saveset is NULL", * "AND", * "saveset not like 'V%'" * ] * }, * { * "paramName" : "groupitems", * "query" : [ * "SELECT", * "count(*) as backups,", * "count(case when state in ('0') then 1 else null end) as successful,", * "count(case when state in ('1') then 1 else null end) as warning,", * "count(case when state in ('3', 'c') then 1 else null end) as cancelled,", * "count(case when state in ('2', 'd', 'X') then 1 else null end) as error,", * "count(case when state in ('a') then 1 else null end) as active,", * "count(case when state in ('q') then 1 else null end) as queued,", * "count(case when state in ('w', 'W') then 1 else null end) as waiting", * "FROM", * "results", * "WHERE", * "@(dateRange:@(date_column))", * "AND", * "backup_type is not NULL", * "AND", * "fdi_type in ('GF','GC','GI','GD')", * "AND", * "original_saveset is NULL", * "AND", * "saveset not like 'V%'" * ] * }, * { * "paramName" : "locitems", * "condition" : [ * "@returnIf(location_id == null)" * ], * "query" : [ * "SELECT", * "name", * "FROM", * "locations", * "WHERE", * "id", * "IN", * "(WITH RECURSIVE children(id) AS (SELECT l.id FROM locations l WHERE l.id=@(location_id)", * "UNION ALL SELECT l.id from children c,locations l where l.parent=c.id) SELECT * FROM children)" * ] * } * ] *@ @include("../commons/tags.html") @include("../commons/functions.html") @sepReportHeader("Report") @sepTitleBox("Title",sepFnGetToday(locale)) @if (date_column == "sesam_date") { @sepDateRangeLabel(sepFnGetDate(sepFnStringToDate(fromDate), locale), sepFnGetDate(sepFnStringToDate(toDate), locale), date_column) } else { @sepDateRangeLabel(sepFnGetDateLong(sepFnStringToDate(fromDate), locale), sepFnGetDateLong(sepFnStringToDate(toDate), locale), date_column) }

@// if this is a location based report, insert information about location @if (locitems != null) {

@i18n("Location.list")

    @for (Map locitem : locitems) {
  • @(locitem.get("name"))
  • }
} @{ Map item = items.get(0); }

@i18n("StatTask.Title")

@i18n("StatTask.success") @(item.get("successful"))
@i18n("StatTask.warn") @(item.get("warning"))
@i18n("StatTask.cancel") @(item.get("cancelled"))
@i18n("StatTask.error") @(item.get("error"))
@i18n("StatTask.active") @(item.get("active"))
@i18n("StatTask.queue") @(item.get("queued"))
@i18n("StatTask.wait") @(item.get("waiting"))
@i18n("StatTask.all") @(item.get("backups"))

@if (locitems == null) { @{ item = groupitems.get(0); }

@i18n("StatGroup.Title")

@i18n("StatGroup.success") @(item.get("successful"))
@i18n("StatGroup.warn") @(item.get("warning"))
@i18n("StatGroup.cancel") @(item.get("cancelled"))
@i18n("StatGroup.error") @(item.get("error"))
@i18n("StatGroup.active") @(item.get("active"))
@i18n("StatGroup.queue") @(item.get("queued"))
@i18n("StatGroup.wait") @(item.get("waiting"))
@i18n("StatGroup.all") @(item.get("backups"))
}