1 dump('entering circ/util.js\n');
4 if (typeof circ == 'undefined') { var circ = {}; }
7 circ.util.EXPORT_OK = [
8 'offline_checkout_columns', 'offline_checkin_columns', 'offline_renew_columns', 'offline_inhouse_use_columns',
9 'columns', 'hold_columns', 'checkin_via_barcode', 'std_map_row_to_columns',
10 'show_last_few_circs', 'abort_transits', 'transit_columns', 'renew_via_barcode'
12 circ.util.EXPORT_TAGS = { ':all' : circ.util.EXPORT_OK };
14 circ.util.abort_transits = function(selection_list) {
16 JSAN.use('util.error'); obj.error = new util.error();
17 JSAN.use('util.network'); obj.network = new util.network();
18 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
19 JSAN.use('util.functional');
20 var copies = util.functional.map_list( selection_list, function(o){return o.copy_id;}).join(', ');
21 var msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.abort_transits.confirm', [copies]);
22 var r = obj.error.yns_alert(
24 document.getElementById('circStrings').getString('staff.circ.utils.abort_transits.title'),
25 document.getElementById('circStrings').getString('staff.circ.utils.yes'),
26 document.getElementById('circStrings').getString('staff.circ.utils.no'),
28 document.getElementById('circStrings').getString('staff.circ.confirm')
32 for (var i = 0; i < selection_list.length; i++) {
33 var copy_id = selection_list[i].copy_id;
34 var robj = obj.network.simple_request('FM_ATC_VOID',[ ses(), { 'copyid' : copy_id } ]);
35 if (typeof robj.ilsevent != 'undefined') {
36 switch(Number(robj.ilsevent)) {
37 case 1225 /* TRANSIT_ABORT_NOT_ALLOWED */ :
38 alert(document.getElementById('circString').getFormattedString('staff.circ.utils.abort_transits.not_allowed', [copy_id]) + '\n' + robj.desc);
40 case 1504 /* ACTION_TRANSIT_COPY_NOT_FOUND */ :
41 alert(document.getElementById('circString').getString('staff.circ.utils.abort_transits.not_found'));
43 case 5000 /* PERM_FAILURE */ :
52 obj.error.standard_unexpected_error_alert(document.getElementById('circString').getString('staff.circ.utils.abort_transits.unexpected_error'),E);
57 circ.util.show_copy_details = function(copy_id) {
59 JSAN.use('util.error'); obj.error = new util.error();
60 JSAN.use('util.window'); obj.win = new util.window();
61 JSAN.use('util.network'); obj.network = new util.network();
62 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
64 if (typeof copy_id == 'object' && copy_id != null) copy_id = copy_id.id();
67 var url = xulG.url_prefix( urls.XUL_COPY_DETAILS ); // + '?copy_id=' + copy_id;
68 var my_xulG = obj.win.open( url, 'show_copy_details', 'chrome,resizable,modal', { 'copy_id' : copy_id } );
70 if (typeof my_xulG.retrieve_these_patrons == 'undefined') return;
71 var patrons = my_xulG.retrieve_these_patrons;
72 for (var j = 0; j < patrons.length; j++) {
73 if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') {
75 window.xulG.new_patron_tab( {}, { 'id' : patrons[j] } );
77 obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_patron.failure'), E);
83 obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_copy.failure'),E);
88 circ.util.show_last_few_circs = function(selection_list) {
90 JSAN.use('util.error'); obj.error = new util.error();
91 JSAN.use('util.window'); obj.win = new util.window();
92 JSAN.use('util.network'); obj.network = new util.network();
93 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
95 for (var i = 0; i < selection_list.length; i++) {
97 if (typeof selection_list[i].copy_id == 'undefined' || selection_list[i].copy_id == null) continue;
98 var url = xulG.url_prefix( urls.XUL_CIRC_SUMMARY ); // + '?copy_id=' + selection_list[i].copy_id + '&count=' + count;
99 var my_xulG = obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal', { 'copy_id' : selection_list[i].copy_id } );
101 if (typeof my_xulG.retrieve_these_patrons == 'undefined') continue;
102 var patrons = my_xulG.retrieve_these_patrons;
103 for (var j = 0; j < patrons.length; j++) {
104 if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') {
106 window.xulG.new_patron_tab( {}, { 'id' : patrons[j] } );
108 obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_patron.failure') ,E);
114 obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_circs.failure') ,E);
119 circ.util.offline_checkout_columns = function(modify,params) {
124 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'),
128 'render' : function(my) { return my.timestamp; }
131 'id' : 'checkout_time',
132 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.checkout_time'),
136 'render' : function(my) { return my.checkout_time; }
140 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'),
144 'render' : function(my) { return my.type; }
148 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.noncat'),
152 'render' : function(my) { return my.noncat; }
155 'id' : 'noncat_type',
156 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.noncat_type'),
160 'render' : function(my) { return my.noncat_type; }
163 'id' : 'noncat_count',
164 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.count'),
165 'sort_type' : 'number',
169 'render' : function(my) { return my.noncat_count; }
172 'id' : 'patron_barcode',
173 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'),
177 'render' : function(my) { return my.patron_barcode; }
181 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'),
185 'render' : function(my) { return my.barcode; }
189 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.due_date'),
193 'render' : function(my) { return my.due_date; }
197 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_time'),
201 'render' : function(my) { return my.due_time; }
205 if (modify) for (var i = 0; i < c.length; i++) {
206 if (modify[ c[i].id ]) {
207 for (var j in modify[ c[i].id ]) {
208 c[i][j] = modify[ c[i].id ][j];
213 if (params.just_these) {
214 JSAN.use('util.functional');
216 for (var i = 0; i < params.just_these.length; i++) {
217 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
218 new_c.push( function(y){ return y; }( x ) );
222 if (params.except_these) {
223 JSAN.use('util.functional');
225 for (var i = 0; i < c.length; i++) {
226 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
227 if (!x) new_c.push(c[i]);
233 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
236 circ.util.offline_checkin_columns = function(modify,params) {
241 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'),
245 'render' : function(my) { return my.timestamp; }
249 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.backdate'),
253 'render' : function(my) { return my.backdate; }
257 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'),
261 'render' : function(my) { return my.type; }
265 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'),
269 'render' : function(my) { return my.barcode; }
272 if (modify) for (var i = 0; i < c.length; i++) {
273 if (modify[ c[i].id ]) {
274 for (var j in modify[ c[i].id ]) {
275 c[i][j] = modify[ c[i].id ][j];
280 if (params.just_these) {
281 JSAN.use('util.functional');
283 for (var i = 0; i < params.just_these.length; i++) {
284 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
285 new_c.push( function(y){ return y; }( x ) );
289 if (params.except_these) {
290 JSAN.use('util.functional');
292 for (var i = 0; i < c.length; i++) {
293 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
294 if (!x) new_c.push(c[i]);
300 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
303 circ.util.offline_renew_columns = function(modify,params) {
308 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'),
312 'render' : function(my) { return my.timestamp; }
315 'id' : 'checkout_time',
316 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.checkout_time'),
320 'render' : function(my) { return my.checkout_time; }
324 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'),
328 'render' : function(my) { return my.type; }
331 'id' : 'patron_barcode',
332 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'),
336 'render' : function(my) { return my.patron_barcode; }
340 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'),
344 'render' : function(my) { return my.barcode; }
348 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.due_date'),
352 'render' : function(my) { return my.due_date; }
356 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_time'),
360 'render' : function(my) { return my.due_time; }
363 if (modify) for (var i = 0; i < c.length; i++) {
364 if (modify[ c[i].id ]) {
365 for (var j in modify[ c[i].id ]) {
366 c[i][j] = modify[ c[i].id ][j];
371 if (params.just_these) {
372 JSAN.use('util.functional');
374 for (var i = 0; i < params.just_these.length; i++) {
375 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
376 new_c.push( function(y){ return y; }( x ) );
380 if (params.except_these) {
381 JSAN.use('util.functional');
383 for (var i = 0; i < c.length; i++) {
384 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
385 if (!x) new_c.push(c[i]);
391 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
394 circ.util.offline_inhouse_use_columns = function(modify,params) {
399 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'),
403 'render' : function(my) { return my.timestamp; }
407 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.use_time'),
411 'render' : function(my) { return my.use_time; }
415 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'),
419 'render' : function(my) { return my.type; }
423 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.count'),
424 'sort_type' : 'number',
428 'render' : function(my) { return my.count; }
432 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'),
436 'render' : function(my) { return my.barcode; }
439 if (modify) for (var i = 0; i < c.length; i++) {
440 if (modify[ c[i].id ]) {
441 for (var j in modify[ c[i].id ]) {
442 c[i][j] = modify[ c[i].id ][j];
447 if (params.just_these) {
448 JSAN.use('util.functional');
450 for (var i = 0; i < params.just_these.length; i++) {
451 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
452 new_c.push( function(y){ return y; }( x ) );
456 if (params.except_these) {
457 JSAN.use('util.functional');
459 for (var i = 0; i < c.length; i++) {
460 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
461 if (!x) new_c.push(c[i]);
467 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
470 circ.util.columns = function(modify,params) {
472 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
473 JSAN.use('util.network'); var network = new util.network();
474 JSAN.use('util.money');
479 'label' : document.getElementById('commonStrings').getString('staff.acp_label_id'),
483 'render' : function(my) { return my.acp.id(); },
484 'persist' : 'hidden width ordinal'
488 'label' : document.getElementById('commonStrings').getString('staff.circ_label_id'),
492 'render' : function(my) { return my.circ ? my.circ.id() : ( my.acp.circulations() ? my.acp.circulations()[0].id() : ""); },
493 'persist' : 'hidden width ordinal'
497 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_doc_id'),
501 'render' : function(my) { return my.mvr.doc_id(); },
502 'persist' : 'hidden width ordinal'
505 'persist' : 'hidden width ordinal',
511 'render' : function(my) { return my.service; }
515 'label' : document.getElementById('commonStrings').getString('staff.acp_label_barcode'),
519 'render' : function(my) { return my.acp.barcode(); },
520 'persist' : 'hidden width ordinal'
523 'id' : 'call_number',
524 'label' : document.getElementById('commonStrings').getString('staff.acp_label_call_number'),
528 'render' : function(my) {
529 if (my.acp && my.acp.call_number() == -1) {
530 return document.getElementById('circStrings').getString('staff.circ.utils.not_cataloged');
531 } else if (my.acp && my.acp.call_number() == -2) {
532 return document.getElementById('circStrings').getString('staff.circ.utils.retrieving');
535 var x = network.simple_request("FM_ACN_RETRIEVE.authoritative",[ my.acp.call_number() ]);
537 return document.getElementById('circStrings').getString('staff.circ.utils.not_cataloged');
539 my.acn = x; return x.label();
542 return my.acn.label();
546 'persist' : 'hidden width ordinal'
550 'label' : document.getElementById('circStrings').getString('staff.circ.utils.owning_lib'),
554 'render' : function(my) {
555 if (Number(my.acn.owning_lib())>=0) {
556 return data.hash.aou[ my.acn.owning_lib() ].shortname();
558 return my.acn.owning_lib().shortname();
561 'persist' : 'hidden width ordinal'
564 'id' : 'copy_number',
565 'label' : document.getElementById('commonStrings').getString('staff.acp_label_copy_number'),
567 'sort_type' : 'number',
570 'render' : function(my) { return my.acp.copy_number(); },
571 'persist' : 'hidden width ordinal'
575 'label' : document.getElementById('commonStrings').getString('staff.acp_label_location'),
579 'render' : function(my) {
580 if (Number(my.acp.location())>=0) {
581 return data.lookup("acpl", my.acp.location() ).name();
583 return my.acp.location().name();
586 'persist' : 'hidden width ordinal'
589 'id' : 'loan_duration',
590 'label' : document.getElementById('commonStrings').getString('staff.acp_label_loan_duration'),
594 'render' : function(my) {
595 switch(Number(my.acp.loan_duration())) {
597 return document.getElementById('circStrings').getString('staff.circ.utils.loan_duration.short');
600 return document.getElementById('circStrings').getString('staff.circ.utils.loan_duration.normal');
603 return document.getElementById('circStrings').getString('staff.circ.utils.loan_duration.long');
607 'persist' : 'hidden width ordinal'
611 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_lib'),
615 'render' : function(my) {
616 if (Number(my.acp.circ_lib())>=0) {
617 return data.hash.aou[ my.acp.circ_lib() ].shortname();
619 return my.acp.circ_lib().shortname();
622 'persist' : 'hidden width ordinal'
626 'label' : document.getElementById('commonStrings').getString('staff.acp_label_fine_level'),
630 'render' : function(my) {
631 switch(Number(my.acp.fine_level())) {
633 return document.getElementById('circStrings').getString('staff.circ.utils.fine_level.low');
636 return document.getElementById('circStrings').getString('staff.circ.utils.fine_level.normal');
639 return document.getElementById('circStrings').getString('staff.circ.utils.fine_level.high');
643 'persist' : 'hidden width ordinal'
647 'label' : document.getElementById('circStrings').getString('staff.circ.utils.circulate'),
651 'render' : function(my) {
652 if (get_bool( my.acp.circulate() )) {
653 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
655 return document.getElementById('circStrings').getString('staff.circ.utils.no');
658 'persist' : 'hidden width ordinal'
662 'label' : document.getElementById('circStrings').getString('staff.circ.utils.deleted'),
666 'render' : function(my) {
667 if (get_bool( my.acp.deleted() )) {
668 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
670 return document.getElementById('circStrings').getString('staff.circ.utils.no');
673 'persist' : 'hidden width ordinal'
677 'label' : document.getElementById('circStrings').getString('staff.circ.utils.holdable'),
681 'render' : function(my) {
682 if (get_bool( my.acp.holdable() )) {
683 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
685 return document.getElementById('circStrings').getString('staff.circ.utils.no');
688 'persist' : 'hidden width ordinal'
691 'id' : 'opac_visible',
692 'label' : document.getElementById('circStrings').getString('staff.circ.utils.opac_visible'),
696 'render' : function(my) {
697 if (get_bool( my.acp.opac_visible() )) {
698 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
700 return document.getElementById('circStrings').getString('staff.circ.utils.no');
703 'persist' : 'hidden width ordinal'
706 'persist' : 'hidden width ordinal',
708 'label' : document.getElementById('circStrings').getString('staff.circ.utils.reference'),
712 'render' : function(my) {
713 if (get_bool( my.acp.ref() )) {
714 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
716 return document.getElementById('circStrings').getString('staff.circ.utils.no');
721 'persist' : 'hidden width ordinal',
723 'label' : document.getElementById('circStrings').getString('staff.circ.utils.deposit'),
727 'render' : function(my) {
728 if (get_bool( my.acp.deposit() )) {
729 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
731 return document.getElementById('circStrings').getString('staff.circ.utils.no');
736 'persist' : 'hidden width ordinal',
737 'id' : 'deposit_amount',
738 'label' : document.getElementById('commonStrings').getString('staff.acp_label_deposit_amount'),
742 'render' : function(my) {
743 if (my.acp.price() == null) {
744 return document.getElementById('circStrings').getString('staff.circ.utils.unset');
746 return util.money.sanitize(my.acp.deposit_amount());
749 'sort_type' : 'money'
752 'persist' : 'hidden width ordinal',
754 'label' : document.getElementById('commonStrings').getString('staff.acp_label_price'),
758 'render' : function(my) {
759 if (my.acp.price() == null) {
760 return document.getElementById('circStrings').getString('staff.circ.utils.unset');
762 return util.money.sanitize(my.acp.price());
765 'sort_type' : 'money'
768 'persist' : 'hidden width ordinal',
769 'id' : 'circ_as_type',
770 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_as_type'),
774 'render' : function(my) { return my.acp.circ_as_type(); }
777 'persist' : 'hidden width ordinal',
778 'id' : 'circ_modifier',
779 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_modifier'),
783 'render' : function(my) { return my.acp.circ_modifier(); }
786 'persist' : 'hidden width ordinal',
787 'id' : 'checkout_lib',
788 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkout_lib'),
792 'render' : function(my) {
794 return data.hash.aou[ my.circ.circ_lib() ].shortname();
796 if (my.acp.circulations()) {
797 return data.hash.aou[ my.acp.circulations()[0].circ_lib() ].shortname();
805 'persist' : 'hidden width ordinal',
806 'id' : 'xact_start_full',
807 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkout_timestamp'),
811 'render' : function(my) {
813 return my.circ.xact_start();
815 if (my.acp.circulations()) {
816 return my.acp.circulations()[0].xact_start();
825 'persist' : 'hidden width ordinal',
826 'id' : 'checkin_time_full',
827 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkin_timestamp'),
831 'render' : function(my) {
833 return my.circ.checkin_time();
835 if (my.acp.circulations()) {
836 return my.acp.circulations()[0].checkin_time();
844 'persist' : 'hidden width ordinal',
846 'label' : document.getElementById('circStrings').getString('staff.circ.utils.xact_start'),
850 'render' : function(my) {
852 return my.circ.xact_start().substr(0,10);
854 if (my.acp.circulations()) {
855 return my.acp.circulations()[0].xact_start().substr(0,10);
863 'persist' : 'hidden width ordinal',
864 'id' : 'checkin_time',
865 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkin_time'),
869 'render' : function(my) {
871 return my.circ.checkin_time().substr(0,10);
873 if (my.acp.circulations()) {
874 return my.acp.circulations()[0].checkin_time().substr(0,10);
882 'persist' : 'hidden width ordinal',
883 'id' : 'xact_finish',
884 'label' : document.getElementById('circStrings').getString('staff.circ.utils.xact_finish'),
888 'render' : function(my) { return my.circ.xact_finish(); }
891 'persist' : 'hidden width ordinal',
893 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_date'),
897 'render' : function(my) {
899 return my.circ.due_date().substr(0,10);
901 if (my.acp.circulations()) {
902 return my.acp.circulations()[0].due_date().substr(0,10);
910 'persist' : 'hidden width ordinal',
912 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_time'),
916 'render' : function(my) {
918 return my.circ.due_date().substr(11,8);
920 if (my.acp.circulations()) {
921 return my.acp.circulations()[0].due_date().substr(11,8);
929 'persist' : 'hidden width ordinal',
930 'id' : 'create_date',
931 'label' : document.getElementById('circStrings').getString('staff.circ.utils.create_date'),
935 'render' : function(my) { return my.acp.create_date().substr(0,10); }
938 'persist' : 'hidden width ordinal',
940 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edit_date'),
944 'render' : function(my) { return my.acp.edit_date().substr(0,10); }
947 'persist' : 'hidden width ordinal',
949 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'),
951 'sort_type' : 'title',
954 'render' : function(my) {
955 try { return my.mvr.title(); }
956 catch(E) { return my.acp.dummy_title(); }
960 'persist' : 'hidden width ordinal',
962 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'),
966 'render' : function(my) {
967 try { return my.mvr.author(); }
968 catch(E) { return my.acp.dummy_author(); }
972 'persist' : 'hidden width ordinal',
974 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edition'),
978 'render' : function(my) { return my.mvr.edition(); }
981 'persist' : 'hidden width ordinal',
983 'label' : document.getElementById('circStrings').getString('staff.circ.utils.isbn'),
987 'render' : function(my) { return my.mvr.isbn(); }
990 'persist' : 'hidden width ordinal',
992 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pubdate'),
996 'render' : function(my) { return my.mvr.pubdate(); }
999 'persist' : 'hidden width ordinal',
1001 'label' : document.getElementById('circStrings').getString('staff.circ.utils.publisher'),
1005 'render' : function(my) { return my.mvr.publisher(); }
1008 'persist' : 'hidden width ordinal',
1010 'label' : document.getElementById('circStrings').getString('staff.circ.utils.tcn'),
1014 'render' : function(my) { return my.mvr.tcn(); }
1017 'persist' : 'hidden width ordinal',
1018 'id' : 'renewal_remaining',
1019 'label' : document.getElementById('commonStrings').getString('staff.circ_label_renewal_remaining'),
1023 'render' : function(my) {
1025 return my.circ.renewal_remaining();
1027 if (my.acp.circulations()) {
1028 return my.acp.circulations()[0].renewal_remaining();
1034 'sort_type' : 'number'
1037 'persist' : 'hidden width ordinal',
1038 'id' : 'stop_fines',
1039 'label' : document.getElementById('circStrings').getString('staff.circ.utils.stop_fines'),
1043 'render' : function(my) {
1045 return my.circ.stop_fines();
1047 if (my.acp.circulations()) {
1048 return my.acp.circulations()[0].stop_fines();
1056 'persist' : 'hidden width ordinal',
1057 'id' : 'stop_fines_time',
1058 'label' : document.getElementById('circStrings').getString('staff.circ.utils.stop_fines_time'),
1062 'render' : function(my) {
1064 return my.circ.stop_fines_time();
1066 if (my.acp.circulations()) {
1067 return my.acp.circulations()[0].stop_fines_time();
1075 'persist' : 'hidden width ordinal',
1077 'label' : document.getElementById('commonStrings').getString('staff.acp_label_status'),
1081 'render' : function(my) {
1082 if (Number(my.acp.status())>=0) {
1083 return data.hash.ccs[ my.acp.status() ].name();
1085 return my.acp.status().name();
1090 'persist' : 'hidden width ordinal',
1092 'label' : document.getElementById('circStrings').getString('staff.circ.utils.route_to'),
1096 'render' : function(my) { return my.route_to.toString(); }
1099 'persist' : 'hidden width ordinal',
1101 'label' : document.getElementById('circStrings').getString('staff.circ.utils.message'),
1105 'render' : function(my) { return my.message.toString(); }
1108 'persist' : 'hidden width ordinal',
1110 'label' : document.getElementById('circStrings').getString('staff.circ.utils.uses'),
1114 'render' : function(my) { return my.uses; },
1115 'sort_type' : 'number'
1118 'persist' : 'hidden width ordinal',
1119 'id' : 'alert_message',
1120 'label' : document.getElementById('circStrings').getString('staff.circ.utils.alert_message'),
1124 'render' : function(my) { return my.acp.alert_message(); }
1127 for (var i = 0; i < c.length; i++) {
1128 if (modify[ c[i].id ]) {
1129 for (var j in modify[ c[i].id ]) {
1130 c[i][j] = modify[ c[i].id ][j];
1135 if (params.just_these) {
1136 JSAN.use('util.functional');
1138 for (var i = 0; i < params.just_these.length; i++) {
1139 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
1140 new_c.push( function(y){ return y; }( x ) );
1144 if (params.except_these) {
1145 JSAN.use('util.functional');
1147 for (var i = 0; i < c.length; i++) {
1148 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
1149 if (!x) new_c.push(c[i]);
1154 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
1157 circ.util.transit_columns = function(modify,params) {
1159 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
1163 'persist' : 'hidden width ordinal',
1164 'id' : 'transit_item_barcode',
1165 'label' : document.getElementById('circStrings').getString('staff.circ.utils.barcode'),
1169 'render' : function(my) { return my.acp.barcode(); }
1172 'persist' : 'hidden width ordinal',
1173 'id' : 'transit_item_title',
1174 'label' : document.getElementById('circStrings').getString('staff.circ.utils.title'),
1178 'render' : function(my) {
1179 try { return my.mvr.title(); }
1180 catch(E) { return my.acp.dummy_title(); }
1184 'persist' : 'hidden width ordinal',
1185 'id' : 'transit_item_author',
1186 'label' : document.getElementById('circStrings').getString('staff.circ.utils.author'),
1190 'render' : function(my) {
1191 try { return my.mvr.author(); }
1192 catch(E) { return my.acp.dummy_author(); }
1196 'persist' : 'hidden width ordinal',
1197 'id' : 'transit_item_callnumber',
1198 'label' : document.getElementById('circStrings').getString('staff.circ.utils.callnumber'),
1202 'render' : function(my) { return my.acn.label(); }
1205 'persist' : 'hidden width ordinal',
1206 'id' : 'transit_id',
1207 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_id'),
1211 'render' : function(my) { return my.atc.id(); }
1214 'persist' : 'hidden width ordinal',
1215 'id' : 'transit_source',
1216 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source'),
1220 'render' : function(my) {
1221 if (typeof my.atc.source() == "object") {
1222 return my.atc.source().shortname();
1224 return data.hash.aou[ my.atc.source() ].shortname();
1229 'persist' : 'hidden width ordinal',
1230 'id' : 'transit_source_send_time',
1231 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source_send_time'),
1235 'render' : function(my) { return my.atc.source_send_time(); }
1238 'persist' : 'hidden width ordinal',
1239 'id' : 'transit_dest_lib',
1240 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest'),
1244 'render' : function(my) {
1245 if (typeof my.atc.dest() == "object") {
1246 return my.atc.dest().shortname();
1248 return data.hash.aou[ my.atc.dest() ].shortname();
1253 'persist' : 'hidden width ordinal',
1254 'id' : 'transit_dest_recv_time',
1255 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest_recv_time'),
1259 'render' : function(my) { return my.atc.dest_recv_time(); }
1262 'persist' : 'hidden width ordinal',
1263 'id' : 'transit_target_copy',
1264 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_target_copy'),
1268 'render' : function(my) { return my.atc.target_copy(); }
1271 for (var i = 0; i < c.length; i++) {
1272 if (modify[ c[i].id ]) {
1273 for (var j in modify[ c[i].id ]) {
1274 c[i][j] = modify[ c[i].id ][j];
1279 if (params.just_these) {
1280 JSAN.use('util.functional');
1282 for (var i = 0; i < params.just_these.length; i++) {
1283 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
1284 new_c.push( function(y){ return y; }( x ) );
1288 if (params.except_these) {
1289 JSAN.use('util.functional');
1291 for (var i = 0; i < c.length; i++) {
1292 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
1293 if (!x) new_c.push(c[i]);
1299 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
1302 circ.util.hold_columns = function(modify,params) {
1304 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
1308 'persist' : 'hidden width ordinal',
1309 'id' : 'request_lib',
1310 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_lib'),
1314 'render' : function(my) {
1315 if (Number(my.ahr.request_lib())>=0) {
1316 return data.hash.aou[ my.ahr.request_lib() ].name();
1318 return my.ahr.request_lib().name();
1323 'persist' : 'hidden width ordinal',
1324 'id' : 'request_lib_shortname',
1325 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_lib_shortname'),
1329 'render' : function(my) {
1330 if (Number(my.ahr.request_lib())>=0) {
1331 return data.hash.aou[ my.ahr.request_lib() ].shortname();
1333 return my.ahr.request_lib().shortname();
1339 'persist' : 'hidden width ordinal',
1340 'id' : 'request_timestamp',
1341 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_timestamp'),
1345 'render' : function(my) { return my.ahr.request_time().toString(); }
1348 'persist' : 'hidden width ordinal',
1349 'id' : 'request_time',
1350 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_time'),
1354 'render' : function(my) { return my.ahr.request_time().toString().substr(0,10); }
1357 'persist' : 'hidden width ordinal',
1358 'id' : 'available_timestamp',
1359 'label' : document.getElementById('circStrings').getString('staff.circ.utils.available_timestamp'),
1363 'render' : function(my) {
1364 if (my.ahr.transit() && my.ahr.transit().dest_recv_time()) {
1365 return my.ahr.transit().dest_recv_time().toString();
1367 if (!my.ahr.transit() && my.ahr.capture_time()) {
1368 return my.ahr.capture_time().toString();
1374 'persist' : 'hidden width ordinal',
1375 'id' : 'available_time',
1376 'label' : document.getElementById('circStrings').getString('staff.circ.utils.available_time'),
1380 'render' : function(my) {
1381 if (my.ahr.transit() && my.ahr.transit().dest_recv_time()) {
1382 return my.ahr.transit().dest_recv_time().toString().substr(0,10);
1384 if (!my.ahr.transit() && my.ahr.capture_time()) {
1385 return my.ahr.capture_time().toString().substr(0,10);
1391 'persist' : 'hidden width ordinal',
1392 'id' : 'capture_timestamp',
1393 'label' : document.getElementById('circStrings').getString('staff.circ.utils.capture_timestamp'),
1397 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString() : ""; }
1400 'persist' : 'hidden width ordinal',
1401 'id' : 'capture_time',
1402 'label' : document.getElementById('circStrings').getString('staff.circ.utils.capture_time'),
1406 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : ""; }
1409 'persist' : 'hidden width ordinal',
1411 'label' : document.getElementById('commonStrings').getString('staff.ahr_status_label'),
1415 'render' : function(my) {
1416 switch (Number(my.status)) {
1418 return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.1');
1421 return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.2');
1424 return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.3');
1427 return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.4');
1430 return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.5');
1439 'persist' : 'hidden width ordinal',
1441 'label' : document.getElementById('commonStrings').getString('staff.ahr_hold_type_label'),
1445 'render' : function(my) { return my.ahr.hold_type(); }
1448 'persist' : 'hidden width ordinal',
1450 'label' : document.getElementById('circStrings').getString('staff.circ.utils.active'),
1454 'render' : function(my) {
1455 if (!get_bool( my.ahr.frozen() )) {
1456 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
1458 return document.getElementById('circStrings').getString('staff.circ.utils.no');
1463 'persist' : 'hidden width ordinal',
1465 'label' : document.getElementById('circStrings').getString('staff.circ.utils.thaw_date'),
1469 'render' : function(my) {
1470 if (my.ahr.thaw_date() == null) {
1471 return document.getElementById('circStrings').getString('staff.circ.utils.thaw_date.none');
1473 return my.ahr.thaw_date().substr(0,10);
1478 'persist' : 'hidden width ordinal',
1479 'id' : 'pickup_lib',
1480 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pickup_lib'),
1484 'render' : function(my) {
1485 if (Number(my.ahr.pickup_lib())>=0) {
1486 return data.hash.aou[ my.ahr.pickup_lib() ].name();
1488 return my.ahr.pickup_lib().name();
1493 'persist' : 'hidden width ordinal',
1494 'id' : 'pickup_lib_shortname',
1495 'label' : document.getElementById('commonStrings').getString('staff.ahr_pickup_lib_label'),
1499 'render' : function(my) {
1500 if (Number(my.ahr.pickup_lib())>=0) {
1501 return data.hash.aou[ my.ahr.pickup_lib() ].shortname();
1503 return my.ahr.pickup_lib().shortname();
1508 'persist' : 'hidden width ordinal',
1509 'id' : 'current_copy',
1510 'label' : document.getElementById('commonStrings').getString('staff.ahr_current_copy_label'),
1514 'render' : function(my) {
1516 return my.acp.barcode();
1518 return document.getElementById('circStrings').getString('staff.circ.utils.current_copy.none');
1523 'persist' : 'hidden width ordinal',
1524 'id' : 'current_copy_location',
1525 'label' : document.getElementById('commonStrings').getString('staff.ahr_current_copy_location_label'),
1529 'render' : function(my) {
1530 if (!my.acp) { return ""; } else { if (Number(my.acp.location())>=0) return data.lookup("acpl", my.acp.location() ).name(); else return my.acp.location().name(); }
1534 'persist' : 'hidden width ordinal',
1535 'id' : 'email_notify',
1536 'label' : document.getElementById('commonStrings').getString('staff.ahr_email_notify_label'),
1540 'render' : function(my) {
1541 if (get_bool(my.ahr.email_notify())) {
1542 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
1544 return document.getElementById('circStrings').getString('staff.circ.utils.no');
1549 'persist' : 'hidden width ordinal',
1550 'id' : 'expire_time',
1551 'label' : document.getElementById('commonStrings').getString('staff.ahr_expire_time_label'),
1555 'render' : function(my) { return my.ahr.expire_time(); }
1558 'persist' : 'hidden width ordinal',
1559 'id' : 'expire_date',
1560 'label' : document.getElementById('commonStrings').getString('staff.ahr_expire_date_label'),
1564 'render' : function(my) { return my.ahr.expire_time() ? my.ahr.expire_time().toString().substr(0,10) : ''; }
1567 'persist' : 'hidden width ordinal',
1568 'id' : 'fulfillment_time',
1569 'label' : document.getElementById('commonStrings').getString('staff.ahr_fulfillment_time_label'),
1573 'render' : function(my) { return my.ahr.fulfillment_time(); }
1576 'persist' : 'hidden width ordinal',
1577 'id' : 'holdable_formats',
1578 'label' : document.getElementById('commonStrings').getString('staff.ahr_holdable_formats_label'),
1582 'render' : function(my) { return my.ahr.holdable_formats(); }
1585 'persist' : 'hidden width ordinal',
1587 'label' : document.getElementById('commonStrings').getString('staff.ahr_id_label'),
1591 'render' : function(my) { return my.ahr.id(); }
1594 'persist' : 'hidden width ordinal',
1595 'id' : 'phone_notify',
1596 'label' : document.getElementById('commonStrings').getString('staff.ahr_phone_notify_label'),
1600 'render' : function(my) { return my.ahr.phone_notify(); }
1603 'persist' : 'hidden width ordinal',
1604 'id' : 'prev_check_time',
1605 'label' : document.getElementById('commonStrings').getString('staff.ahr_prev_check_time_label'),
1609 'render' : function(my) { return my.ahr.prev_check_time(); }
1612 'persist' : 'hidden width ordinal',
1614 'label' : document.getElementById('commonStrings').getString('staff.ahr_requestor_label'),
1618 'render' : function(my) { return my.ahr.requestor(); }
1621 'persist' : 'hidden width ordinal',
1622 'id' : 'selection_depth',
1623 'label' : document.getElementById('commonStrings').getString('staff.ahr_selection_depth_label'),
1627 'render' : function(my) { return my.ahr.selection_depth(); }
1630 'persist' : 'hidden width ordinal',
1632 'label' : document.getElementById('commonStrings').getString('staff.ahr_target_label'),
1636 'render' : function(my) { return my.ahr.target(); }
1639 'persist' : 'hidden width ordinal',
1641 'label' : document.getElementById('commonStrings').getString('staff.ahr_usr_label'),
1645 'render' : function(my) { return my.ahr.usr(); }
1648 'persist' : 'hidden width ordinal',
1650 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'),
1652 'sort_type' : 'title',
1655 'render' : function(my) {
1657 return my.mvr.title();
1659 return document.getElementById('circStrings').getString('staff.circ.utils.title.none');
1664 'persist' : 'hidden width ordinal',
1666 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'),
1670 'render' : function(my) {
1672 return my.mvr.author();
1674 return document.getElementById('circStrings').getString('staff.circ.utils.author.none');
1679 'persist' : 'hidden width ordinal',
1681 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edition'),
1685 'render' : function(my) { return my.mvr.edition(); }
1688 'persist' : 'hidden width ordinal',
1690 'label' : document.getElementById('circStrings').getString('staff.circ.utils.isbn'),
1694 'render' : function(my) { return my.mvr.isbn(); }
1697 'persist' : 'hidden width ordinal',
1699 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pubdate'),
1703 'render' : function(my) { return my.mvr.pubdate(); }
1706 'persist' : 'hidden width ordinal',
1708 'label' : document.getElementById('circStrings').getString('staff.circ.utils.publisher'),
1712 'render' : function(my) { return my.mvr.publisher(); }
1715 'persist' : 'hidden width ordinal',
1717 'label' : document.getElementById('circStrings').getString('staff.circ.utils.tcn'),
1721 'render' : function(my) { return my.mvr.tcn(); }
1724 'persist' : 'hidden width ordinal',
1725 'id' : 'notify_time',
1726 'label' : document.getElementById('circStrings').getString('staff.circ.utils.notify_time'),
1730 'render' : function(my) { return my.ahr.notify_time(); }
1733 'persist' : 'hidden width ordinal',
1734 'id' : 'notify_count',
1735 'label' : document.getElementById('circStrings').getString('staff.circ.utils.notify_count'),
1739 'render' : function(my) { return my.ahr.notify_count(); }
1742 'persist' : 'hidden width ordinal',
1743 'id' : 'transit_source',
1744 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source'),
1748 'render' : function(my) {
1749 if (my.ahr.transit()) {
1750 return data.hash.aou[ my.ahr.transit().source() ].shortname();
1757 'persist' : 'hidden width ordinal',
1758 'id' : 'transit_source_send_time',
1759 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source_send_time'),
1763 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().source_send_time() : ""; }
1766 'persist' : 'hidden width ordinal',
1767 'id' : 'transit_dest_lib',
1768 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest'),
1772 'render' : function(my) { return my.ahr.transit() ? data.hash.aou[ my.ahr.transit().dest() ].shortname() : ""; }
1775 'persist' : 'hidden width ordinal',
1776 'id' : 'transit_dest_recv_time',
1777 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest_recv_time'),
1781 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().dest_recv_time() : ""; }
1784 'persist' : 'hidden width ordinal',
1785 'id' : 'patron_barcode',
1786 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'),
1790 'render' : function(my) { return my.patron_barcode ? my.patron_barcode : ""; }
1793 'persist' : 'hidden width ordinal',
1794 'id' : 'patron_family_name',
1795 'label' : document.getElementById('circStrings').getString('staff.circ.utils.patron_family_name'),
1799 'render' : function(my) { return my.patron_family_name ? my.patron_family_name : ""; }
1802 'persist' : 'hidden width ordinal',
1803 'id' : 'patron_first_given_name',
1804 'label' : document.getElementById('circStrings').getString('staff.circ.utils.patron_first_given_name'),
1808 'render' : function(my) { return my.patron_first_given_name ? my.patron_first_given_name : ""; }
1811 'persist' : 'hidden width ordinal',
1812 'id' : 'callnumber',
1813 'label' : document.getElementById('circStrings').getString('staff.circ.utils.callnumber'),
1817 'render' : function(my) { return my.acn.label(); }
1820 'persist' : 'hidden width ordinal',
1821 'id' : 'total_holds',
1822 'label' : document.getElementById('circStrings').getString('staff.circ.utils.total_holds'),
1826 'render' : function(my) { return my.total_holds; }
1829 'persist' : 'hidden width ordinal',
1830 'id' : 'queue_position',
1831 'label' : document.getElementById('circStrings').getString('staff.circ.utils.queue_position'),
1835 'render' : function(my) { return my.queue_position; }
1838 'persist' : 'hidden width ordinal',
1839 'id' : 'potential_copies',
1840 'label' : document.getElementById('circStrings').getString('staff.circ.utils.potential_copies'),
1844 'render' : function(my) { return my.potential_copies; }
1847 'persist' : 'hidden width ordinal',
1848 'id' : 'estimated_wait',
1849 'label' : document.getElementById('circStrings').getString('staff.circ.utils.estimated_wait'),
1853 'render' : function(my) { return my.estimated_wait; }
1856 'persist' : 'hidden width ordinal',
1858 'label' : document.getElementById('circStrings').getString('staff.circ.utils.hold_note'),
1862 'render' : function(my) { return my.ahrn_count; }
1865 'persist' : 'hidden width ordinal',
1866 'id' : 'staff_hold',
1867 'label' : document.getElementById('circStrings').getString('staff.circ.utils.staff_hold'),
1871 'render' : function(my) {
1873 if (my.ahr.usr() != my.ahr.requestor()){
1874 return document.getElementById('circStrings').getString('staff.circ.utils.yes');
1876 return document.getElementById('circStrings').getString('staff.circ.utils.no');
1881 for (var i = 0; i < c.length; i++) {
1882 if (modify[ c[i].id ]) {
1883 for (var j in modify[ c[i].id ]) {
1884 c[i][j] = modify[ c[i].id ][j];
1889 if (params.just_these) {
1890 JSAN.use('util.functional');
1892 for (var i = 0; i < params.just_these.length; i++) {
1893 var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);});
1894 new_c.push( function(y){ return y; }( x ) );
1898 if (params.except_these) {
1899 JSAN.use('util.functional');
1901 for (var i = 0; i < c.length; i++) {
1902 var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);});
1903 if (!x) new_c.push(c[i]);
1909 return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } );
1912 circ.util.std_map_row_to_column = function(error_value) {
1913 return function(row,col) {
1914 // row contains { 'my' : { 'acp' : {}, 'circ' : {}, 'mvr' : {} } }
1915 // col contains one of the objects listed above in columns
1917 // mimicking some of the obj in circ.checkin and circ.checkout where map_row_to_column is usually defined
1919 JSAN.use('util.error'); obj.error = new util.error();
1920 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
1921 JSAN.use('util.network'); obj.network = new util.network();
1922 JSAN.use('util.money');
1927 value = eval( col.render );
1929 obj.error.sdump('D_WARN','map_row_to_column: ' + E);
1930 if (error_value) value = error_value; else value = ' ';
1936 circ.util.std_map_row_to_columns = function(error_value) {
1937 return function(row,cols) {
1938 // row contains { 'my' : { 'acp' : {}, 'circ' : {}, 'mvr' : {} } }
1939 // cols contains all of the objects listed above in columns
1942 JSAN.use('util.error'); obj.error = new util.error();
1943 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
1944 JSAN.use('util.network'); obj.network = new util.network();
1945 JSAN.use('util.money');
1951 for (var i = 0; i < cols.length; i++) {
1952 switch (typeof cols[i].render) {
1953 case 'function': try { values[i] = cols[i].render(my); } catch(E) { values[i] = error_value; obj.error.sdump('D_COLUMN_RENDER_ERROR',E); } break;
1954 case 'string' : cmd += 'try { ' + cols[i].render + '; values['+i+'] = v; } catch(E) { values['+i+'] = error_value; }'; break;
1955 default: cmd += 'values['+i+'] = "??? '+(typeof cols[i].render)+'"; ';
1958 if (cmd) eval( cmd );
1960 obj.error.sdump('D_WARN','map_row_to_column: ' + E);
1961 if (error_value) { value = error_value; } else { value = ' ' };
1967 circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,async) {
1969 JSAN.use('util.error'); var error = new util.error();
1970 JSAN.use('util.network'); var network = new util.network();
1971 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
1972 JSAN.use('util.date'); JSAN.use('util.functional');
1974 if (backdate && (backdate == util.date.formatted_date(new Date(),'%Y-%m-%d')) ) backdate = null;
1976 //var params = { 'barcode' : barcode };
1977 if (backdate) params.backdate = util.date.formatted_date(backdate + ' 00:00:00','%{iso8601}');
1979 if (typeof params.disable_textbox == 'function') {
1980 try { params.disable_textbox(); }
1981 catch(E) { error.sdump('D_ERROR','params.disable_textbox() = ' + E); };
1984 function checkin_callback(req) {
1986 var check = req.getResultObject();
1987 var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check);
1988 if (typeof params.checkin_result == 'function') {
1989 try { params.checkin_result(r); }
1990 catch(E) { error.sdump('D_ERROR','params.checkin_result() = ' + E); };
1992 if (typeof async == 'function') async(check);
1995 JSAN.use('util.error'); var error = new util.error();
1996 error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.error', ['1']), E);
1997 if (typeof params.enable_textbox == 'function') {
1998 try { params.enable_textbox(); }
1999 catch(E) { error.sdump('D_ERROR','params.disable_textbox() = ' + E); };
2005 var check = network.request(
2006 api.CHECKIN_VIA_BARCODE.app,
2007 api.CHECKIN_VIA_BARCODE.method,
2008 [ session, util.functional.filter_object( params, function(i,o) { return typeof o != 'function'; } ) ],
2009 async ? checkin_callback : null,
2011 'title' : document.getElementById('circStrings').getString('staff.circ.utils.checkin.override'),
2012 'overridable_events' : [
2013 null /* custom event */,
2014 1203 /* COPY_BAD_STATUS */,
2015 1213 /* PATRON_BARRED */,
2016 1217 /* PATRON_INACTIVE */,
2017 1224 /* PATRON_ACCOUNT_EXPIRED */,
2018 1234 /* ITEM_DEPOSIT_PAID */,
2019 7009 /* CIRC_CLAIMS_RETURNED */,
2020 7010 /* COPY_ALERT_MESSAGE */,
2021 7011 /* COPY_STATUS_LOST */,
2022 7012 /* COPY_STATUS_MISSING */,
2023 7013 /* PATRON_EXCEEDS_FINES */,
2026 '1203' : function(r) {
2027 return typeof r.payload.status() == 'object' ? r.payload.status().name() : data.hash.ccs[ r.payload.status() ].name();
2029 '1234' : function(r) {
2030 return document.getElementById('circStrings').getString('staff.circ.utils.checkin.override.item_deposit_paid.warning');
2032 '7010' : function(r) {
2039 return checkin_callback( { 'getResultObject' : function() { return check; } } );
2044 JSAN.use('util.error'); var error = new util.error();
2045 error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.error', ['2']), E);
2046 if (typeof params.enable_textbox == 'function') {
2047 try { params.enable_textbox(); } catch(E) { error.sdump('D_ERROR','params.disable_textbox() = ' + E); };
2053 circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,check) {
2055 JSAN.use('util.error'); var error = new util.error();
2056 JSAN.use('util.network'); var network = new util.network();
2057 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
2058 JSAN.use('util.date');
2060 error.sdump('D_DEBUG','check = ' + error.pretty_print( js2JSON( check ) ) );
2062 check.message = check.textcode;
2064 if (check.payload && check.payload.copy) { check.copy = check.payload.copy; }
2065 if (check.payload && check.payload.record) { check.record = check.payload.record; }
2066 if (check.payload && check.payload.circ) { check.circ = check.payload.circ; }
2068 if (!check.route_to) { check.route_to = ' '; }
2070 if (document.getElementById('no_change_label')) {
2071 document.getElementById('no_change_label').setAttribute('value','');
2072 document.getElementById('no_change_label').setAttribute('hidden','true');
2076 network.simple_request('FM_MBTS_RETRIEVE.authoritative',[ses(),check.circ.id()], function(req) {
2077 JSAN.use('util.money');
2078 var bill = req.getResultObject();
2079 if (Number(bill.balance_owed()) == 0) { return; }
2080 if (document.getElementById('no_change_label')) {
2081 var m = document.getElementById('no_change_label').getAttribute('value');
2082 document.getElementById('no_change_label').setAttribute('value', m + document.getElementById('circStrings').getFormattedString('staff.circ.utils.billable.amount', [params.barcode, util.money.sanitize(bill.balance_owed())]) + ' ');
2083 document.getElementById('no_change_label').setAttribute('hidden','false');
2090 if (check.payload && check.payload.cancelled_hold_transit) {
2091 msg += document.getElementById('circStrings').getString('staff.circ.utils.transit_hold_cancelled');
2095 /* SUCCESS / NO_CHANGE / ITEM_NOT_CATALOGED */
2096 if (check.ilsevent == 0 || check.ilsevent == 3 || check.ilsevent == 1202) {
2097 try { check.route_to = data.lookup('acpl', check.copy.location() ).name(); }
2099 msg += document.getElementById('commonStrings').getString('common.error');
2100 msg += '\nFIXME: ' + E + '\n';
2102 if (check.ilsevent == 3 /* NO_CHANGE */) {
2103 //msg = 'This item is already checked in.\n';
2104 if (document.getElementById('no_change_label')) {
2105 var m = document.getElementById('no_change_label').getAttribute('value');
2106 document.getElementById('no_change_label').setAttribute('value', m + document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]) + ' ');
2107 document.getElementById('no_change_label').setAttribute('hidden','false');
2110 if (check.ilsevent == 1202 /* ITEM_NOT_CATALOGED */ && check.copy.status() != 11) {
2111 var copy_status = (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() );
2112 msg = document.getElementById('commonStrings').getString('common.error');
2113 msg += '\nFIXME --';
2114 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_not_cataloged', [copy_status]);
2117 switch(Number(check.copy.status())) {
2118 case 0: /* AVAILABLE */
2119 case 7: /* RESHELVING */
2121 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
2125 case 8: /* ON HOLDS SHELF */
2126 check.route_to = 'HOLDS SHELF';
2127 if (check.payload.hold) {
2128 if (check.payload.hold.pickup_lib() != data.list.au[0].ws_ou()) {
2129 msg += document.getElementById('commonStrings').getString('common.error');
2131 msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_error');
2134 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
2138 msg += document.getElementById('commonStrings').getString('common.error');
2140 msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_status_error');
2143 JSAN.use('util.date');
2144 if (check.payload.hold) {
2145 JSAN.use('patron.util');
2147 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [check.payload.copy.barcode()]);
2149 var payload_title = (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() );
2150 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.title', [payload_title]);
2152 var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() );
2154 if (au_obj.alias()) {
2155 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron_alias', [au_obj.alias()]);
2157 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron', [au_obj.family_name(), au_obj.first_given_name(), au_obj.second_given_name()]);
2160 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [au_obj.card().barcode()]);
2162 if (check.payload.hold.phone_notify()) {
2163 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.phone_notify', [check.payload.hold.phone_notify()]);
2166 if (get_bool(check.payload.hold.email_notify())) {
2167 var payload_email = au_obj.email() ? au_obj.email() : '';
2168 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.email_notify', [payload_email]);
2172 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [util.date.formatted_date(check.payload.hold.request_time(),'%F')]);
2176 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [util.date.formatted_date(new Date(),'%F')]);
2179 rv = error.yns_alert_formatted(
2181 document.getElementById('circStrings').getString('staff.circ.utils.hold_slip'),
2182 document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.yes'),
2183 document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.no'),
2185 document.getElementById('circStrings').getString('staff.circ.confirm.msg'),
2186 '/xul/server/skin/media/images/turtle.gif'
2191 JSAN.use('util.print'); var print = new util.print();
2192 msg = msg.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g,'<br/>');
2193 print.simple( msg , { 'no_prompt' : true, 'content_type' : 'text/html' } );
2195 var err_msg = document.getElementById('commonStrings').getString('common.error');
2196 err_msg += '\nFIXME: ' + E + '\n';
2202 if (document.getElementById('no_change_label')) {
2203 var m = document.getElementById('no_change_label').getAttribute('value');
2204 m += document.getElementById('circStrings').getFormattedString('staff.circ.utils.capture', [params.barcode]);
2205 document.getElementById('no_change_label').setAttribute('value', m);
2206 document.getElementById('no_change_label').setAttribute('hidden','false');
2209 case 6: /* IN TRANSIT */
2210 check.route_to = 'TRANSIT SHELF??';
2211 msg += document.getElementById('commonStrings').getString('common.error');
2212 msg += "\nFIXME -- I didn't think we could get here.\n";
2214 case 11: /* CATALOGING */
2215 check.route_to = 'CATALOGING';
2216 if (document.getElementById('do_not_alert_on_precat')) {
2217 var x = document.getElementById('do_not_alert_on_precat');
2219 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
2222 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
2224 if (document.getElementById('no_change_label')) {
2225 var m = document.getElementById('no_change_label').getAttribute('value');
2226 var needs_cat = document.getElementById('circStrings').getFormattedString('staff.circ.utils.needs_cataloging', [params.barcode]);
2227 document.getElementById('no_change_label').setAttribute('value', m + needs_cat + ' ');
2228 document.getElementById('no_change_label').setAttribute('hidden','false');
2232 msg += document.getElementById('commonStrings').getString('common.error');
2233 var copy_status = data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name();
2235 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.copy_status.error', [copy_status]);
2237 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
2243 document.getElementById('circStrings').getString('staff.circ.alert'),
2245 document.getElementById('circStrings').getString('staff.circ.utils.msg.ok'),
2247 document.getElementById('circStrings').getString('staff.circ.confirm.msg')
2250 } else /* ROUTE_ITEM */ if (check.ilsevent == 7000) {
2252 var lib = data.hash.aou[ check.org ];
2253 check.route_to = lib.shortname();
2254 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.destination', [check.route_to]);
2259 if (lib.holds_address() ) {
2260 var a = network.simple_request('FM_AOA_RETRIEVE',[ lib.holds_address() ]);
2261 if (typeof a.ilsevent != 'undefined') throw(a);
2262 if (a.street1()) msg += a.street1() + '\n';
2263 if (a.street2()) msg += a.street2() + '\n';
2264 msg += (a.city() ? a.city() + ', ' : '') + (a.state() ? a.state() + ' ' : '') + (a.post_code() ? a.post_code() : '') + '\n';
2266 msg += document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address');
2270 msg += document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address.error');
2272 error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address.error'), E);
2275 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [check.payload.copy.barcode()]);
2277 var payload_title = (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() );
2278 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.title', [payload_title]);
2280 var payload_author = (check.payload.record ? check.payload.record.author() :check.payload.copy.dummy_author());
2281 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.author', [payload_author]);
2283 JSAN.use('util.date');
2284 if (check.payload.hold) {
2285 JSAN.use('patron.util');
2286 var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() );
2288 if (au_obj.alias()) {
2289 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron_alias', [au_obj.alias()]);
2291 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron', [au_obj.family_name(), au_obj.first_given_name(), au_obj.second_given_name()]);
2294 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [au_obj.card().barcode()]);
2296 if (check.payload.hold.phone_notify()) {
2297 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.phone_notify', [check.payload.hold.phone_notify()]);
2300 if (get_bool(check.payload.hold.email_notify())) {
2301 var payload_email = au_obj.email() ? au_obj.email() : '';
2302 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.email_notify', [payload_email]);
2306 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [util.date.formatted_date(check.payload.hold.request_time(),'%F')]);
2310 msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [util.date.formatted_date(new Date(),'%F')]);
2312 rv = error.yns_alert_formatted(
2314 document.getElementById('circStrings').getString('staff.circ.utils.transit_slip'),
2315 document.getElementById('circStrings').getString('staff.circ.utils.transit_slip.print.yes'),
2316 document.getElementById('circStrings').getString('staff.circ.utils.transit_slip.print.no'),
2318 document.getElementById('circStrings').getString('staff.circ.confirm.msg'),
2319 '/xul/server/skin/media/images/turtle.gif'
2325 JSAN.use('util.print'); var print = new util.print();
2326 //print.simple( msg, { 'no_prompt' : true, 'content_type' : 'text/plain' } );
2327 msg = msg.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g,'<br/>');
2328 print.simple( msg , { 'no_prompt' : true, 'content_type' : 'text/html' } );
2330 var err_msg = document.getElementById('commonStrings').getString('common.error');
2331 err_msg += '\nFIXME: ' + E + '\n';
2336 if (document.getElementById('no_change_label')) {
2337 var m = document.getElementById('no_change_label').getAttribute('value');
2338 var trans_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.in_transit', [params.barcode]);
2339 document.getElementById('no_change_label').setAttribute('value', m + trans_msg + ' ');
2340 document.getElementById('no_change_label').setAttribute('hidden','false');
2343 } else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) {
2345 check.route_to = 'CATALOGING';
2346 var mis_scan_msg = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.status.copy_not_found', [params.barcode]);
2349 document.getElementById('circStrings').getString('staff.circ.alert'),
2351 document.getElementById('circStrings').getString('staff.circ.utils.msg.ok'),
2353 document.getElementById('circStrings').getString('staff.circ.confirm.msg')
2355 if (document.getElementById('no_change_label')) {
2356 var m = document.getElementById('no_change_label').getAttribute('value');
2357 document.getElementById('no_change_label').setAttribute('value',m + mis_scan_msg + ' ');
2358 document.getElementById('no_change_label').setAttribute('hidden','false');
2361 } else /* HOLD_CAPTURE_DELAYED */ if (check.ilsevent == 7019) {
2364 msg += document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.description');
2365 rv = error.yns_alert_formatted(
2367 document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.titlebar'),
2368 document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.prompt_for_nocapture'),
2369 document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.prompt_for_capture'),
2371 document.getElementById('circStrings').getString('staff.circ.confirm.msg'),
2372 '/xul/server/skin/media/images/stop_sign.png'
2374 params.capture = rv == 0 ? 'nocapture' : 'capture';
2376 return circ.util.checkin_via_barcode(session,params,backdate,auto_print,false);
2378 } else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) {
2379 error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline'));
2382 if (check.ilsevent == null) { return null; /* handled */ }
2383 switch (Number(check.ilsevent)) {
2384 case 1203 /* COPY_BAD_STATUS */ :
2385 case 1213 /* PATRON_BARRED */ :
2386 case 1217 /* PATRON_INACTIVE */ :
2387 case 1224 /* PATRON_ACCOUNT_EXPIRED */ :
2388 case 1234 /* ITEM_DEPOSIT_PAID */ :
2389 case 7009 /* CIRC_CLAIMS_RETURNED */ :
2390 case 7010 /* COPY_ALERT_MESSAGE */ :
2391 case 7011 /* COPY_STATUS_LOST */ :
2392 case 7012 /* COPY_STATUS_MISSING */ :
2393 case 7013 /* PATRON_EXCEEDS_FINES */ :
2394 return null; /* handled */
2404 JSAN.use('util.error'); var error = new util.error();
2405 error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.error', ['3']), E);
2410 circ.util.renew_via_barcode = function ( barcode, patron_id, async ) {
2413 JSAN.use('util.network'); obj.network = new util.network();
2414 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.stash_retrieve();
2416 var params = { barcode: barcode };
2417 if (patron_id) params.patron = patron_id;
2419 function renew_callback(req) {
2421 var renew = req.getResultObject();
2422 if (typeof renew.ilsevent != 'undefined') renew = [ renew ];
2423 for (var j = 0; j < renew.length; j++) {
2424 switch(renew[j].ilsevent == null ? null : Number(renew[j].ilsevent)) {
2425 case 0 /* SUCCESS */ : break;
2426 case null /* custom event */ : break;
2427 case 5000 /* PERM_FAILURE */: break;
2428 case 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */ : break;
2429 case 1213 /* PATRON_BARRED */ : break;
2430 case 1215 /* CIRC_EXCEEDS_COPY_RANGE */ : break;
2431 case 1224 /* PATRON_ACCOUNT_EXPIRED */ : break;
2432 case 1232 /* ITEM_DEPOSIT_REQUIRED */ : break;
2433 case 1233 /* ITEM_RENTAL_FEE_REQUIRED */ : break;
2434 case 1234 /* ITEM_DEPOSIT_PAID */ : break;
2435 case 1500 /* ACTION_CIRCULATION_NOT_FOUND */ : break;
2436 case 7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */ : break;
2437 case 7003 /* COPY_CIRC_NOT_ALLOWED */ : break;
2438 case 7004 /* COPY_NOT_AVAILABLE */ : break;
2439 case 7006 /* COPY_IS_REFERENCE */ : break;
2440 case 7007 /* COPY_NEEDED_FOR_HOLD */ : break;
2441 case 7008 /* MAX_RENEWALS_REACHED */ : break;
2442 case 7009 /* CIRC_CLAIMS_RETURNED */ : break;
2443 case 7010 /* COPY_ALERT_MESSAGE */ : break;
2444 case 7013 /* PATRON_EXCEEDS_FINES */ : break;
2450 if (typeof async == 'function') async(renew);
2453 JSAN.use('util.error'); var error = new util.error();
2454 error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.renew_failed.error', [barcode]), E);
2459 var renew = obj.network.simple_request(
2462 async ? renew_callback : null,
2464 'title' : document.getElementById('circStrings').getString('staff.circ.checkin.renew_failed.override'),
2465 'overridable_events' : [
2466 null /* custom event */,
2467 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
2468 1213 /* PATRON_BARRED */,
2469 1215 /* CIRC_EXCEEDS_COPY_RANGE */,
2470 1232 /* ITEM_DEPOSIT_REQUIRED */,
2471 1233 /* ITEM_RENTAL_FEE_REQUIRED */,
2472 1234 /* ITEM_DEPOSIT_PAID */,
2473 7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */,
2474 7003 /* COPY_CIRC_NOT_ALLOWED */,
2475 7004 /* COPY_NOT_AVAILABLE */,
2476 7006 /* COPY_IS_REFERENCE */,
2477 7007 /* COPY_NEEDED_FOR_HOLD */,
2478 7008 /* MAX_RENEWALS_REACHED */,
2479 7009 /* CIRC_CLAIMS_RETURNED */,
2480 7010 /* COPY_ALERT_MESSAGE */,
2481 7013 /* PATRON_EXCEEDS_FINES */,
2484 '1212' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2485 '1213' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2486 '1215' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2487 '1232' : function(r) {
2488 return document.getElementById('circStrings').getFormattedString('staff.circ.renew.override.item_deposit_required.warning.barcode', [barcode]);
2490 '1233' : function(r) {
2491 return document.getElementById('circStrings').getFormattedString('staff.circ.renew.override.item_rental_fee_required.warning.barcode', [barcode]);
2493 '1234' : function(r) {
2494 return document.getElementById('circStrings').getFormattedString('staff.circ.utils.checkin.override.item_deposit_paid.warning');
2496 '7002' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2497 '7003' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2498 '7004' : function(r) {
2499 return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode.status', [barcode, typeof r.payload.status() == 'object' ? r.payload.status().name() : obj.data.hash.ccs[ r.payload.status() ].name()]);
2501 '7006' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2502 '7007' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2503 '7008' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2504 '7009' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); },
2505 '7010' : function(r) {
2506 return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode.msg', [barcode, r.payload]);
2508 '7013' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }
2513 return renew_callback( { 'getResultObject' : function() { return renew; } } );
2517 JSAN.use('util.error'); var error = new util.error();
2518 error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.renew_failed.error', [barcode]), E);
2523 dump('exiting circ/util.js\n');