From 3597e88454190445d9b7919e36123cc3e6f0bb36 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 11 Dec 2012 10:26:30 -0500 Subject: [PATCH] Improve styling for 'delayed' lineitems in PO UI When a lineitem is cancelled, but "keep_debits" is true, the lineitem is in effect delayed instead of truly cancelled. Make it more obvious in the UI the difference between delayed and truly cancelled lineitems by applying a row styling for delayed items (similar to other status row styling) and always show the cancel reason (label) in the lineitem display in the PO, next to the non-title attributes. Signed-off-by: Bill Erickson --- Open-ILS/src/templates/acq/common/li_table.tt2 | 1 + Open-ILS/web/css/skin/default/acq.css | 2 ++ Open-ILS/web/css/theme/default/acq.css | 1 + Open-ILS/web/js/ui/default/acq/common/li_table.js | 10 ++++++++++ 4 files changed, 14 insertions(+) diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2 index 83881d0393..e2f4056ad8 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -98,6 +98,7 @@ + diff --git a/Open-ILS/web/css/skin/default/acq.css b/Open-ILS/web/css/skin/default/acq.css index 07fccb8865..e410c09800 100644 --- a/Open-ILS/web/css/skin/default/acq.css +++ b/Open-ILS/web/css/skin/default/acq.css @@ -258,3 +258,5 @@ span[name="bib_origin"] img { vertical-align: middle; } margin-bottom: 15px; padding: 4px; } + +span[name="cancel_reason"] { text-decoration: underline; font-weight: bold; } diff --git a/Open-ILS/web/css/theme/default/acq.css b/Open-ILS/web/css/theme/default/acq.css index d59e28e709..bc73c72873 100644 --- a/Open-ILS/web/css/theme/default/acq.css +++ b/Open-ILS/web/css/theme/default/acq.css @@ -35,6 +35,7 @@ .oils-acq-li-state-pending-order td { background-color: #EEEEDD; } .oils-acq-li-state-on-order td { background-color: #EEDDDD; } .oils-acq-li-state-received td { background-color: #DDDDDD; } +.oils-acq-li-state-delayed td { background-color: #99CCFF; } /* po display */ #oils-acq-po-table thead tr { border: 1px solid #A1A1A1; } diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 5f5df76b92..e8d0423138 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -380,6 +380,11 @@ function AcqLiTable() { dojo.forEach(tds, function(td) {self.setRowAttr(td, liWrapper, td.getAttribute('attr'), td.getAttribute('attr_type'));}); dojo.query('[name=source_label]', row)[0].appendChild(document.createTextNode(li.source_label())); + if (li.cancel_reason() && typeof li.cancel_reason() == 'object') { + dojo.query('[name=cancel_reason]', row)[0].appendChild( + document.createTextNode(li.cancel_reason().label())); + } + // so we can scroll to it later dojo.query('[name=bib-info-cell]', row)[0].id = 'li-title-ref-' + li.id(); @@ -713,6 +718,11 @@ function AcqLiTable() { "connectId": [holds_state] }, dojo.create("span", null, state_cell, "last") ); + + if (li.cancel_reason().keep_debits() == 't') { + openils.Util.removeCSSClass(row, /^oils-acq-li-state-/); + openils.Util.addCSSClass(row, "oils-acq-li-state-delayed"); + } } return; // all done -- 2.11.0