@include("../commons/styles.html") @include("../commons/images.html") @args() { List> items List> loaderitems Map info Locale locale String date_column String fromDate String toDate String active String eolfree String realEOL String TapeState } @{ realEOL = (sepFnGetDateOnly(sepFnStringToDateAddHours( (String) (toDate) , -24))) } @returnIf(items == null) @*Queries: * [ * { * "paramName" : "items", * "dateRangeSourceTable" : "m", * "query" : [ * "SELECT", * "m.label,", * "m.barcode, ", * "m.pool,", * "m.eom_state,", * "m.close_tape,", * "m.eol,", * "l.object,", * "l.number,", * "l.loader,", * "l.barcode,", * "l.lbl,", * "CASE", * "WHEN", * "(", * "(m.eol > '@(realEOL)')", * "AND", * "m.eom_state != 'y'", * "AND", * "m.close_tape='n'", * ")", * "THEN", * "'active'", * "ELSE", * "'EOLfree'", * "END", * "AS", * "active", * "FROM ", * "media m", * "LEFT JOIN", * "loader_contents l", * "ON", * "m.label=l.lbl", * "WHERE", * "(", * "(m.eol < '@(fromDate)')", * "OR", * "(", * "m.eom_state != 'y'", * "AND", * "m.close_tape = 'n'", * ")", * ")", * "AND", * "m.pool in ", * "(", * "SELECT ", * "DISTINCT media_pools.name ", * "FROM ", * "media_pools ", * "WHERE", * "media_pools.drive_grp in ", * "(", * "SELECT ", * "hw_drives.grp_id ", * "FROM ", * "hw_drives ", * "WHERE ", * "hw_drives.drive_type NOT IN ", * "('SNAP_STORE','SNAP_NETAPP','DISK_STORE','DISK_HARD','DISK_CHNG','DVDRW','DVDR','CDRW','CDR')", * ")", * ")", * "ORDER BY m.pool,active DESC,COALESCE (l.object , 'A') ASC,m.eol ASC" * ] * } * ] *@ @include("../commons/tags.html") @include("../commons/functions.html") @sepReportHeader("Report") @sepTitleBox("Title", sepFnGetToday(locale), (String) info.get("name")) @sepDateAvailableMediaLabel(sepFnGetToday(locale), sepFnGetDate(sepFnStringToDate(fromDate), locale))

@{ String previousPool = null; String previousSaveset = null; boolean isFirstRow = true; } @for (Map item : items) { @{ String pool = (String) item.get("pool"); boolean isNewPool = previousPool == null || !previousPool.equals(pool); eolfree = (sepFnGetDate(sepFnStringToDateAddHours( (String) item.get("eol") ,+24), locale)); String TapeState = "unknown"; } @{ if ("active".equals(item.get("active"))) {TapeState = "media.active";} if ("EOLfree".equals(item.get("active"))) {TapeState = "media.EOLfree";} } @{ isFirstRow = false; } }
@i18n("MediaPool") @i18n("Label") @i18n("Barcode") @i18n("State") @i18n("EndOfLife") @i18n("Loader") @i18n("Object") @i18n("Number")
@if (isNewPool) { @{ previousPool = pool; } @(pool) } @(item.get("label")) @(item.get("barcode")) @i18n(TapeState) @(eolfree) @(item.get("loader")) @(item.get("object")) @(item.get("number"))
@i18n("hint1")