}
var r = window.confirm($("patronStrings").getString('staff.patron.items.items_renew_all.renew_items_in_list'));
if (!r) return;
+ obj.list.select_all();
function flesh_callback() {
try {
- obj.list.select_all();
- params.skip_prompt = true;
- if (!params.which_list) params.which_list = 1;
- obj.items_renew(params);
- setTimeout(function(){list.on_all_fleshed = null; /* obj.retrieve();*/ },0);
+ setTimeout(function(){
+ list.on_all_fleshed = null;
+ params.skip_prompt = true;
+ if (!params.which_list) params.which_list = 1;
+ obj.items_renew(params);
+ },0);
} catch(E) {
obj.error.standard_unexpected_error_alert($("patronStrings").getFormattedString('staff.patron.items.items_renew_all.items_not_renewed', ['2']),E);
}
}
var p = { 'barcode' : bc, 'patron' : obj.patron_id };
if (params.due_date) p.due_date = params.due_date;
- var renew = circ.util.renew_via_barcode(
- p,
- function(r) {
- try {
- if ( (typeof r[0].ilsevent != 'undefined' && r[0].ilsevent == 0) ) {
- l.setAttribute('value', $("patronStrings").getFormattedString('staff.patron.items.items_renew.renewed',[bc]));
- 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 {
- var msg = $("patronStrings").getFormattedString('staff.patron.items.items_renew.not_renewed',[bc, r[0].textcode + r[0].desc]);
- l.setAttribute('value', msg);
- alert(msg);
- }
- 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($("patronStrings").getFormattedString('staff.patron.items.items_renew.err_in_renew_via_barcode',[bc]), E);
- }
- }
- );
+ var r = circ.util.renew_via_barcode( p );
+ try {
+ if ( (typeof r[0].ilsevent != 'undefined' && r[0].ilsevent == 0) ) {
+ l.setAttribute('value', $("patronStrings").getFormattedString('staff.patron.items.items_renew.renewed',[bc]));
+ 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 {
+ var msg = $("patronStrings").getFormattedString('staff.patron.items.items_renew.not_renewed',[bc, r[0].textcode + r[0].desc]);
+ l.setAttribute('value', msg);
+ alert(msg);
+ }
+ 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($("patronStrings").getFormattedString('staff.patron.items.items_renew.err_in_renew_via_barcode',[bc]), E);
+ }
}
for (var i = 0; i < retrieve_ids.length; i++) {