Improve styling for 'delayed' lineitems in PO UI
authorBill Erickson <berick@esilibrary.com>
Tue, 11 Dec 2012 15:26:30 +0000 (10:26 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 19 Aug 2013 21:00:23 +0000 (17:00 -0400)
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>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
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 c6f2908..d6a478e 100644 (file)
                                         <span attr='pubdate'></span>
                                         <span attr='publisher'></span>
                                         <span name='source_label'></span>
+                                        <span name='cancel_reason'></span>
                                     </td>
                                 </tr>
                                 <tr>
index 7da2a78..1beff27 100644 (file)
@@ -278,3 +278,4 @@ span[name="bib_origin"] img { vertical-align: middle; }
     border: 1px solid #464; 
 }
 
+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 16665c4..068f351 100644 (file)
@@ -626,6 +626,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();
 
@@ -1162,6 +1167,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