better refresh of patron summary interface
authorJason Etheridge <jason@esilibrary.com>
Thu, 20 Sep 2012 20:02:16 +0000 (16:02 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Thu, 11 Oct 2012 13:21:05 +0000 (09:21 -0400)
after certain actions in Items Out and Bills, like Add Billing

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/xul/staff_client/server/patron/bill2.js
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/items.js

index 6c0b7de..83bf51c 100644 (file)
@@ -146,7 +146,10 @@ function event_listeners() {
                     '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 */ }
+                if (my_xulG.xact_id) {
+                    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();
+                }
             },
             false
         );
index 7e2a547..2deb0c8 100644 (file)
@@ -217,7 +217,9 @@ patron.display.prototype = {
                                         obj.summary_window.g.summary.controller.render('patron_checkouts');
                                         obj.summary_window.g.summary.controller.render('patron_standing_penalties');
                                         obj.summary_window.g.summary.controller.render('patron_bill');
-                                        obj.bill_window.g.bills.refresh(true);
+                                        if (obj.bill_window) {
+                                            obj.bill_window.refresh(true);
+                                        }
                                     },
                                     'url_prefix' : function(url,secure) { return xulG.url_prefix(url,secure); },
                                     'get_new_session' : function(a) { return xulG.get_new_session(a); },
@@ -520,6 +522,8 @@ patron.display.prototype = {
                                     'get_new_session' : function(a) { return xulG.get_new_session(a); },
                                     'new_tab' : function(a,b,c) { return xulG.new_tab(a,b,c); },
                                     'on_money_change' : function(b) {
+                                        obj.summary_window.g.summary.controller.render('patron_standing_penalties');
+                                        obj.summary_window.g.summary.controller.render('patron_bill');
                                         obj.summary_window.refresh();
                                     }
                                 }
index 47fa5e7..65e36b7 100644 (file)
@@ -156,12 +156,12 @@ patron.items.prototype = {
                     'cmd_items_renew_all' : [ ['command'], function() { obj.items_renew_all({which_list:1}); } ],
                     'cmd_items_renew2' : [ ['command'], function() { obj.items_renew({which_list:2}); } ],
                     'cmd_items_renew_with_date2' : [ ['command'], function() { obj.items_renew({which_list:2,skip_prompt:true,get_date:true}); } ],
-                    'cmd_items_edit' : [ ['command'], function() { obj.items_edit(1);  /*obj.retrieve();*/ } ],
-                    'cmd_items_edit2' : [ ['command'], function() { obj.items_edit(2);  /*obj.retrieve();*/ } ],
-                    'cmd_items_mark_lost' : [ ['command'], function() { obj.items_mark_lost(1);  /*obj.retrieve();*/ } ],
-                    'cmd_items_mark_lost2' : [ ['command'], function() { obj.items_mark_lost(2);  /*obj.retrieve();*/ } ],
-                    'cmd_items_claimed_returned' : [ ['command'], function() { obj.items_claimed_returned(1);  /*obj.retrieve();*/ } ],
-                    'cmd_items_claimed_returned2' : [ ['command'], function() { obj.items_claimed_returned(2);  /*obj.retrieve();*/ } ],
+                    'cmd_items_edit' : [ ['command'], function() { obj.items_edit(1);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_edit2' : [ ['command'], function() { obj.items_edit(2);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_mark_lost' : [ ['command'], function() { obj.items_mark_lost(1);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_mark_lost2' : [ ['command'], function() { obj.items_mark_lost(2);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_claimed_returned' : [ ['command'], function() { obj.items_claimed_returned(1);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_claimed_returned2' : [ ['command'], function() { obj.items_claimed_returned(2);  obj.refresh_outer_interfaces(); } ],
                     'cmd_items_claimed_never_checked_out' : [
                         ['command'],
                         function() {
@@ -178,12 +178,12 @@ patron.items.prototype = {
                             );
                         }
                     ],
-                    'cmd_items_checkin' : [ ['command'], function() { obj.items_checkin(1);  /*obj.retrieve();*/ } ],
-                    'cmd_items_checkin2' : [ ['command'], function() { obj.items_checkin(2);  /*obj.retrieve();*/ } ],
+                    'cmd_items_checkin' : [ ['command'], function() { obj.items_checkin(1);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_items_checkin2' : [ ['command'], function() { obj.items_checkin(2);  obj.refresh_outer_interfaces(); } ],
                     'cmd_show_catalog' : [ ['command'], function() { obj.show_catalog(1); } ],
                     'cmd_show_catalog2' : [ ['command'], function() { obj.show_catalog(2); } ],
-                    'cmd_add_billing' : [ ['command'], function() { obj.add_billing(1);  /*obj.retrieve();*/ } ],
-                    'cmd_add_billing2' : [ ['command'], function() { obj.add_billing(2);  /*obj.retrieve();*/ } ],
+                    'cmd_add_billing' : [ ['command'], function() { obj.add_billing(1);  obj.refresh_outer_interfaces(); } ],
+                    'cmd_add_billing2' : [ ['command'], function() { obj.add_billing(2);  obj.refresh_outer_interfaces(); } ],
                     'cmd_show_noncats' : [ ['command'], function() { obj.show_noncats(); } ]
                 }
             }
@@ -933,9 +933,14 @@ patron.items.prototype = {
         }
         exec.chain( rows );
         if (!dont_show_me_the_list_change) {
-            if (window.xulG && typeof window.xulG.on_list_change == 'function') {
-                try { window.xulG.on_list_change(obj.checkouts); } catch(E) { this.error.sdump('D_ERROR',E); }
-            }
+            obj.refresh_outer_interfaces();
+        }
+    },
+
+    'refresh_outer_interfaces' : function() {
+        var obj = this;
+        if (window.xulG && typeof window.xulG.on_list_change == 'function') {
+            try { window.xulG.on_list_change(obj.checkouts); } catch(E) { this.error.sdump('D_ERROR',E); }
         }
     },