From c6082d8021c26140dd0b307b0fc2374e97b069fc Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 2 Nov 2009 07:28:26 +0000 Subject: [PATCH] wire up Bill Patron, and have it append to the list without refreshing the whole display git-svn-id: svn://svn.open-ils.org/ILS/trunk@14719 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/bill2.js | 31 ++++++++++++++++------ Open-ILS/xul/staff_client/server/patron/bill2.xul | 2 +- .../xul/staff_client/server/patron/bill_wizard.js | 8 ++++++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js index 9d1856d565..ee185979c0 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.js +++ b/Open-ILS/xul/staff_client/server/patron/bill2.js @@ -94,6 +94,21 @@ function event_listeners() { 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 check_all_refunds() { } } +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 @@ function retrieve_mbts_for_list() { 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]) ); } } } diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.xul b/Open-ILS/xul/staff_client/server/patron/bill2.xul index 7b0eb25487..283d2c25c3 100644 --- a/Open-ILS/xul/staff_client/server/patron/bill2.xul +++ b/Open-ILS/xul/staff_client/server/patron/bill2.xul @@ -116,7 +116,7 @@ -