[open-ils-commits] r14719 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 2 02:28:30 EST 2009


Author: phasefx
Date: 2009-11-02 02:28:26 -0500 (Mon, 02 Nov 2009)
New Revision: 14719

Modified:
   trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
   trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul
   trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js
Log:
wire up Bill Patron, and have it append to the list without refreshing the whole display

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-11-02 07:15:50 UTC (rev 14718)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-11-02 07:28:26 UTC (rev 14719)
@@ -94,6 +94,21 @@
             false
         );
 
+        $('bill_patron_btn').addEventListener(
+            'command',
+            function() {
+                JSAN.use('util.window'); var win = new util.window();
+                var my_xulG = win.open(
+                    urls.XUL_PATRON_BILL_WIZARD,
+                    'billwizard',
+                    'chrome,resizable,modal',
+                    { 'patron_id' : g.patron_id }
+                );
+                if (my_xulG.xact_id) { g.funcs.push( gen_list_append_func( my_xulG.xact_id ) ); /* FIXME: do something to update summary sidebar */ }
+            },
+            false
+        );
+
 }
 
 function $(id) { return document.getElementById(id); }
@@ -232,6 +247,13 @@
     }
 }
 
+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 } } } ); }
+    }
+}
+
 function retrieve_mbts_for_list() {
     var method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE.authoritative';
     g.mbts_ids = g.network.simple_request(method,[ses(),g.patron_id]);
@@ -246,16 +268,9 @@
    
         g.mbts_ids.reverse();
  
-        function gen_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 } } } ); }
-            }
-        }
-
         for (var i = 0; i < g.mbts_ids.length; i++) {
             dump('i = ' + i + ' g.mbts_ids[i] = ' + g.mbts_ids[i] + '\n');
-            g.funcs.push( gen_func(g.mbts_ids[i]) );
+            g.funcs.push( gen_list_append_func(g.mbts_ids[i]) );
         }
     }
 }

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul	2009-11-02 07:15:50 UTC (rev 14718)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.xul	2009-11-02 07:28:26 UTC (rev 14719)
@@ -116,7 +116,7 @@
             </hbox>
             <splitter />
             <hbox>
-                <button label="Bill Patron" accesskey="" />
+                <button id="bill_patron_btn" label="Bill Patron" accesskey="" />
                 <button label="History" accesskey="" />
                 <spacer flex="1"/>
                 <menubar>

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js	2009-11-02 07:15:50 UTC (rev 14718)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js	2009-11-02 07:28:26 UTC (rev 14719)
@@ -202,6 +202,14 @@
                 );
                 if (typeof mb_id.ilsevent != 'undefined') throw(mb_id);
                 //alert($('patronStrings').getString('staff.patron.bill_wizard.patron_bill_finish.billing_added'));
+
+                update_modal_xulG(
+                    {
+                        mb_id : mb_id,
+                        xact_id : xact_id
+                    }
+                );
+
             } else {
                 throw(xact_id);
             }



More information about the open-ils-commits mailing list