[open-ils-commits] r15218 - in trunk/Open-ILS/xul/staff_client: chrome/content/util server/locale/en-US server/patron server/skin (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Dec 22 05:32:20 EST 2009


Author: phasefx
Date: 2009-12-22 05:32:14 -0500 (Tue, 22 Dec 2009)
New Revision: 15218

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
   trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
   trunk/Open-ILS/xul/staff_client/server/skin/circ.css
Log:
Misc tweaks to billing interface and list infrastructure.

Fix mislabeled column for title in payments history interface.
Support preservation of treecell properties, and style specific columns in the bills interface instead of whole rows.
Support immediate fleshing of rows in lists, and do such in the bills interface since the various tallies in that interface depend on the data being fully retrieved.

TODO:

Revisit the preservation of treecell properties.  May be some unintended consequences to not blowing away and re-creating the treecell elements when refreshing rows in a list.  Hrmm, perhaps a field being unset but its previous value still being rendered.



Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2009-12-21 22:22:07 UTC (rev 15217)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2009-12-22 10:32:14 UTC (rev 15218)
@@ -494,13 +494,15 @@
                 },
                 false
             );
-            /*
-            setTimeout(
-                function() {
-                    util.widgets.dispatch('flesh',treerow);
-                }, 0
-            );
-            */
+            if (typeof params.flesh_immediately != 'undefined') {
+                if (params.flesh_immediately) {
+                    setTimeout(
+                        function() {
+                            util.widgets.dispatch('flesh',treerow);
+                        }, 0
+                    );
+                }
+            }
         } else {
             obj.put_retrieving_label(treerow);
             treerow.addEventListener(
@@ -518,13 +520,15 @@
                 },
                 false
             );
-            /*
-            setTimeout(
-                function() {
-                    util.widgets.dispatch('flesh',treerow);
-                }, 0
-            );
-            */
+            if (typeof params.flesh_immediately != 'undefined') {
+                if (params.flesh_immediately) {
+                    setTimeout(
+                        function() {
+                            util.widgets.dispatch('flesh',treerow);
+                        }, 0
+                    );
+                }
+            }
         }
         this.error.sdump('D_LIST',s);
 
@@ -646,13 +650,16 @@
                 },
                 false
             );
-            /*
-            setTimeout(
-                function() {
-                    util.widgets.dispatch('flesh',treerow);
-                }, 0
-            );
-            */
+            if (typeof params.flesh_immediately != 'undefined') {
+                if (params.flesh_immediately) {
+                    setTimeout(
+                        function() {
+                            util.widgets.dispatch('flesh',treerow);
+                        }, 0
+                    );
+                }
+            }
+
         } else {
 
             s += 'did not find a retrieve_row function\n';
@@ -673,13 +680,16 @@
                 },
                 false
             );
