From 055c5afc7c387faeba0ddfb459de484f17cc5858 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 20 Sep 2012 16:02:16 -0400 Subject: [PATCH] better refresh of patron summary interface after certain actions in Items Out and Bills, like Add Billing Signed-off-by: Jason Etheridge Signed-off-by: Kathy Lussier Signed-off-by: Jason Stephenson --- .../xul/staff_client/server/patron/bill2.js | 5 ++- .../xul/staff_client/server/patron/display.js | 6 +++- .../xul/staff_client/server/patron/items.js | 31 +++++++++++-------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 6c0b7dee7f..83bf51c8d2 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -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 ); diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 7e2a547f18..2deb0c86f1 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -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(); } } diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 47fa5e7cd8..65e36b7a65 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -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); } } }, -- 2.43.2