Billing UI style lost and longoverdue circulations
authorBill Erickson <berick@esilibrary.com>
Wed, 14 Aug 2013 13:44:45 +0000 (09:44 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 16 Sep 2013 16:12:35 +0000 (12:12 -0400)
When a LOST or LONGOVERDUE circulation, which has not yet been returned,
appears in the patron's list of billed transactions, style them
differently from other not-yet-returned items.

Similar to regular not-yet-returned items, display a helpful message to
staff indicating what colors map to what types of circulations.

The default colors are maroon for LOST and organge for LONGOVERDUE.

To change the colors, a change to circ.css (for the style) and lang.dtd
(for the hint) are required.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/bill2.xul
Open-ILS/xul/staff_client/server/skin/circ.css

index 8a653fc..6e9e3a5 100644 (file)
 <!ENTITY staff.patron.bill_interface.paid.label "Paid">
 
 <!ENTITY staff.patron.bills_overlay.still_checked_out.label "Red Items are still Checked Out">
+<!ENTITY staff.patron.bills_overlay.longoverdue_checked_out.label "Orange Items are Long Overdue">
+<!ENTITY staff.patron.bills_overlay.lost_checked_out.label "Dark Red Items are Lost">
 <!ENTITY staff.patron.bills_overlay.uncheck_all.label "Uncheck All">
 <!ENTITY staff.patron.bills_overlay.uncheck_all.accesskey "U">
 <!ENTITY staff.patron.bills_overlay.check_all.label "Check All">
index a9af71d..dde0fe8 100644 (file)
@@ -564,9 +564,24 @@ function init_lists() {
                             util.widgets.addProperty(params.treeitem_node.firstChild.childNodes[ g.payment_pending_column_idx ],'refundable');
                         }
                         if ( row && row.my && row.my.circ && ! row.my.circ.checkin_time() ) {
-                            $('circulating_hint').hidden = false;
-                            util.widgets.addProperty(params.treeitem_node.firstChild,'circulating');
-                            util.widgets.addProperty(params.treeitem_node.firstChild.childNodes[ g.title_column_idx ],'circulating');
+                            var style_type = 'circulating';
+                            var stop_fines = row.my.circ.stop_fines() || '';
+
+                            // we have custom syling for these stop-fines reasons
+                            if (stop_fines.match(/LOST|LONGOVERDUE/)) 
+                                style_type = stop_fines.toLowerCase();
+
+                            $(style_type + '_hint').hidden = false;
+
+                            // style every cell in the row
+                            for (var n in params.treeitem_node.firstChild.childNodes) {
+                                try {
+                                    util.widgets.addProperty(
+                                        params.treeitem_node.firstChild.childNodes[n], 
+                                        style_type
+                                    );
+                                } catch(E) {}
+                            }
                         }
                     } catch(E) {
                         g.error.sdump('D_WARN','Error setting list properties in bill2.js: ' + E);
index 32f0e0b..b0135b4 100644 (file)
                     <button id="bill_history_btn" label="&staff.patron.bills_overlay.history.label;" accesskey="&staff.patron.bills_overlay.history.accesskey;" />
                     <spacer flex="1"/>
                     <vbox pack="center">
-                        <label id="circulating_hint" hidden="true" style="background: red; color: white" value="&staff.patron.bills_overlay.still_checked_out.label;"/>
+                        <label id="circulating_hint" hidden="true" 
+                            value="&staff.patron.bills_overlay.still_checked_out.label;"/>
+
+                        <label id="longoverdue_hint" hidden="true" 
+                            value="&staff.patron.bills_overlay.longoverdue_checked_out.label;"/>
+
+                        <label id="lost_hint" hidden="true"
+                            value="&staff.patron.bills_overlay.lost_checked_out.label;"/>
                     </vbox>
                     <menubar>
                         <menu label="&staff.patron.bill_interface.actions.label;" accesskey="&staff.patron.bill_interface.actions.accesskey;">
index 3472515..6069258 100644 (file)
@@ -15,10 +15,41 @@ treechildren::-moz-tree-cell(circulating) {
     background-color: red;
 }
 
+treechildren::-moz-tree-cell(longoverdue) {
+    background-color: orange;
+}
+
+treechildren::-moz-tree-cell(lost) {
+    background-color: maroon;
+}
+
 treechildren::-moz-tree-cell-text(circulating) {
     color: white;
 }
 
+treechildren::-moz-tree-cell-text(lost) {
+    color: white;
+}
+
+treechildren::-moz-tree-cell-text(longoverdue) {
+    color: black;
+}
+
+#circulating_hint {
+    background-color: red;
+    color: white;
+}
+
+#lost_hint {
+    background-color: maroon;
+    color: white;
+}
+
+#longoverdue_hint {
+    background-color: orange;
+    color: black;
+}
+
 treechildren::-moz-tree-row(backdate_failed) {
     background-color: pink ! important;
 }