-            /*
-            setTimeout(
-                function() {
-                    util.widgets.dispatch('flesh',treerow);
-                }, 0
-            );
-            */
+            if (typeof params.flesh_immediately != 'undefined') {
+                if (params.flesh_immediately) {
+                    setTimeout(
+                        function() {
+                            util.widgets.dispatch('flesh',treerow);
+                        }, 0
+                    );
+                }
+            }
+
         }
 
             try {
@@ -933,12 +943,13 @@
     '_map_row_to_treecell' : function(params,treerow) {
         var obj = this;
         var s = '';
-        util.widgets.remove_children(treerow);
+        //util.widgets.remove_children(treerow);
+        var create_treecells = treerow.childNodes.length == 0;
 
         if (typeof params.map_row_to_column == 'function' || typeof this.map_row_to_column == 'function') {
 
             for (var i = 0; i < this.columns.length; i++) {
-                var treecell = document.createElement('treecell');
+                var treecell = create_treecells ? document.createElement('treecell') : treerow.childNodes[i];
                 if ( this.columns[i].editable == false ) { treecell.setAttribute('editable','false'); }
                 var label = '';
                 if (params.skip_columns && (params.skip_columns.indexOf(i) != -1)) {
@@ -964,7 +975,7 @@
     
                 }
                 if (this.columns[i].type == 'checkbox') { treecell.setAttribute('value',label); } else { treecell.setAttribute('label',label ? label : ''); }
-                treerow.appendChild( treecell );
+                if (create_treecells) { treerow.appendChild( treecell ); }
                 s += ('treecell = ' + treecell + ' with label = ' + label + '\n');
             }
         } else if (typeof params.map_row_to_columns == 'function' || typeof this.map_row_to_columns == 'function') {
@@ -981,14 +992,14 @@
 
             }
             for (var i = 0; i < labels.length; i++) {
-                var treecell = document.createElement('treecell');
+                var treecell = create_treecells ? document.createElement('treecell') : treerow.childNodes[i];
                 if ( this.columns[i].editable == false ) { treecell.setAttribute('editable','false'); }
                 if ( this.columns[i].type == 'checkbox') {
                     treecell.setAttribute('value', labels[i]);
                 } else {
                     treecell.setAttribute('label',typeof labels[i] == 'string' || typeof labels[i] == 'number' ? labels[i] : '');
                 }
-                treerow.appendChild( treecell );
+                if (create_treecells) { treerow.appendChild( treecell ); }
                 s += ('treecell = ' + treecell + ' with label = ' + labels[i] + '\n');
             }
 

Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-12-21 22:22:07 UTC (rev 15217)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties	2009-12-22 10:32:14 UTC (rev 15218)
@@ -45,7 +45,7 @@
 staff.patron.bill_history.print_bills.print_error=printing bills
 staff.patron.bill_history.column.xact_type.label=Transaction Type
 staff.patron.bill_history.column.last_billing_type.label=Last Billing Type
-staff.patron.bill_history.column.title.label=Last Billing Type
+staff.patron.bill_history.column.title.label=Title
 
 staff.patron.bills.init_controller.money_summary_label=Money Summary
 staff.patron.bills.bill_payment_amount.credit_amount=Patron only has %1$s in credit.

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-12-21 22:22:07 UTC (rev 15217)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-12-22 10:32:14 UTC (rev 15218)
@@ -367,8 +367,8 @@
 
 function gen_list_append_func(r) {
     return function() {
-        if (typeof r == 'object') { g.row_map[ r.id() ] = g.bill_list.append( { 'retrieve_id' : r.id(), 'row' : { 'my' : { 'checked' : true, 'mbts' : r } } } );
-        } else { g.row_map[r] = g.bill_list.append( { 'retrieve_id' : r, 'row' : { 'my' : { 'checked' : true } } } ); }
+        if (typeof r == 'object') { g.row_map[ r.id() ] = g.bill_list.append( { 'retrieve_id' : r.id(), 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true, 'mbts' : r } } } );
+        } else { g.row_map[r] = g.bill_list.append( { 'retrieve_id' : r, 'flesh_immediately' : true, 'row' : { 'my' : { 'checked' : true } } } ); }
     }
 }
 
@@ -476,10 +476,12 @@
                     try {
                         if ( row && row.my && row.my.mbts && Number( row.my.mbts.balance_owed() ) < 0 ) {
                             util.widgets.addProperty(params.row_node.firstChild,'refundable');
+                            util.widgets.addProperty(params.row_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.row_node.firstChild,'circulating');
+                            util.widgets.addProperty(params.row_node.firstChild.childNodes[ g.title_column_idx ],'circulating');
                         }
                     } catch(E) {
                         g.error.sdump('D_WARN','Error setting list properties in bill2.js: ' + E);
@@ -526,6 +528,8 @@
         }
     } );
 
+    g.title_column_idx = util.functional.map_list( g.bill_list.columns, function(o) { return o.id; } ).indexOf( 'title' );
+    g.payment_pending_column_idx = util.functional.map_list( g.bill_list.columns, function(o) { return o.id; } ).indexOf( 'payment_pending' );
     $('bill_list_actions').appendChild( g.bill_list.render_list_actions() );
     g.bill_list.set_list_actions();
 }

Modified: trunk/Open-ILS/xul/staff_client/server/skin/circ.css
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/skin/circ.css	2009-12-21 22:22:07 UTC (rev 15217)
+++ trunk/Open-ILS/xul/staff_client/server/skin/circ.css	2009-12-22 10:32:14 UTC (rev 15218)
@@ -3,14 +3,22 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 
 @namespace html url("http://www.w3.org/TR/REC-html40"); 
 
-treechildren::-moz-tree-row(refundable) {
+treechildren::-moz-tree-cell(refundable) {
     background-color: pink;
 }
 
-treechildren::-moz-tree-row(circulating) {
-    background-color: red; color: white;
+treechildren::-moz-tree-cell-text(refundable) {
+    color: black;
 }
 
+treechildren::-moz-tree-cell(circulating) {
+    background-color: red;
+}
+
+treechildren::-moz-tree-cell-text(circulating) {
+    color: white;
+}
+
 treechildren::-moz-tree-row(backdate_failed) {
     background-color: pink ! important;
 }



More information about the open-ils-commits mailing list