Improve styling for 'delayed' lineitems in PO UI
authorBill Erickson <berick@esilibrary.com>
Tue, 11 Dec 2012 15:26:30 +0000 (10:26 -0500)
committerJason Stephenson <jason@sigio.com>
Wed, 30 Jan 2013 20:16:52 +0000 (15:16 -0500)
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 <berick@esilibrary.com>
Open-ILS/src/templates/acq/common/li_table.tt2
Open-ILS/web/css/skin/default/acq.css
Open-ILS/web/css/theme/default/acq.css
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 83881d0..e2f4056 100644 (file)
@@ -98,6 +98,7 @@
                                         <span attr='pubdate'></span>
                                         <span attr='publisher'></span>
                                         <span name='source_label'></span>
+                                        <span name='cancel_reason'></span>
                                     </td>
                                 </tr>
                                 <tr>
index 07fccb8..e410c09 100644 (file)
@@ -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; }
index d59e28e..bc73c72 100644 (file)
@@ -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; }
index 5f5df76..e8d0423 100644 (file)
@@ -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