From: phasefx Date: Mon, 27 Aug 2007 03:49:24 +0000 (+0000) Subject: backport to rel_1_2 a fix for renewals in patron Items Out X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3dfcbb00adf5ea3620e4b3877604f4a024436a22;p=Evergreen.git backport to rel_1_2 a fix for renewals in patron Items Out git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7722 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 3aeb8253d0..4ecfb09570 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -297,20 +297,26 @@ patron.items.prototype = { } var renew = circ.util.renew_via_barcode( barcode, obj.patron_id, function(r) { - if ( (typeof r[0].ilsevent != 'undefined' && r[0].ilsevent == 0) ) { - l.setAttribute('value', bc + ' renewed.'); - obj.list_circ_map[ circ_id ].row.my.circ = r[0].payload.circ; - obj.list_circ_map[ circ_id ].row.my.acp = r[0].payload.copy; - obj.list_circ_map[ circ_id ].row.my.mvr = r[0].payload.record; - } else { - l.setAttribute('value', bc + ' not renewed. ' + r[0].textcode + r[0].desc); - } - count--; - if (count == 0) { - //if (window.confirm('Action completed. Refresh list?')) obj.retrieve(); - JSAN.use('util.widgets'); util.widgets.remove_children(x); - } - obj.refresh(circ_id); + try { + if ( (typeof r[0].ilsevent != 'undefined' && r[0].ilsevent == 0) ) { + l.setAttribute('value', bc + ' renewed.'); + obj.list_circ_map[ circ_id ].row.my.circ = r[0].payload.circ; + obj.list_circ_map[ circ_id ].row.my.acp = r[0].payload.copy; + obj.list_circ_map[ circ_id ].row.my.mvr = r[0].payload.record; + // A renewed circ is a new circ, and has a new circ_id. + obj.list_circ_map[ r[0].payload.circ.id() ] = obj.list_circ_map[ circ_id ]; + } else { + l.setAttribute('value', bc + ' not renewed. ' + r[0].textcode + r[0].desc); + } + count--; + if (count == 0) { + //if (window.confirm('Action completed. Refresh list?')) obj.retrieve(); + JSAN.use('util.widgets'); util.widgets.remove_children(x); + } + obj.refresh(circ_id); + } catch(E) { + obj.error.standard_unexpected_error_alert('Error in renew_via_barcode callback\nRenew probably did not happen for barcode ' + barcode,E); + } } ); } @@ -745,10 +751,10 @@ patron.items.prototype = { if (nparams) { obj.list_circ_map[circ_id] = nparams; // unlike item status interface, each circ should be in this list only once } else { - alert('foo'); + throw('typeof nparams = ' + typeof nparams); } } catch(E) { - alert(E); + obj.error.standard_unexpected_error_alert('patron/items.js: error in gen_list_append',E); } }; }