[open-ils-commits] r7722 -
branches/rel_1_2/Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Aug 26 23:55:01 EDT 2007
Author: phasefx
Date: 2007-08-26 23:49:24 -0400 (Sun, 26 Aug 2007)
New Revision: 7722
Modified:
branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/items.js
Log:
backport to rel_1_2 a fix for renewals in patron Items Out
Modified: branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/items.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/items.js 2007-08-27 03:47:48 UTC (rev 7721)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/items.js 2007-08-27 03:49:24 UTC (rev 7722)
@@ -297,20 +297,26 @@
}
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 @@
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);
}
};
}
More information about the open-ils-commits
mailing list