modify bill2.js
authorJason Etheridge <jason@esilibrary.com>
Tue, 1 Oct 2013 20:21:21 +0000 (16:21 -0400)
committerJason Etheridge <jason@esilibrary.com>
Tue, 1 Oct 2013 21:06:04 +0000 (17:06 -0400)
Open-ILS/xul/staff_client/server/patron/bill2.js

index a9af71d..e20fad3 100644 (file)
@@ -152,6 +152,7 @@ function event_listeners() {
         window.bill_event_listeners.add($('bill_patron_btn'), 
             'command',
             function() {
+                $('bill_patron_btn').disabled = true;
                 JSAN.use('util.window'); var win = new util.window();
                 var my_xulG = win.open(
                     urls.XUL_PATRON_BILL_WIZARD,
@@ -163,6 +164,7 @@ function event_listeners() {
                     g.funcs.push( gen_list_append_func( my_xulG.xact_id ) );
                     if (typeof window.xulG == 'object' && typeof window.xulG.on_money_change == 'function') window.xulG.on_money_change();
                 }
+                $('bill_patron_btn').disabled = false;
             },
             false
         );
@@ -170,16 +172,24 @@ function event_listeners() {
         window.bill_event_listeners.add($('bill_history_btn'), 
             'command',
             function() {
-                xulG.display_window.g.patron.right_deck.reset_iframe( 
-                    urls.XUL_PATRON_BILL_HISTORY,
-                    {},
-                    {
+                if (xulG.alt_bill_history) {
+                    xulG.alt_bill_history();
+                } else {
+                    var content_params = {
                         'patron_id' : g.patron_id,
                         'refresh' : function() { refresh(); },
                         'new_tab' : xulG.new_tab,
                         'url_prefix' : xulG.url_prefix
-                    }
-                );
+                    };
+                    var func = xulG.display_window
+                        ? xulG.display_window.g.patron.right_deck.reset_iframe
+                        : xulG.set_tab;
+                    func(
+                        urls.XUL_PATRON_BILL_HISTORY,
+                        {},
+                        content_params
+                    );
+                }
             },
             false
         );