This fixes the invocation of Bill History
authorJason Etheridge <jason@esilibrary.com>
Wed, 27 Mar 2013 18:37:01 +0000 (14:37 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 6 Mar 2014 04:59:54 +0000 (23:59 -0500)
when used with this new patron display/summary

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/display.xul
Open-ILS/xul/staff_client/server/patron/patron.js

index e2e308e..58028a6 100644 (file)
@@ -178,16 +178,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
         );
index 95d5e5b..4000857 100644 (file)
@@ -34,6 +34,7 @@
 
         <command id="cmd_reload" />
         <command id="cmd_bills" />
+        <command id="cmd_bill_history" />
         <command id="cmd_checkout" />
         <command id="cmd_edit" />
         <command id="cmd_events" />
index c273cc8..98b028e 100644 (file)
@@ -117,7 +117,7 @@ function get_tab_name(p_interface) {
             case 'group':
                 tab_name = 'Group Patron#' + patron_id;
             break;
-            case 'bills':
+            case 'bills': case 'bill_history':
                 tab_name = 'Bills Patron#' + patron_id;
             break;
             case 'edit':
@@ -151,7 +151,9 @@ function get_tab_name(p_interface) {
 function patron_tab(p_interface,replace_tab) {
     try {
         if (replace_tab == 'merely_reset') {
-            $(main_interface).disabled = false;
+            if ($(main_interface)) {
+                $(main_interface).disabled = false;
+            }
             main_interface = p_interface;
             try {
                 xulG.set_tab_name(get_tab_name(main_interface));
@@ -458,6 +460,7 @@ function patron_ui_setup() {
 
         [
             "bills",
+            "bill_history",
             "checkout",
             "edit",
             "events",
@@ -505,7 +508,9 @@ function patron_ui_populate() {
             }, 0
         );
 
-        $(main_interface).disabled = true;
+        if ($(main_interface)) {
+            $(main_interface).disabled = true;
+        }
 
         var barcode_for_some_interfaces = xul_param('barcode');
         var patron_object_for_some_interfaces;
@@ -549,6 +554,9 @@ function patron_ui_populate() {
             case 'bills':
                 src = urls.XUL_PATRON_BILLS;
             break;
+            case 'bill_history':
+                src = urls.XUL_PATRON_BILL_HISTORY;
+            break;
             case 'edit':
                 src = urls.XUL_REMOTE_BROWSER; /* XUL_PATRON_EDIT */
             break;
@@ -618,6 +626,11 @@ function patron_ui_populate() {
                 cw.xulG.on_money_change = function(b) {
                     reset_summary();
                 }
+                cw.xulG.alt_bill_history = function() {
+                    patron_tab('bill_history','merely_reset');
+                }
+            break;
+            case 'bill_history':
             break;
             case 'edit':
                 cw.xulG.url = urls.XUL_PATRON_EDIT;