From: dbs Date: Mon, 11 Feb 2008 21:44:51 +0000 (+0000) Subject: Complete server/circ/util.js i18n (oh my aching fingers) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=126c98f60787352325775cab3514953cedd024ad;p=Evergreen.git Complete server/circ/util.js i18n (oh my aching fingers) git-svn-id: svn://svn.open-ils.org/ILS/trunk@8725 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index b0c4b1d685..42f36f7a02 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -4,9 +4,9 @@ dump('entering circ/util.js\n'); if (typeof circ == 'undefined') { var circ = {}; } circ.util = {}; -circ.util.EXPORT_OK = [ - 'offline_checkout_columns', 'offline_checkin_columns', 'offline_renew_columns', 'offline_inhouse_use_columns', - 'columns', 'hold_columns', 'checkin_via_barcode', 'std_map_row_to_columns', +circ.util.EXPORT_OK = [ + 'offline_checkout_columns', 'offline_checkin_columns', 'offline_renew_columns', 'offline_inhouse_use_columns', + 'columns', 'hold_columns', 'checkin_via_barcode', 'std_map_row_to_columns', 'show_last_few_circs', 'abort_transits', 'transit_columns', 'renew_via_barcode' ]; circ.util.EXPORT_TAGS = { ':all' : circ.util.EXPORT_OK }; @@ -52,7 +52,7 @@ circ.util.abort_transits = function(selection_list) { obj.error.standard_unexpected_error_alert(document.getElementById('circString').getString('staff.circ.utils.abort_transits.unexpected_error'),E); } } -} +}; circ.util.show_copy_details = function(copy_id) { var obj = {}; @@ -83,7 +83,7 @@ circ.util.show_copy_details = function(copy_id) { } catch(E) { obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_copy.failure'),E); } -} +}; circ.util.show_last_few_circs = function(selection_list,count) { @@ -118,66 +118,84 @@ circ.util.show_last_few_circs = function(selection_list,count) { obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.retrieve_circs.failure') ,E); } } -} +}; circ.util.offline_checkout_columns = function(modify,params) { var c = [ - { - 'id' : 'timestamp', + { + 'id' : 'timestamp', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.timestamp; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.timestamp; } }, - { - 'id' : 'checkout_time', - 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.checkout_time'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.checkout_time; }, + { + 'id' : 'checkout_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.checkout_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.checkout_time; } }, - { - 'id' : 'type', + { + 'id' : 'type', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.type; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.type; } }, { 'id' : 'noncat', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.noncat'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.noncat; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.noncat; } }, { 'id' : 'noncat_type', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.noncat_type'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.noncat_type; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.noncat_type; } }, { 'id' : 'noncat_count', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.count'), 'sort_type' : 'number', - 'flex' : 1, 'primary' : false, 'hidden' : false, - 'render' : function(my) { return my.noncat_count; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.noncat_count; } }, - { - 'id' : 'patron_barcode', - 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.patron_barcode; }, + { + 'id' : 'patron_barcode', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.patron_barcode; } }, - { - 'id' : 'barcode', + { + 'id' : 'barcode', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'), - 'flex' : 2, 'primary' : true, 'hidden' : false, - 'render' : function(my) { return my.barcode; }, + 'flex' : 2, + 'primary' : true, + 'hidden' : false, + 'render' : function(my) { return my.barcode; } }, - { - 'id' : 'due_date', + { + 'id' : 'due_date', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.due_date'), - 'flex' : 1, 'primary' : false, 'hidden' : false, - 'render' : function(my) { return my.due_date; }, - }, + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.due_date; } + } ]; if (modify) for (var i = 0; i < c.length; i++) { if (modify[ c[i].id ]) { @@ -208,35 +226,43 @@ circ.util.offline_checkout_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} +}; circ.util.offline_checkin_columns = function(modify,params) { var c = [ - { - 'id' : 'timestamp', + { + 'id' : 'timestamp', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.timestamp; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.timestamp; } }, - { - 'id' : 'backdate', + { + 'id' : 'backdate', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.backdate'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.backdate; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.backdate; } }, - { - 'id' : 'type', + { + 'id' : 'type', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.type; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.type; } }, - { - 'id' : 'barcode', + { + 'id' : 'barcode', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'), - 'flex' : 2, 'primary' : true, 'hidden' : false, - 'render' : function(my) { return my.barcode; }, - }, + 'flex' : 2, + 'primary' : true, + 'hidden' : false, + 'render' : function(my) { return my.barcode; } + } ]; if (modify) for (var i = 0; i < c.length; i++) { if (modify[ c[i].id ]) { @@ -267,47 +293,59 @@ circ.util.offline_checkin_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} +}; circ.util.offline_renew_columns = function(modify,params) { var c = [ - { - 'id' : 'timestamp', + { + 'id' : 'timestamp', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.timestamp; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.timestamp; } }, - { - 'id' : 'checkout_time', + { + 'id' : 'checkout_time', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.checkout_time'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.checkout_time; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.checkout_time; } }, - { - 'id' : 'type', + { + 'id' : 'type', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.type; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.type; } }, - { - 'id' : 'patron_barcode', + { + 'id' : 'patron_barcode', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.patron_barcode; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.patron_barcode; } }, - { - 'id' : 'barcode', + { + 'id' : 'barcode', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'), - 'flex' : 2, 'primary' : true, 'hidden' : false, - 'render' : function(my) { return my.barcode; }, - }, - { - 'id' : 'due_date', - 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.due_date'), - 'flex' : 1, 'primary' : false, 'hidden' : false, - 'render' : function(my) { return my.due_date; }, + 'flex' : 2, + 'primary' : true, + 'hidden' : false, + 'render' : function(my) { return my.barcode; } }, + { + 'id' : 'due_date', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.due_date'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.due_date; } + } ]; if (modify) for (var i = 0; i < c.length; i++) { if (modify[ c[i].id ]) { @@ -338,42 +376,52 @@ circ.util.offline_renew_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} +}; circ.util.offline_inhouse_use_columns = function(modify,params) { var c = [ - { - 'id' : 'timestamp', + { + 'id' : 'timestamp', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.timestamp'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.timestamp; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.timestamp; } }, - { - 'id' : 'use_time', - 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.use_time'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.use_time; }, + { + 'id' : 'use_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.use_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.use_time; } }, - { - 'id' : 'type', + { + 'id' : 'type', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.type'), - 'flex' : 1, 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.type; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.type; } }, { 'id' : 'count', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.count'), 'sort_type' : 'number', - 'flex' : 1, 'primary' : false, 'hidden' : false, - 'render' : function(my) { return my.count; }, + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.count; } }, - { - 'id' : 'barcode', + { + 'id' : 'barcode', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.item_barcode'), - 'flex' : 2, 'primary' : true, 'hidden' : false, - 'render' : function(my) { return my.barcode; }, - }, + 'flex' : 2, + 'primary' : true, + 'hidden' : false, + 'render' : function(my) { return my.barcode; } + } ]; if (modify) for (var i = 0; i < c.length; i++) { if (modify[ c[i].id ]) { @@ -404,9 +452,7 @@ circ.util.offline_inhouse_use_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} - - +}; circ.util.columns = function(modify,params) { @@ -416,33 +462,56 @@ circ.util.columns = function(modify,params) { var c = [ { - 'id' : 'acp_id', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_id'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.id(); }, 'persist' : 'hidden width ordinal', + 'id' : 'acp_id', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_id'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.id(); }, + 'persist' : 'hidden width ordinal' }, { - 'id' : 'circ_id', 'label' : document.getElementById('commonStrings').getString('staff.circ_label_id'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.id() : ( my.acp.circulations() ? my.acp.circulations()[0].id() : ""); }, - 'persist' : 'hidden width ordinal', + 'id' : 'circ_id', + 'label' : document.getElementById('commonStrings').getString('staff.circ_label_id'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.circ ? my.circ.id() : ( my.acp.circulations() ? my.acp.circulations()[0].id() : ""); }, + 'persist' : 'hidden width ordinal' }, { - 'id' : 'mvr_doc_id', 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_doc_id'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.doc_id(); }, - 'persist' : 'hidden width ordinal', + 'id' : 'mvr_doc_id', + 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_doc_id'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.doc_id(); }, + 'persist' : 'hidden width ordinal' }, { - 'persist' : 'hidden width ordinal', 'id' : 'service', 'label' : 'Service', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.service; }, + 'persist' : 'hidden width ordinal', + 'id' : 'service', + 'label' : 'Service', + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.service; } }, { - 'id' : 'barcode', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_barcode'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.barcode(); }, - 'persist' : 'hidden width ordinal', + 'id' : 'barcode', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_barcode'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.barcode(); }, + 'persist' : 'hidden width ordinal' }, { 'id' : 'call_number', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_call_number'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (my.acp && my.acp.call_number() == -1) { return document.getElementById('commonStrings').getString('staff.circ.utils.not_cataloged'); @@ -459,35 +528,39 @@ circ.util.columns = function(modify,params) { } } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'owning_lib', 'label' : document.getElementById('commonStrings').getString('staff.circ.utils.owning_lib'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (Number(my.acn.owning_lib())>=0) { return data.hash.aou[ my.acn.owning_lib() ].shortname(); } else { return my.acn.owning_lib().shortname(); } - }, - 'persist' : 'hidden width ordinal', + }, + 'persist' : 'hidden width ordinal' }, { 'id' : 'copy_number', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_copy_number'), 'flex' : 1, 'sort_type' : 'number', - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.copy_number(); }, - 'persist' : 'hidden width ordinal', + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.copy_number(); }, + 'persist' : 'hidden width ordinal' }, { 'id' : 'location', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_location'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (Number(my.acp.location())>=0) { return data.lookup("acpl", my.acp.location() ).name(); @@ -495,13 +568,14 @@ circ.util.columns = function(modify,params) { return my.acp.location().name(); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'loan_duration', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_loan_duration'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { switch(my.acp.loan_duration()) { case 1: @@ -515,13 +589,14 @@ circ.util.columns = function(modify,params) { break; }; }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'circ_lib', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_lib'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (Number(my.acp.circ_lib())>=0) { return data.hash.aou[ my.acp.circ_lib() ].shortname(); @@ -529,12 +604,14 @@ circ.util.columns = function(modify,params) { return my.acp.circ_lib().shortname(); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'fine_level', - 'label' : document.getElementById('commonStrings').getString('staff.acp_label_fine_level'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_fine_level'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { switch(my.acp.fine_level()) { case 1: @@ -548,13 +625,14 @@ circ.util.columns = function(modify,params) { break; }; }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'circulate', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.circulate'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (get_bool( my.acp.circulate() )) { return document.getElementById('circStrings').getString('staff.circ.utils.yes'); @@ -562,13 +640,14 @@ circ.util.columns = function(modify,params) { return document.getElementById('circStrings').getString('staff.circ.utils.no'); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'deleted', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.deleted'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (get_bool( my.acp.deleted() )) { return document.getElementById('circStrings').getString('staff.circ.utils.yes'); @@ -576,13 +655,14 @@ circ.util.columns = function(modify,params) { return document.getElementById('circStrings').getString('staff.circ.utils.no'); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'holdable', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.holdable'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (get_bool( my.acp.holdable() )) { return document.getElementById('circStrings').getString('staff.circ.utils.yes'); @@ -590,13 +670,14 @@ circ.util.columns = function(modify,params) { return document.getElementById('circStrings').getString('staff.circ.utils.no'); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { 'id' : 'opac_visible', 'label' : document.getElementById('circStrings').getString('staff.circ.utils.opac_visible'), 'flex' : 1, - 'primary' : false, 'hidden' : true, + 'primary' : false, + 'hidden' : true, 'render' : function(my) { if (get_bool( my.acp.opac_visible() )) { return document.getElementById('circStrings').getString('staff.circ.utils.yes'); @@ -604,128 +685,409 @@ circ.util.columns = function(modify,params) { return document.getElementById('circStrings').getString('staff.circ.utils.no'); } }, - 'persist' : 'hidden width ordinal', + 'persist' : 'hidden width ordinal' }, { - 'persist' : 'hidden width ordinal', 'id' : 'ref', 'label' : 'Reference?', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.acp.ref() ) ? "Yes" : "No"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'ref', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.reference'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (get_bool( my.acp.ref() )) { + return document.getElementById('circStrings').getString('staff.circ.utils.yes'); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.no'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'deposit', 'label' : 'Deposit?', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.acp.deposit() ) ? "Yes" : "No"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'deposit', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.deposit'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (get_bool( my.acp.deposit() )) { + return document.getElementById('circStrings').getString('staff.circ.utils.yes'); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.no'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'deposit_amount', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_deposit_amount'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.price() == null ? "" : util.money.sanitize(my.acp.deposit_amount()); }, 'sort_type' : 'money', + 'persist' : 'hidden width ordinal', + 'id' : 'deposit_amount', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_deposit_amount'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.acp.price() == null) { + return document.getElementById('circStrings').getString('staff.circ.utils.unset'); + } else { + return util.money.sanitize(my.acp.deposit_amount()); + } + }, + 'sort_type' : 'money' }, { - 'persist' : 'hidden width ordinal', 'id' : 'price', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_price'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.price() == null ? "" : util.money.sanitize(my.acp.price()); }, 'sort_type' : 'money', + 'persist' : 'hidden width ordinal', + 'id' : 'price', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_price'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.acp.price() == null) { + return document.getElementById('circStrings').getString('staff.circ.utils.unset'); + } else { + return util.money.sanitize(my.acp.price()); + } + }, + 'sort_type' : 'money' }, { - 'persist' : 'hidden width ordinal', 'id' : 'circ_as_type', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_as_type'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.circ_as_type(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'circ_as_type', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_as_type'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.circ_as_type(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'circ_modifier', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_modifier'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.circ_modifier(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'circ_modifier', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_circ_modifier'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.circ_modifier(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'checkout_lib', 'label' : 'Checkout Lib', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? data.hash.aou[ my.circ.circ_lib() ].shortname() : ( my.acp.circulations() ? data.hash.aou[ my.acp.circulations()[0].circ_lib() ].shortname() : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'checkout_lib', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkout_lib'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return data.hash.aou[ my.circ.circ_lib() ].shortname(); + } else { + if (my.acp.circulations()) { + return data.hash.aou[ my.acp.circulations()[0].circ_lib() ].shortname(); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'xact_start_full', 'label' : 'Checkout Timestamp', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.xact_start() : (my.acp.circulations() ? my.acp.circulations()[0].xact_start() : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'xact_start_full', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkout_timestamp'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.xact_start(); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].xact_start(); + } + else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'checkin_time_full', 'label' : 'Checkin Timestamp', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.checkin_time() : (my.acp.circulations() ? my.acp.circulations()[0].checkin_time() : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'checkin_time_full', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkin_timestamp'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.checkin_time(); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].checkin_time(); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'xact_start', 'label' : 'Checkout Date', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.xact_start().substr(0,10) : (my.acp.circulations() ? my.acp.circulations()[0].xact_start().substr(0,10) : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'xact_start', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.xact_start'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.xact_start().substr(0,10); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].xact_start().substr(0,10); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'checkin_time', 'label' : 'Checkin Date', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.checkin_time().substr(0,10) : (my.acp.circulations() ? my.acp.circulations()[0].checkin_time().substr(0,10) : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'checkin_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.checkin_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.checkin_time().substr(0,10); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].checkin_time().substr(0,10); + } else { + return ""; + } + } + } }, - { - 'persist' : 'hidden width ordinal', 'id' : 'xact_finish', 'label' : 'Transaction Finished', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ.xact_finish(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'xact_finish', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.xact_finish'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.circ.xact_finish(); }, }, { - 'persist' : 'hidden width ordinal', 'id' : 'due_date', 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_date'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.due_date().substr(0,10) : (my.acp.circulations() ? my.acp.circulations()[0].due_date().substr(0,10) : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'due_date', + 'label' : document.getElementById('commonStrings').getString('staff.circ_label_due_date'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.due_date().substr(0,10); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].due_date().substr(0,10); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'create_date', 'label' : 'Date Created', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.create_date().substr(0,10); }, + 'persist' : 'hidden width ordinal', + 'id' : 'create_date', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.create_date'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.create_date().substr(0,10); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'edit_date', 'label' : 'Date Last Edited', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.edit_date().substr(0,10); }, + 'persist' : 'hidden width ordinal', + 'id' : 'edit_date', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edit_date'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.edit_date().substr(0,10); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'title', 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'), 'flex' : 2, 'sort_type' : 'title', - 'primary' : false, 'hidden' : true, 'render' : function(my) { try { return my.mvr.title(); } catch(E) { return my.acp.dummy_title(); } } + 'persist' : 'hidden width ordinal', + 'id' : 'title', + 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'), + 'flex' : 2, + 'sort_type' : 'title', + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + try { return my.mvr.title(); } + catch(E) { return my.acp.dummy_title(); } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'author', 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { try { return my.mvr.author(); } catch(E) { return my.acp.dummy_author(); } } + 'persist' : 'hidden width ordinal', + 'id' : 'author', + 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + try { return my.mvr.author(); } + catch(E) { return my.acp.dummy_author(); } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'edition', 'label' : 'Edition', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.edition(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'edition', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edition'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.edition(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'isbn', 'label' : 'ISBN', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.isbn(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'isbn', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.isbn'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.isbn(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'pubdate', 'label' : 'PubDate', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.pubdate(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'pubdate', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pubdate'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.pubdate(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'publisher', 'label' : 'Publisher', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.publisher(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'publisher', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.publisher'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.publisher(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'tcn', 'label' : 'TCN', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.tcn(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'tcn', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.tcn'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.tcn(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'renewal_remaining', 'label' : document.getElementById('commonStrings').getString('staff.circ_label_renewal_remaining'), 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.renewal_remaining() : (my.acp.circulations() ? my.acp.circulations()[0].renewal_remaining() : ""); }, 'sort_type' : 'number', + 'persist' : 'hidden width ordinal', + 'id' : 'renewal_remaining', + 'label' : document.getElementById('commonStrings').getString('staff.circ_label_renewal_remaining'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.renewal_remaining(); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].renewal_remaining(); + } else { + return ""; + } + } + }, + 'sort_type' : 'number' }, { - 'persist' : 'hidden width ordinal', 'id' : 'stop_fines', 'label' : 'Fines Stopped', 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.stop_fines() : (my.acp.circulations() ? my.acp.circulations()[0].stop_fines() : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'stop_fines', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.stop_fines'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.stop_fines(); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].stop_fines(); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'stop_fines_time', 'label' : 'Fines Stopped Time', 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.circ ? my.circ.stop_fines_time() : (my.acp.circulations() ? my.acp.circulations()[0].stop_fines_time() : ""); }, + 'persist' : 'hidden width ordinal', + 'id' : 'stop_fines_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.stop_fines_time'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.circ) { + return my.circ.stop_fines_time(); + } else { + if (my.acp.circulations()) { + return my.acp.circulations()[0].stop_fines_time(); + } else { + return ""; + } + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'status', 'label' : document.getElementById('commonStrings').getString('staff.acp_label_status'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { if (Number(my.acp.status())>=0) return data.hash.ccs[ my.acp.status() ].name(); else return my.acp.status().name(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'status', + 'label' : document.getElementById('commonStrings').getString('staff.acp_label_status'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (Number(my.acp.status())>=0) { + return data.hash.ccs[ my.acp.status() ].name(); + } else { + return my.acp.status().name(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'route_to', 'label' : 'Route To', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.route_to.toString(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'route_to', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.route_to'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.route_to.toString(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'message', 'label' : 'Message', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.message.toString(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'message', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.message'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.message.toString(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'uses', 'label' : '# of Uses', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.uses; }, 'sort_type' : 'number', + 'persist' : 'hidden width ordinal', + 'id' : 'uses', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.uses'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.uses; }, + 'sort_type' : 'number' }, { - 'persist' : 'hidden width ordinal', 'id' : 'alert_message', 'label' : 'Alert Message', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.alert_message(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'alert_message', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.alert_message'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.alert_message(); } } ]; for (var i = 0; i < c.length; i++) { @@ -756,7 +1118,7 @@ circ.util.columns = function(modify,params) { } } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} +}; circ.util.transit_columns = function(modify,params) { @@ -764,44 +1126,112 @@ circ.util.transit_columns = function(modify,params) { var c = [ { - 'persist' : 'hidden width ordinal', 'id' : 'transit_item_barcode', 'label' : 'Barcode', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp.barcode(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_item_barcode', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.barcode'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acp.barcode(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_item_title', 'label' : 'Title', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { try { return my.mvr.title(); } catch(E) { return my.acp.dummy_title(); } }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_item_title', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.title'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + try { return my.mvr.title(); } + catch(E) { return my.acp.dummy_title(); } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_item_author', 'label' : 'Author', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { try { return my.mvr.author(); } catch(E) { return my.acp.dummy_author(); } }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_item_author', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.author'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + try { return my.mvr.author(); } + catch(E) { return my.acp.dummy_author(); } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_item_callnumber', 'label' : 'Call Number', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acn.label(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_item_callnumber', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.callnumber'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acn.label(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_id', 'label' : 'Transit ID', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.atc.id(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_id', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_id'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.atc.id(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_source', 'label' : 'Transit Source', 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { return typeof my.atc.source() == "object" ? my.atc.source().shortname() : data.hash.aou[ my.atc.source() ].shortname(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_source', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { + if (typeof my.atc.source() == "object") { + return my.atc.source().shortname(); + } else { + return data.hash.aou[ my.atc.source() ].shortname(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_source_send_time', 'label' : 'Transitted On', 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { return my.atc.source_send_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_source_send_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source_send_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.atc.source_send_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_dest_lib', 'label' : 'Transit Destination', 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { return typeof my.atc.dest() == "object" ? my.atc.dest().shortname() : data.hash.aou[ my.atc.dest() ].shortname(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_dest_lib', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { + if (typeof my.atc.dest() == "object") { + return my.atc.dest().shortname(); + } else { + return data.hash.aou[ my.atc.dest() ].shortname(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_dest_recv_time', 'label' : 'Transit Completed On', 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { return my.atc.dest_recv_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_dest_recv_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest_recv_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { return my.atc.dest_recv_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_target_copy', 'label' : 'Transit Copy ID', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.atc.target_copy(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_target_copy', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_target_copy'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.atc.target_copy(); } }, ]; for (var i = 0; i < c.length; i++) { @@ -833,8 +1263,7 @@ circ.util.transit_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} - +}; circ.util.hold_columns = function(modify,params) { @@ -842,183 +1271,497 @@ circ.util.hold_columns = function(modify,params) { var c = [ { - 'persist' : 'hidden width ordinal', 'id' : 'request_lib', 'label' : 'Request Lib (Full Name)', 'flex' : 1, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { if (Number(my.ahr.request_lib())>=0) return data.hash.aou[ my.ahr.request_lib() ].name(); else return my.ahr.request_lib().name(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'request_lib', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_lib'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (Number(my.ahr.request_lib())>=0) { + return data.hash.aou[ my.ahr.request_lib() ].name(); + } else { + return my.ahr.request_lib().name(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'request_lib_shortname', 'label' : 'Request Lib', 'flex' : 0, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { if (Number(my.ahr.request_lib())>=0) return data.hash.aou[ my.ahr.request_lib() ].shortname(); else return my.ahr.request_lib().shortname(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'request_lib_shortname', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_lib_shortname'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (Number(my.ahr.request_lib())>=0) { + return data.hash.aou[ my.ahr.request_lib() ].shortname(); + } else { + return my.ahr.request_lib().shortname(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'request_timestamp', 'label' : 'Request Timestamp', 'flex' : 0, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.ahr.request_time().toString(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'request_timestamp', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_timestamp'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.request_time().toString(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'request_time', 'label' : 'Request Date', 'flex' : 0, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { return my.ahr.request_time().toString().substr(0,10); }, + 'persist' : 'hidden width ordinal', + 'id' : 'request_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.request_time'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.request_time().toString().substr(0,10); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'available_timestamp', 'label' : 'Available On (Timestamp)', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.transit() ? ( my.ahr.transit().dest_recv_time() ? my.ahr.transit().dest_recv_time().toString() : "") : ( my.ahr.capture_time() ? my.ahr.capture_time().toString() : "" ); }, + 'persist' : 'hidden width ordinal', + 'id' : 'available_timestamp', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.available_timestamp'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.ahr.transit() && my.ahr.transit().dest_recv_time()) { + return my.ahr.transit().dest_recv_time().toString(); + } + if (my.ahr.capture_time()) { + return my.ahr.capture_time().toString(); + } + return ""; + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'available_time', 'label' : 'Available On', 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { return my.ahr.transit() ? ( my.ahr.transit().dest_recv_time() ? my.ahr.transit().dest_recv_time().toString().substr(0,10) : "") : ( my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : "" ); }, + 'persist' : 'hidden width ordinal', + 'id' : 'available_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.available_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { + if (my.ahr.transit() && my.ahr.transit().dest_recv_time()) { + return my.ahr.transit().dest_recv_time().toString().substr(0,10); + } + if (my.ahr.capture_time()) { + return my.ahr.capture_time().toString().substr(0,10); + } + return ""; + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'capture_timestamp', 'label' : 'Capture Timestamp', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString() : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'capture_timestamp', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.capture_timestamp'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString() : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'capture_time', 'label' : 'Capture Date', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'capture_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.capture_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.capture_time() ? my.ahr.capture_time().toString().substr(0,10) : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'status', 'label' : document.getElementById('commonStrings').getString('staff.ahr_status_label'), 'flex' : 1, - 'primary' : false, 'hidden' : false, 'render' : function(my) { switch(my.status) { case 1: case "1": return "Waiting for copy"; break; case 2: case "2": return "Waiting for capture"; break; case 3: case "3": return "In-Transit"; break; case 4: case "4" : return "Ready for pickup"; break; default: return my.status; break;}; }, + 'persist' : 'hidden width ordinal', + 'id' : 'status', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_status_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : false, + 'render' : function(my) { + switch (my.status) { + case 1: + case "1": + return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.1'); + break; + case 2: + case "2": + return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.2'); + break; + case 3: + case "3": + return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.3'); + break; + case 4: + case "4": + return document.getElementById('circStrings').getString('staff.circ.utils.hold_status.4'); + break; + default: + return my.status; + break; + }; + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'hold_type', 'label' : document.getElementById('commonStrings').getString('staff.ahr_hold_type_label'), 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.hold_type(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'hold_type', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_hold_type_label'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.hold_type(); }, }, { - 'persist' : 'hidden width ordinal', 'id' : 'frozen', 'label' : 'Frozen?', 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool( my.ahr.frozen() ) ? 'Yes' : 'No'; }, + 'persist' : 'hidden width ordinal', + 'id' : 'frozen', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.frozen'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (get_bool( my.ahr.frozen() )) { + return document.getElementById('circStrings').getString('staff.circ.utils.yes'); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.no'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'thaw_date', 'label' : 'Thaw Date', 'flex' : 0, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.thaw_date() == null ? 'No Date' : my.ahr.thaw_date().substr(0,10); }, + 'persist' : 'hidden width ordinal', + 'id' : 'thaw_date', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.thaw_date'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.ahr.thaw_date() == null) { + return document.getElementById('circStrings').getString('staff.circ.utils.thaw_date.none'); + } else { + return my.ahr.thaw_date().substr(0,10); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'pickup_lib', 'label' : 'Pickup Lib (Full Name)', 'flex' : 1, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { if (Number(my.ahr.pickup_lib())>=0) return data.hash.aou[ my.ahr.pickup_lib() ].name(); else return my.ahr.pickup_lib().name(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'pickup_lib', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pickup_lib'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (Number(my.ahr.pickup_lib())>=0) { + return data.hash.aou[ my.ahr.pickup_lib() ].name(); + } else { + return my.ahr.pickup_lib().name(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'pickup_lib_shortname', 'label' : document.getElementById('commonStrings').getString('staff.ahr_pickup_lib_label'), 'flex' : 0, - 'primary' : false, 'hidden' : true, - 'render' : function(my) { if (Number(my.ahr.pickup_lib())>=0) return data.hash.aou[ my.ahr.pickup_lib() ].shortname(); else return my.ahr.pickup_lib().shortname(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'pickup_lib_shortname', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_pickup_lib_label'), + 'flex' : 0, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (Number(my.ahr.pickup_lib())>=0) { + return data.hash.aou[ my.ahr.pickup_lib() ].shortname(); + } else { + return my.ahr.pickup_lib().shortname(); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'current_copy', 'label' : document.getElementById('commonStrings').getString('staff.ahr_current_copy_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acp ? my.acp.barcode() : "No Copy"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'current_copy', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_current_copy_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.acp) { + return my.acp.barcode(); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.current_copy.none'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'email_notify', 'label' : document.getElementById('commonStrings').getString('staff.ahr_email_notify_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return get_bool(my.ahr.email_notify()) ? "Yes" : "No"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'email_notify', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_email_notify_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (get_bool(my.ahr.email_notify())) { + return document.getElementById('circStrings').getString('staff.circ.utils.current_copy.yes'); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.current_copy.no'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'expire_time', 'label' : document.getElementById('commonStrings').getString('staff.ahr_expire_time_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.expire_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'expire_time', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_expire_time_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.expire_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'fulfillment_time', 'label' : document.getElementById('commonStrings').getString('staff.ahr_fulfillment_time_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.fulfillment_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'fulfillment_time', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_fulfillment_time_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.fulfillment_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'holdable_formats', 'label' : document.getElementById('commonStrings').getString('staff.ahr_holdable_formats_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.holdable_formats(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'holdable_formats', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_holdable_formats_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.holdable_formats(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'id', 'label' : document.getElementById('commonStrings').getString('staff.ahr_id_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.id(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'id', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_id_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.id(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'phone_notify', 'label' : document.getElementById('commonStrings').getString('staff.ahr_phone_notify_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.phone_notify(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'phone_notify', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_phone_notify_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.phone_notify(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'prev_check_time', 'label' : document.getElementById('commonStrings').getString('staff.ahr_prev_check_time_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.prev_check_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'prev_check_time', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_prev_check_time_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.prev_check_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'requestor', 'label' : document.getElementById('commonStrings').getString('staff.ahr_requestor_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.requestor(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'requestor', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_requestor_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.requestor(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'selection_depth', 'label' : document.getElementById('commonStrings').getString('staff.ahr_selection_depth_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.selection_depth(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'selection_depth', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_selection_depth_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.selection_depth(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'target', 'label' : document.getElementById('commonStrings').getString('staff.ahr_target_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.target(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'target', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_target_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.target(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'usr', 'label' : document.getElementById('commonStrings').getString('staff.ahr_usr_label'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.usr(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'usr', + 'label' : document.getElementById('commonStrings').getString('staff.ahr_usr_label'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.usr(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'title', 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'), 'flex' : 1, 'sort_type' : 'title', - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr ? my.mvr.title() : "No Title?"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'title', + 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_title'), + 'flex' : 1, + 'sort_type' : 'title', + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.mvr) { + return my.mvr.title(); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.title.none'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'author', 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'), 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr ? my.mvr.author() : "No Author?"; }, + 'persist' : 'hidden width ordinal', + 'id' : 'author', + 'label' : document.getElementById('commonStrings').getString('staff.mvr_label_author'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.mvr) { + return my.mvr.author(); + } else { + return document.getElementById('circStrings').getString('staff.circ.utils.author.none'); + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'edition', 'label' : 'Edition', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.edition(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'edition', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.edition'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.edition(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'isbn', 'label' : 'ISBN', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.isbn(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'isbn', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.isbn'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.isbn(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'pubdate', 'label' : 'PubDate', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.pubdate(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'pubdate', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.pubdate'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.pubdate(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'publisher', 'label' : 'Publisher', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.publisher(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'publisher', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.publisher'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.publisher(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'tcn', 'label' : 'TCN', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.mvr.tcn(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'tcn', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.tcn'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.mvr.tcn(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'notify_time', 'label' : 'Last Notify Time', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.notify_time(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'notify_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.notify_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.notify_time(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'notify_count', 'label' : 'Notices', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.notify_count(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'notify_count', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.notify_count'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.notify_count(); } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_source', 'label' : 'Transit Source', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.transit() ? data.hash.aou[ my.ahr.transit().source() ].shortname() : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_source', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { + if (my.ahr.transit()) { + return data.hash.aou[ my.ahr.transit().source() ].shortname(); + } else { + return ""; + } + } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_source_send_time', 'label' : 'Transitted On', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().source_send_time() : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_source_send_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_source_send_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().source_send_time() : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_dest_lib', 'label' : 'Transit Destination', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.transit() ? data.hash.aou[ my.ahr.transit().dest() ].shortname() : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_dest_lib', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.transit() ? data.hash.aou[ my.ahr.transit().dest() ].shortname() : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'transit_dest_recv_time', 'label' : 'Transit Completed On', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().dest_recv_time() : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'transit_dest_recv_time', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.transit_dest_recv_time'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.ahr.transit() ? my.ahr.transit().dest_recv_time() : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'patron_barcode', 'label' : 'Patron Barcode', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.patron_barcode ? my.patron_barcode : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'patron_barcode', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.offline.patron_barcode'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.patron_barcode ? my.patron_barcode : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'patron_family_name', 'label' : 'Patron Last Name', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.patron_family_name ? my.patron_family_name : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'patron_family_name', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.patron_family_name'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.patron_family_name ? my.patron_family_name : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'patron_first_given_name', 'label' : 'Patron First Name', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.patron_first_given_name ? my.patron_first_given_name : ""; }, + 'persist' : 'hidden width ordinal', + 'id' : 'patron_first_given_name', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.patron_first_given_name'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.patron_first_given_name ? my.patron_first_given_name : ""; } }, { - 'persist' : 'hidden width ordinal', 'id' : 'callnumber', 'label' : 'Call Number', 'flex' : 1, - 'primary' : false, 'hidden' : true, 'render' : function(my) { return my.acn.label(); }, + 'persist' : 'hidden width ordinal', + 'id' : 'callnumber', + 'label' : document.getElementById('circStrings').getString('staff.circ.utils.callnumber'), + 'flex' : 1, + 'primary' : false, + 'hidden' : true, + 'render' : function(my) { return my.acn.label(); } }, ]; for (var i = 0; i < c.length; i++) { @@ -1050,7 +1793,7 @@ circ.util.hold_columns = function(modify,params) { } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); -} +}; /* circ.util.std_map_row_to_column = function(error_value) { return function(row,col) { @@ -1058,7 +1801,7 @@ circ.util.std_map_row_to_column = function(error_value) { // col contains one of the objects listed above in columns // mimicking some of the obj in circ.checkin and circ.checkout where map_row_to_column is usually defined - var obj = {}; + var obj = {}; JSAN.use('util.error'); obj.error = new util.error(); JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); JSAN.use('util.network'); obj.network = new util.network(); @@ -1066,7 +1809,7 @@ circ.util.std_map_row_to_column = function(error_value) { var my = row.my; var value; - try { + try { value = eval( col.render ); } catch(E) { obj.error.sdump('D_WARN','map_row_to_column: ' + E); @@ -1074,14 +1817,14 @@ circ.util.std_map_row_to_column = function(error_value) { } return value; } -} +}; */ circ.util.std_map_row_to_columns = function(error_value) { return function(row,cols) { // row contains { 'my' : { 'acp' : {}, 'circ' : {}, 'mvr' : {} } } // cols contains all of the objects listed above in columns - var obj = {}; + var obj = {}; JSAN.use('util.error'); obj.error = new util.error(); JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'}); JSAN.use('util.network'); obj.network = new util.network(); @@ -1090,7 +1833,7 @@ circ.util.std_map_row_to_columns = function(error_value) { var my = row.my; var values = []; var cmd = ''; - try { + try { for (var i = 0; i < cols.length; i++) { switch (typeof cols[i].render) { case 'function': try { values[i] = cols[i].render(my); } catch(E) { values[i] = error_value; dump(E+'\n'); } break; @@ -1105,7 +1848,7 @@ circ.util.std_map_row_to_columns = function(error_value) { } return values; } -} +}; circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,async) { try { @@ -1120,39 +1863,42 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn if (backdate) params.backdate = util.date.formatted_date(backdate + ' 00:00:00','%{iso8601}'); if (typeof async == 'object') { - try { async.disable_textbox(); } catch(E) { error.sdump('D_ERROR','async.disable_textbox() = ' + E); }; + try { async.disable_textbox(); } + catch(E) { error.sdump('D_ERROR','async.disable_textbox() = ' + E); }; } var check = network.request( api.CHECKIN_VIA_BARCODE.app, api.CHECKIN_VIA_BARCODE.method, [ session, params ], - async ? function(req) { + async ? function(req) { try { var check = req.getResultObject(); - var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); + var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); if (typeof async == 'object') { - try { async.checkin_result(r); } catch(E) { error.sdump('D_ERROR','async.checkin_result() = ' + E); }; + try { async.checkin_result(r); } + catch(E) { error.sdump('D_ERROR','async.checkin_result() = ' + E); }; } } catch(E) { JSAN.use('util.error'); var error = new util.error(); - error.standard_unexpected_error_alert('Check In Failed (in circ.util.checkin) (1): ',E); + error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedMessage('staff.circ.checkin.error', ['1']), E); if (typeof async == 'object') { - try { async.enable_textbox(); } catch(E) { error.sdump('D_ERROR','async.disable_textbox() = ' + E); }; + try { async.enable_textbox(); } + catch(E) { error.sdump('D_ERROR','async.disable_textbox() = ' + E); }; } return null; } } : null, { - 'title' : 'Override Checkin Failure?', - 'overridable_events' : [ - 1203 /* COPY_BAD_STATUS */, + 'title' : document.getElementById('circStrings').getString('staff.circ.utils.checkin.override'), + 'overridable_events' : [ + 1203 /* COPY_BAD_STATUS */, 1213 /* PATRON_BARRED */, 1217 /* PATRON_INACTIVE */, 1224 /* PATRON_ACCOUNT_EXPIRED */, 7009 /* CIRC_CLAIMS_RETURNED */, - 7010 /* COPY_ALERT_MESSAGE */, - 7011 /* COPY_STATUS_LOST */, - 7012 /* COPY_STATUS_MISSING */, + 7010 /* COPY_ALERT_MESSAGE */, + 7011 /* COPY_STATUS_LOST */, + 7012 /* COPY_STATUS_MISSING */, 7013 /* PATRON_EXCEEDS_FINES */, ], 'text' : { @@ -1167,19 +1913,19 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn } ); if (!async) { - return circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); + return circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); } } catch(E) { JSAN.use('util.error'); var error = new util.error(); - error.standard_unexpected_error_alert('Check In Failed (in circ.util.checkin) (2): ',E); + error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedMessage('staff.circ.checkin.error', ['2']), E); if (typeof async == 'object') { try { async.enable_textbox(); } catch(E) { error.sdump('D_ERROR','async.disable_textbox() = ' + E); }; } return null; } -} +}; circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,check) { try { @@ -1192,11 +1938,11 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che check.message = check.textcode; - if (check.payload && check.payload.copy) check.copy = check.payload.copy; - if (check.payload && check.payload.record) check.record = check.payload.record; - if (check.payload && check.payload.circ) check.circ = check.payload.circ; + if (check.payload && check.payload.copy) { check.copy = check.payload.copy; } + if (check.payload && check.payload.record) { check.record = check.payload.record; } + if (check.payload && check.payload.circ) { check.circ = check.payload.circ; } - if (!check.route_to) check.route_to = ' '; + if (!check.route_to) { check.route_to = ' '; } if (document.getElementById('no_change_label')) { document.getElementById('no_change_label').setAttribute('value',''); @@ -1207,10 +1953,10 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che network.simple_request('FM_MBTS_RETRIEVE',[ses(),check.circ.id()], function(req) { JSAN.use('util.money'); var bill = req.getResultObject(); - if (Number(bill.balance_owed()) == 0) return; + if (Number(bill.balance_owed()) == 0) { return; } if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value', m + 'Transaction for ' + params.barcode + ' billable $' + util.money.sanitize(bill.balance_owed()) + ' '); + 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())]) + ' '); document.getElementById('no_change_label').setAttribute('hidden','false'); } }); @@ -1219,111 +1965,169 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che var msg = ''; if (check.payload && check.payload.cancelled_hold_transit) { - msg += 'Original hold for transit cancelled.\n\n'; + msg += document.getElementById('circStrings').getString('staff.circ.utils.transit_hold_cancelled'); + msg += '\n\n'; } /* SUCCESS / NO_CHANGE / ITEM_NOT_CATALOGED */ if (check.ilsevent == 0 || check.ilsevent == 3 || check.ilsevent == 1202) { - try { check.route_to = data.lookup('acpl', check.copy.location() ).name(); } catch(E) { msg += 'Please inform your helpdesk/developers of this error:\nFIXME: ' + E + '\n'; } + try { check.route_to = data.lookup('acpl', check.copy.location() ).name(); } + catch(E) { + msg += document.getElementById('commonStrings').getString('common.error'); + msg += '\nFIXME: ' + E + '\n'; + } if (check.ilsevent == 3 /* NO_CHANGE */) { //msg = 'This item is already checked in.\n'; if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' was already checked in. '); + document.getElementById('no_change_label').setAttribute('value', m + document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]) + ' '); document.getElementById('no_change_label').setAttribute('hidden','false'); } } if (check.ilsevent == 1202 /* ITEM_NOT_CATALOGED */ && check.copy.status() != 11) { - msg = 'Please inform your helpdesk/developers of this error:\nFIXME -- ITEM_NOT_CATALOGED event but copy status is ' - + (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() ) + '\n'; + var copy_status = (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() ); + msg = document.getElementById('commonStrings').getString('common.error'); + msg += '\nFIXME --'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_not_cataloged', [copy_status]); + msg + '\n'; } switch(check.copy.status()) { case 0: /* AVAILABLE */ case 7: /* RESHELVING */ - if (msg) msg += 'This item needs to be routed to ' + check.route_to + '.\n'; + if (msg) { + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to', [check.route_to]); + msg += '\n'; + } break; case 8: /* ON HOLDS SHELF */ check.route_to = 'HOLDS SHELF'; if (check.payload.hold) { if (check.payload.hold.pickup_lib() != data.list.au[0].ws_ou()) { - msg += 'Please inform your helpdesk/developers of this error:\nFIXME: We should have received a ROUTE_ITEM\n'; + msg += document.getElementById('commonStrings').getString('common.error'); + msg += '\nFIXME: '; + msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_error'); + msg += '\n'; } else { - msg += 'This item needs to be routed to ' + check.route_to + '.\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to', [check.route_to]); + msg += '.\n'; } - } else { - msg += 'Please inform your helpdesk/developers of this error:\nFIXME: status of Holds Shelf, but no actual hold found.\n'; + } else { + msg += document.getElementById('commonStrings').getString('common.error'); + msg += '\nFIXME: '; + msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_status_error'); + msg += '\n'; } - JSAN.use('util.date'); + JSAN.use('util.date'); if (check.payload.hold) { JSAN.use('patron.util'); - msg += '\nBarcode: ' + check.payload.copy.barcode() + '\n'; - msg += 'Title: ' + (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() ) + '\n'; + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [check.payload.copy.barcode()]); + msg += '\n'; + var payload_title = (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() ); + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.title', [payload_title]); + msg += '\n'; var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() ); - msg += '\nHold for patron ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + ' ' + au_obj.second_given_name() + '\n'; - msg += 'Barcode: ' + au_obj.card().barcode() + '\n'; - if (check.payload.hold.phone_notify()) msg += 'Notify by phone: ' + check.payload.hold.phone_notify() + '\n'; - if (check.payload.hold.email_notify()) msg += 'Notify by email: ' + (au_obj.email() ? au_obj.email() : '') + '\n'; - msg += '\nRequest Date: ' + util.date.formatted_date(check.payload.hold.request_time(),'%F') + '\n'; + msg += '\n'; + 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()]); + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [au_obj.card().barcode()]); + msg += '\n'; + if (check.payload.hold.phone_notify()) { + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.phone_notify', [check.payload.hold.phone_notify()]); + msg += '\n'; + } + if (check.payload.hold.email_notify()) { + var payload_email = au_obj.email() ? au_obj.email() : ''; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.email_notify', [payload_email]); + msg += '\n'; + } + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [util.date.formatted_date(check.payload.hold.request_time(),'%F')]); + msg += '\n'; } var rv = 0; - msg += 'Slip Date: ' + util.date.formatted_date(new Date(),'%F') + '\n'; - if (!auto_print) rv = error.yns_alert_formatted( - msg, - 'Hold Slip', - "Print", - "Don't Print", - null, - "Check here to confirm this message", - '/xul/server/skin/media/images/turtle.gif' - ); + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [util.date.formatted_date(new Date(),'%F')]); + msg += '\n'; + if (!auto_print) { + rv = error.yns_alert_formatted( + msg, + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip'), + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.yes'), + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.no'), + null, + document.getElementById('circStrings').getString('staff.circ.confirm.msg'), + '/xul/server/skin/media/images/turtle.gif' + ); + } if (rv == 0) { try { JSAN.use('util.print'); var print = new util.print(); msg = msg.replace(/&/g, '&').replace(//g, '>').replace(/\n/g,'
'); print.simple( msg , { 'no_prompt' : true, 'content_type' : 'text/html' } ); } catch(E) { - dump('Please inform your helpdesk/developers of this error:\nFIXME: ' + E + '\n'); - alert('Please inform your helpdesk/developers of this error:\nFIXME: ' + E + '\n'); + var err_msg = document.getElementById('commonStrings').getString('common.error'); + err_msg += '\nFIXME: ' + E + '\n'; + dump(err_msg); + alert(err_msg); } } msg = ''; if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' has been captured for a hold. '); + m += document.getElementById('circStrings').getFormattedString('staff.circ.utils.capture', [params.barcode]); + document.getElementById('no_change_label').setAttribute('value', m); document.getElementById('no_change_label').setAttribute('hidden','false'); } break; case 6: /* IN TRANSIT */ check.route_to = 'TRANSIT SHELF??'; - msg += ("Please inform your helpdesk/developers of this error:\nFIXME -- I didn't think we could get here.\n"); + msg += document.getElementById('commonStrings').getString('common.error'); + msg += "\nFIXME -- I didn't think we could get here.\n"; break; case 11: /* CATALOGING */ check.route_to = 'CATALOGING'; if (document.getElementById('do_not_alert_on_precat')) { var x = document.getElementById('do_not_alert_on_precat'); - if (! x.checked) msg += 'This item needs to be routed to ' + check.route_to + '.'; + if (! x.checked) { + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to', [check.route_to]); + } } else { - msg += 'This item needs to be routed to ' + check.route_to + '.'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to', [check.route_to]); } if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' needs to be cataloged. '); + var needs_cat = document.getElementById('circStrings').getFormattedString('staff.circ.utils.needs_cataloging', [params.barcode]); + document.getElementById('no_change_label').setAttribute('value', m + needs_cat + ' '); document.getElementById('no_change_label').setAttribute('hidden','false'); } break; default: - msg += ('Please inform your helpdesk/developers of this error:\nFIXME -- this case "' + (data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name()) + '" is unhandled.\n'); - msg += 'This item needs to be routed to ' + check.route_to + '.'; + msg += document.getElementById('commonStrings').getString('common.error'); + var copy_status = data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name(); + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.copy_status.error', [copy_status]); + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to', [check.route_to]); break; } - if (msg) error.yns_alert(msg,'Alert',null,'OK',null,"Check here to confirm this message"); - + if (msg) { + error.yns_alert( + msg, + document.getElementById('circStrings').getString('staff.circ.alert'), + null, + document.getElementById('circStrings').getString('staff.circ.utils.msg.ok'), + null, + document.getElementById('circStrings').getString('staff.circ.confirm.msg') + ); + } } else /* ROUTE_ITEM */ if (check.ilsevent == 7000) { var lib = data.hash.aou[ check.org ]; check.route_to = lib.shortname(); - msg += 'Destination: ' + check.route_to + '.\n'; - msg += '\n' + lib.name() + '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.destination', [check.route_to]); + msg += '\n\n'; + msg += lib.name(); + msg += '\n'; try { if (lib.holds_address() ) { var a = network.simple_request('FM_AOA_RETRIEVE',[ lib.holds_address() ]); @@ -1332,36 +2136,59 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che if (a.street2()) msg += a.street2() + '\n'; msg += (a.city() ? a.city() + ', ' : '') + (a.state() ? a.state() + ' ' : '') + (a.post_code() ? a.post_code() : '') + '\n'; } else { - msg += "We do not have a holds address for this library.\n"; + msg += document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address'); + msg += '\n'; } } catch(E) { - msg += 'Unable to retrieve mailing address.\n'; - error.standard_unexpected_error_alert('Unable to retrieve mailing address.',E); + msg += document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address.error'); + msg += '\n'; + error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.utils.route_to.no_address.error'), E); } - msg += '\nBarcode: ' + check.payload.copy.barcode() + '\n'; - msg += 'Title: ' + (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() ) + '\n'; - msg += 'Author: ' + (check.payload.record ? check.payload.record.author() :check.payload.copy.dummy_author() ) + '\n'; + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [check.payload.copy.barcode()]); + msg += '\n'; + var payload_title = (check.payload.record ? check.payload.record.title() : check.payload.copy.dummy_title() ); + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.title', [payload_title]); + msg += '\n'; + var payload_author = (check.payload.record ? check.payload.record.author() :check.payload.copy.dummy_author()); + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.author', [payload_author]); + msg += '\n'; JSAN.use('util.date'); if (check.payload.hold) { JSAN.use('patron.util'); var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() ); - msg += '\nHold for patron ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + ' ' + au_obj.second_given_name() + '\n'; - msg += 'Barcode: ' + au_obj.card().barcode() + '\n'; - if (check.payload.hold.phone_notify()) msg += 'Notify by phone: ' + check.payload.hold.phone_notify() + '\n'; - if (check.payload.hold.email_notify()) msg += 'Notify by email: ' + (au_obj.email() ? au_obj.email() : '') + '\n'; - msg += '\nRequest Date: ' + util.date.formatted_date(check.payload.hold.request_time(),'%F'); + msg += '\n'; + document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron', [au_obj.family_name(), au_obj.first_given_name(), au_obj.second_given_name()]); + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.barcode', [au_obj.card().barcode()]); + msg += '\n'; + if (check.payload.hold.phone_notify()) { + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.phone_notify', [check.payload.hold.phone_notify()]); + msg += '\n'; + } + if (check.payload.hold.email_notify()) { + var payload_email = au_obj.email() ? au_obj.email() : ''; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.email_notify', [payload_email]); + msg += '\n'; + } + msg += '\n'; + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.request_date', [util.date.formatted_date(check.payload.hold.request_time(),'%F')]); + msg += '\n'; } var rv = 0; - msg += '\nSlip Date: ' + util.date.formatted_date(new Date(),'%F') + '\n'; - if (!auto_print) rv = error.yns_alert_formatted( - msg, - 'Transit Slip', - "Print", - "Don't Print", - null, - "Check here to confirm this message", - '/xul/server/skin/media/images/turtle.gif' - ); + msg += document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.slip_date', [util.date.formatted_date(new Date(),'%F')]); + if (!auto_print) { + rv = error.yns_alert_formatted( + msg, + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip'), + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.yes'), + document.getElementById('circStrings').getString('staff.circ.utils.hold_slip.print.no'), + null, + document.getElementById('circStrings').getString('staff.circ.confirm.msg'), + '/xul/server/skin/media/images/turtle.gif' + ); + } + if (rv == 0) { try { JSAN.use('util.print'); var print = new util.print(); @@ -1369,46 +2196,50 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che msg = msg.replace(/&/g, '&').replace(//g, '>').replace(/\n/g,'
'); print.simple( msg , { 'no_prompt' : true, 'content_type' : 'text/html' } ); } catch(E) { - dump('Please inform your helpdesk/developers of this error:\nFIXME: ' + E + '\n'); - alert('Please inform your helpdesk/developers of this error:\nFIXME: ' + E + '\n'); + var err_msg = document.getElementById('commonStrings').getString('common.error'); + err_msg += '\nFIXME: ' + E + '\n'; + dump(err_msg); + alert(err_msg); } } if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' is in transit. '); + var trans_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.in_transit', [params.barcode]); + document.getElementById('no_change_label').setAttribute('value', m + trans_msg + ' '); document.getElementById('no_change_label').setAttribute('hidden','false'); } } else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) { check.route_to = 'CATALOGING'; + var mis_scan_msg = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.status.copy_not_found', [params.barcode]); error.yns_alert( - 'The barcode was either mis-scanned or the item needs to be cataloged.', - 'Alert', + mis_scan_msg, + document.getElementById('circStrings').getString('staff.circ.alert'), null, - 'OK', + document.getElementById('circStrings').getString('staff.circ.utils.msg.ok'), null, - "Check here to confirm this message" + document.getElementById('circStrings').getString('staff.circ.confirm.msg') ); if (document.getElementById('no_change_label')) { var m = document.getElementById('no_change_label').getAttribute('value'); - document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' is mis-scanned or not cataloged. '); + document.getElementById('no_change_label').setAttribute('value',m + mis_scan_msg + ' '); document.getElementById('no_change_label').setAttribute('hidden','false'); } } else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) { - error.standard_network_error_alert('Check In Failed. If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface'); + error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline')); } else { switch (check.ilsevent) { - case 1203 /* COPY_BAD_STATUS */ : + case 1203 /* COPY_BAD_STATUS */ : case 1213 /* PATRON_BARRED */ : case 1217 /* PATRON_INACTIVE */ : case 1224 /* PATRON_ACCOUNT_EXPIRED */ : case 7009 /* CIRC_CLAIMS_RETURNED */ : - case 7010 /* COPY_ALERT_MESSAGE */ : - case 7011 /* COPY_STATUS_LOST */ : - case 7012 /* COPY_STATUS_MISSING */ : + case 7010 /* COPY_ALERT_MESSAGE */ : + case 7011 /* COPY_STATUS_LOST */ : + case 7012 /* COPY_STATUS_MISSING */ : case 7013 /* PATRON_EXCEEDS_FINES */ : return null; /* handled */ break; @@ -1421,10 +2252,10 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che return check; } catch(E) { JSAN.use('util.error'); var error = new util.error(); - error.standard_unexpected_error_alert('Check In Failed (in circ.util.checkin) (3): ',E); + error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedMessage('staff.circ.checkin.error', ['3']), E); return null; } -} +}; circ.util.renew_via_barcode = function ( barcode, patron_id, async ) { try { @@ -1439,7 +2270,7 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) { try { var renew = req.getResultObject(); if (typeof renew.ilsevent != 'undefined') renew = [ renew ]; - for (var j = 0; j < renew.length; j++) { + for (var j = 0; j < renew.length; j++) { switch(renew[j].ilsevent) { case 0 /* SUCCESS */ : break; case 5000 /* PERM_FAILURE */: break; @@ -1453,8 +2284,8 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) { case 7004 /* COPY_NOT_AVAILABLE */ : break; case 7006 /* COPY_IS_REFERENCE */ : break; case 7007 /* COPY_NEEDED_FOR_HOLD */ : break; - case 7008 /* MAX_RENEWALS_REACHED */ : break; - case 7009 /* CIRC_CLAIMS_RETURNED */ : break; + case 7008 /* MAX_RENEWALS_REACHED */ : break; + case 7009 /* CIRC_CLAIMS_RETURNED */ : break; case 7010 /* COPY_ALERT_MESSAGE */ : break; case 7013 /* PATRON_EXCEEDS_FINES */ : break; default: @@ -1466,18 +2297,18 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) { return renew; } catch(E) { JSAN.use('util.error'); var error = new util.error(); - error.standard_unexpected_error_alert('Renew Failed for ' + barcode,E); + error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedMessage('staff.circ.checkin.renew_failed.error', [barcode]), E); return null; } } var renew = obj.network.simple_request( - 'CHECKOUT_RENEW', + 'CHECKOUT_RENEW', [ ses(), params ], async ? renew_callback : null, { - 'title' : 'Override Renew Failure?', - 'overridable_events' : [ + 'title' : document.getElementById('circStrings').getMessage('staff.circ.checkin.renew_failed.override'), + 'overridable_events' : [ 1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */, 1213 /* PATRON_BARRED */, 1215 /* CIRC_EXCEEDS_COPY_RANGE */, @@ -1486,40 +2317,40 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) { 7004 /* COPY_NOT_AVAILABLE */, 7006 /* COPY_IS_REFERENCE */, 7007 /* COPY_NEEDED_FOR_HOLD */, - 7008 /* MAX_RENEWALS_REACHED */, - 7009 /* CIRC_CLAIMS_RETURNED */, + 7008 /* MAX_RENEWALS_REACHED */, + 7009 /* CIRC_CLAIMS_RETURNED */, 7010 /* COPY_ALERT_MESSAGE */, 7013 /* PATRON_EXCEEDS_FINES */, ], 'text' : { - '1212' : function(r) { return 'Barcode: ' + barcode; }, - '1213' : function(r) { return 'Barcode: ' + barcode; }, - '1215' : function(r) { return 'Barcode: ' + barcode; }, - '7002' : function(r) { return 'Barcode: ' + barcode; }, - '7003' : function(r) { return 'Barcode: ' + barcode; }, + '1212' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '1213' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '1215' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '7002' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '7003' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, '7004' : function(r) { - return 'Barcode: ' + barcode + ' Status: ' + r.payload.status().name(); + return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode.status', [barcode, r.payload.status().name()]); }, - '7006' : function(r) { return 'Barcode: ' + barcode; }, - '7007' : function(r) { return 'Barcode: ' + barcode; }, - '7008' : function(r) { return 'Barcode: ' + barcode; }, - '7009' : function(r) { return 'Barcode: ' + barcode; }, + '7006' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '7007' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '7008' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, + '7009' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); }, '7010' : function(r) { - return 'Barcode: ' + barcode + ' Message: ' + r.payload; + return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode.msg', [barcode, r.payload]); }, - '7013' : function(r) { return 'Barcode: ' + barcode; }, + '7013' : function(r) { return document.getElementById('circStrings').getFormattedString('staff.circ.renew.barcode', [barcode]); } } } ); - if (! async ) return renew_callback( { 'getResultObject' : function() { return renew; } } ); + if (! async ) { + return renew_callback( { 'getResultObject' : function() { return renew; } } ); + } } catch(E) { JSAN.use('util.error'); var error = new util.error(); - error.standard_unexpected_error_alert('Renew Failed for ' + barcode,E); + error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.renew_failed.error', [barcode]), E); return null; } -} - - +}; dump('exiting circ/util.js\n'); diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties index 9a9ad3edf2..3b89c60d7e 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties @@ -192,7 +192,7 @@ staff.circ.utils.offline.timestamp=Timestamp staff.circ.utils.offline.checkout_time=Check Out Time staff.circ.utils.offline.type=Transaction Type staff.circ.utils.offline.noncat=Non-Cataloged? -staff.circ.utils.offline.noncat_type=Non-Cat Type ID +staff.circ.utils.offline.noncat_type=Non-Cataloged Type ID staff.circ.utils.offline.count=Count staff.circ.utils.offline.patron_barcode=Patron Barcode staff.circ.utils.offline.item_barcode=Item Barcode @@ -211,3 +211,101 @@ staff.circ.utils.circulate=Circulate? staff.circ.utils.deleted=Deleted? staff.circ.utils.holdable=Holdable? staff.circ.utils.opac_visible=OPAC Visible? +staff.circ.utils.reference=Reference? +staff.circ.utils.deposit=Deposit? +# The < and > highlight that the value is not set; translate Unset and change the delimiters as needed +staff.circ.utils.unset= +staff.circ.utils.checkout_lib=Checkout Library +staff.circ.utils.checkout_timestamp=Checkout Timestamp +staff.circ.utils.checkin_timestamp=Checkin Timestamp +staff.circ.utils.xact_start=Checkout Date +staff.circ.utils.checkin_time=Checkin Date +staff.circ.utils.xact_finish=Transaction Finished +staff.circ.utils.create_date=Date Created +staff.circ.utils.edit_date=Date Last Edited +staff.circ.utils.edition=Edition +staff.circ.utils.isbn=ISBN +staff.circ.utils.pubdate=Publication Date +staff.circ.utils.publisher=Publisher +# TCN is an acronym for Title Control Number +staff.circ.utils.tcn=TCN +staff.circ.utils.stop_fines=Fines Stopped +staff.circ.utils.stop_fines_time=Fines Stopped Time +staff.circ.utils.route_to=Route To +staff.circ.utils.message=Message +staff.circ.utils.uses=# of Uses +staff.circ.utils.alert_message=Alert Message +staff.circ.utils.barcode=Barcode +staff.circ.utils.title=Title +staff.circ.utils.author=Author +staff.circ.utils.callnumber=Call Number +staff.circ.utils.transit_id=Transit ID +staff.circ.utils.transit_source=Transit Source +staff.circ.utils.transit_source_send_time=Transit Send Time +staff.circ.utils.transit_dest=Transit Destination +staff.circ.utils.transit_dest_recv_time=Transit Completion Time +staff.circ.utils.transit_target_copy=Transit Copy ID +staff.circ.utils.request_lib=Request Library (Full Name) +staff.circ.utils.request_lib_shortname=Request Library +staff.circ.utils.request_timestamp=Request Timestamp +staff.circ.utils.request_time=Request Date +# Time the hold became available +staff.circ.utils.available_timestamp=Available On (Timestamp) +# Date the hold became available +staff.circ.utils.available_time=Available On +# Time the hold was captured +staff.circ.utils.capture_timestamp=Capture Timestamp +# Date the hold was captured +staff.circ.utils.capture_time=Capture Date +staff.circ.utils.hold_status.1=Waiting for copy +staff.circ.utils.hold_status.2=Waiting for capture +staff.circ.utils.hold_status.3=In-Transit +staff.circ.utils.hold_status.4=Ready for pickup +staff.circ.utils.frozen=Frozen? +staff.circ.utils.thaw_date=Thaw Date +staff.circ.utils.thaw_date.none=No Date +staff.circ.utils.pickup_lib=Pickup Library (Full Name) +staff.circ.utils.current_copy.none=No Copy +staff.circ.utils.title.none=No Title? +staff.circ.utils.author.none=No Author? +staff.circ.utils.notify_time=Last Notify Time +staff.circ.utils.notify_count=Notices +staff.circ.utils.patron_family_name=Patron Last Name +staff.circ.utils.patron_first_given_name=Patron First Name +staff.circ.utils.checkin.override=Override Checkin Failure? +staff.circ.utils.billable.amount=Transaction for %1$s billable $%2$s +staff.circ.utils.transit_hold_cancelled=Original hold for transit cancelled. +staff.circ.utils.item_checked_in=%1$s was already checked in. +staff.circ.utils.item_not_cataloged=ITEM_NOT_CATALOGED event but copy status is %1$s +staff.circ.utils.route_to=This item needs to be routed to %1$s +staff.circ.utils.route_item_error=We should have received a ROUTE_ITEM +staff.circ.utils.route_item_status_error=status of Holds Shelf, but no actual hold found. +staff.circ.utils.payload.hold.barcode=Barcode: %1$s +staff.circ.utils.payload.hold.title=Title: %1$s +# Hold for patron familyName, firstName secondName +staff.circ.utils.payload.hold.patron=Hold for patron %1$s, %2$s %3$s +staff.circ.utils.payload.hold.phone_notify=Notify by phone: %1$s +staff.circ.utils.payload.hold.email_notify=Notify by email: %1$s +staff.circ.utils.payload.hold.request_date=Request Date: %1$s +staff.circ.utils.payload.hold.slip_date=Slip Date: %1$s +staff.circ.utils.hold_slip=Hold Slip +staff.circ.utils.hold_slip.print.yes=Print +staff.circ.utils.hold_slip.print.no=Do Not Print +staff.circ.utils.capture=%1$s has been captured for a hold. +staff.circ.utils.needs_cataloging=%1$s needs to be cataloged. +staff.circ.utils.copy_status.error=FIXME -- this case "%1$s" is unhandled. +staff.circ.utils.msg.ok=OK +staff.circ.utils.route_to.destination=Destination: %1$s. +staff.circ.utils.route_to.no_address=We do not have a holds address for this library. +staff.circ.utils.route_to.no_address.error=Unable to retrieve mailing address. +staff.circ.utils.payload.author=Author: %1$s +staff.circ.utils.payload.in_transit=%1$s is in transit. +staff.circ.checkin.error=Check In Failed (in circ.util.checkin) (%1$s): +# "Circulation" - check &staff.main.menu.circ.label; in lang.dtd +# "Offline Interface" - check &staff.main.menu.circ.offline.label; in lang.dtd +staff.circ.checkin.suggest_offline=Check In Failed. If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface +staff.circ.checkin.renew_failed.error=Renew Failed for %1$s +staff.circ.checkin.renew_failed.override=Override Renew Failure? +staff.circ.renew.barcode=Barcode: %1$s +staff.circ.renew.barcode.status=Barcode: %1$s Status: %2$s +staff.circ.renew.barcode.msg=Barcode: %1$s Message: %2$s diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/common.properties b/Open-ILS/xul/staff_client/server/locale/en-US/common.properties index 53d297ddba..86a4e07498 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/common.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/common.properties @@ -1,5 +1,6 @@ common.exception=!! This software has encountered an error. Please tell your friendly system administrator or software developer the following:\n%1$s\n%2$s\n common.jsan.missing=The JSAN library object is missing. +common.error=Please inform your helpdesk or developers of this error: common.ok=Ok common.clear=Clear common.confirm=Check here to confirm this message.