From d7987f018e9cb5aaffa70785c9dee422f70a95a7 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 7 Feb 2008 22:39:23 +0000 Subject: [PATCH] Mostly finish off server/circ i18n work git-svn-id: svn://svn.open-ils.org/ILS/trunk@8696 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 42 +++++++ .../xul/staff_client/server/circ/checkin.xul | 2 +- .../staff_client/server/circ/copy_status.js | 115 ++++++++++++------ .../staff_client/server/circ/copy_status.xul | 20 +-- .../staff_client/server/circ/hold_capture.js | 25 ++-- .../staff_client/server/circ/hold_capture.xul | 14 ++- .../server/circ/hold_capture_overlay.xul | 4 +- .../staff_client/server/circ/in_house_use.js | 58 ++++++--- .../staff_client/server/circ/in_house_use.xul | 42 ++++--- .../server/circ/pre_cat_fields.xul | 24 ++-- .../server/circ/print_list_template_editor.js | 84 +++++++++---- .../circ/print_list_template_editor.xul | 47 +++---- .../server/locale/en-US/circ.properties | 46 +++++++ 13 files changed, 367 insertions(+), 156 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 74ed59106a..5629c172fa 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1604,3 +1604,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.xul b/Open-ILS/xul/staff_client/server/circ/checkin.xul index b0fbb18624..eefffa405c 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin.xul @@ -1,4 +1,4 @@ - + diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index ce4d5d8ab2..7874490bbe 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -1,7 +1,7 @@ dump('entering circ.copy_status.js\n'); // vim:noet:sw=4:ts=4: -if (typeof circ == 'undefined') circ = {}; +if (typeof circ == 'undefined') { circ = {}; } circ.copy_status = function (params) { JSAN.use('util.error'); this.error = new util.error(); @@ -10,7 +10,7 @@ circ.copy_status = function (params) { JSAN.use('util.date'); JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'}); JSAN.use('util.sound'); this.sound = new util.sound(); -} +}; circ.copy_status.prototype = { 'selection_list' : [], @@ -29,12 +29,12 @@ circ.copy_status.prototype = { 'call_number' : { 'hidden' : false }, 'status' : { 'hidden' : false }, 'alert_message' : { 'hidden' : false }, - 'due_date' : { 'hidden' : false }, + 'due_date' : { 'hidden' : false } }, { 'except_these' : [ - 'checkin_time', 'checkin_time_full', 'route_to', 'message', 'uses', 'xact_finish', - ], + 'checkin_time', 'checkin_time_full', 'route_to', 'message', 'uses', 'xact_finish' + ] } ); @@ -102,7 +102,7 @@ circ.copy_status.prototype = { } catch(E) { alert('FIXME: ' + E); } - }, + } } ); @@ -293,7 +293,7 @@ circ.copy_status.prototype = { JSAN.use('util.file'); var f = new util.file(''); var content = f.import_file( { 'title' : document.getElementById('circStrings').getString('staff.circ.copy_status.upload_file.title'), 'not_json' : true } ); - if (!content) return; + if (!content) { return; } var barcodes = content.split(/\s+/); if (barcodes.length > 0) { JSAN.use('util.exec'); var exec = new util.exec(); @@ -303,7 +303,7 @@ circ.copy_status.prototype = { function(b){ return function() { obj.copy_status(b); - } + }; }(barcodes[i]) ); } @@ -353,7 +353,7 @@ circ.copy_status.prototype = { } catch(E) { obj.error.standard_unexpected_error_alert('export',E); } - } + }; obj.list.full_retrieve(); } catch(E) { obj.error.standard_unexpected_error_alert('export',E); @@ -368,21 +368,27 @@ circ.copy_status.prototype = { JSAN.use('util.functional'); var list = util.functional.map_list( obj.selection_list, function(o) { return o.acn_id; } ); - if (list.length == 0) return; + if (list.length == 0) { return; } var copy_shortcut = {}; var map_acn = {}; for (var i = 0; i < list.length; i++) { var volume_id = list[i]; - if (volume_id == -1) continue; /* ignore magic pre-cat volume */ + if (volume_id == -1) { + continue; /* ignore magic pre-cat volume */ + } if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE',[ volume_id ]); } var record_id = map_acn[ volume_id ].record(); var ou_id = map_acn[ volume_id ].owning_lib(); var label = map_acn[ volume_id ].label(); - if (!copy_shortcut[record_id]) copy_shortcut[record_id] = {}; - if (!copy_shortcut[record_id][ou_id]) copy_shortcut[record_id][ou_id] = {}; + if (!copy_shortcut[record_id]) { + copy_shortcut[record_id] = {}; + } + if (!copy_shortcut[record_id][ou_id]) { + copy_shortcut[record_id][ou_id] = {}; + } copy_shortcut[record_id][ou_id][ label ] = volume_id; } @@ -408,7 +414,9 @@ circ.copy_status.prototype = { obj.error.sdump('D_ERROR','batch permission check: ' + E); } - if (edit==0) return; // no read-only view for this interface + if (edit==0) { + return; // no read-only view for this interface + } var title = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.add_items.title', [r]); @@ -451,7 +459,9 @@ circ.copy_status.prototype = { copies[i].isdeleted(1); } - if (! window.confirm(document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.del_items.confirm', [util.functional.map_list( copies, function(o) { return o.barcode(); }).join(", "))]) ) return; + if (! window.confirm(document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.del_items.confirm', [util.functional.map_list( copies, function(o) { return o.barcode(); }).join(", ")]))) { + return; + } var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',[ ses(), copies, true]); var robj = obj.network.simple_request( @@ -462,7 +472,7 @@ circ.copy_status.prototype = { 'title' : document.getElementById('circStrings').getString('staff.circ.copy_status.del_items.title'), 'overridable_events' : [ 1208 /* TITLE_LAST_COPY */, - 1227 /* COPY_DELETE_WARNING */, + 1227 /* COPY_DELETE_WARNING */ ] } ); @@ -503,7 +513,7 @@ circ.copy_status.prototype = { 'copy_ids' : list, 'docid' : volume.record(), 'volume_label' : volume.label(), - 'owning_lib' : volume.owning_lib(), + 'owning_lib' : volume.owning_lib() } ); } catch(E) { @@ -518,13 +528,15 @@ circ.copy_status.prototype = { try { JSAN.use('util.functional'); var list = util.functional.map_list( obj.selection_list, function(o) { return o.acn_id; } ); - if (list.length == 0) return; + if (list.length == 0) { return; } var aou_hash = {}; var map_acn = {}; for (var i = 0; i < list.length; i++) { var volume_id = list[i]; - if (volume_id == -1) continue; /* ignore magic pre-cat volume */ + if (volume_id == -1) { + continue; /* ignore magic pre-cat volume */ + } if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE',[ volume_id ]); } @@ -587,25 +599,32 @@ circ.copy_status.prototype = { try { JSAN.use('util.functional'); var list = util.functional.map_list( obj.selection_list, function(o) { return o.acn_id; } ); - if (list.length == 0) return; + if (list.length == 0) { return; } var volume_hash = {}; var map_acn = {}; for (var i = 0; i < list.length; i++) { var volume_id = list[i]; - if (volume_id == -1) continue; /* ignore magic pre-cat volume */ + if (volume_id == -1) { + continue; /* ignore magic pre-cat volume */ + } if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE',[ volume_id ]); map_acn[ volume_id ].copies( [] ); } var record_id = map_acn[ volume_id ].record(); - if (!volume_hash[record_id]) volume_hash[record_id] = {}; + if (!volume_hash[record_id]) { + volume_hash[record_id] = {}; + } volume_hash[record_id][volume_id] = 1; } for (var rec in volume_hash) { - list = []; for (var v in volume_hash[rec]) list.push( map_acn[v] ); + list = []; + for (var v in volume_hash[rec]) { + list.push( map_acn[v] ); + } var edit = 0; try { @@ -654,7 +673,7 @@ circ.copy_status.prototype = { //obj.data.stash_retrieve(); //var volumes = JSON2js( obj.data.volumes_temp ); var volumes = my_xulG.volumes; - if (!volumes) return; + if (!volumes) { return; } volumes = util.functional.filter_list( volumes, @@ -671,7 +690,7 @@ circ.copy_status.prototype = { } ); - if (volumes.length == 0) return; + if (volumes.length == 0) { return; } try { var r = obj.network.request( @@ -706,19 +725,24 @@ circ.copy_status.prototype = { try { JSAN.use('util.functional'); var list = util.functional.map_list( obj.selection_list, function(o) { return o.acn_id; } ); - if (list.length == 0) return; + if (list.length == 0) { return; } var map_acn = {}; for (var i = 0; i < list.length; i++) { var volume_id = list[i]; - if (volume_id == -1) continue; /* ignore magic pre-cat volume */ + if (volume_id == -1) { + continue; /* ignore magic pre-cat volume */ + } if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE',[ volume_id ]); } } - list = []; for (var v in map_acn) list.push( map_acn[v] ); + list = []; + for (var v in map_acn) { + list.push( map_acn[v] ); + } var confirm_prompt; if (list.length == 1) { @@ -756,7 +780,7 @@ circ.copy_status.prototype = { alert(document.getElementById('circStrings').getString('staff.circ.copy_status.delete_volumes.delete_copies')); return; } - if (robj.ilsevent != 0) throw(robj); + if (robj.ilsevent != 0) { throw(robj); } } alert(document.getElementById('circStrings').getString('staff.circ.copy_status.delete_volumes.success')); } @@ -802,7 +826,10 @@ circ.copy_status.prototype = { if (list.length == 1) { var v = obj.network.simple_request('FM_ACN_RETRIEVE',[list[0]]); - var owning_lib = v.owning_lib(); if (typeof owning_lib == 'object') owning_lib = owning_lib.id(); + var owning_lib = v.owning_lib(); + if (typeof owning_lib == 'object') { + owning_lib = owning_lib.id(); + } obj.data.marked_library = { 'lib' : owning_lib, 'docid' : v.record() }; obj.data.stash('marked_library'); @@ -835,19 +862,24 @@ circ.copy_status.prototype = { JSAN.use('util.functional'); var list = util.functional.map_list( obj.selection_list, function(o) { return o.acn_id; } ); - if (list.length == 0) return; + if (list.length == 0) { return; } var map_acn = {}; for (var i = 0; i < list.length; i++) { var volume_id = list[i]; - if (volume_id == -1) continue; /* ignore magic pre-cat volume */ + if (volume_id == -1) { + continue; /* ignore magic pre-cat volume */ + } if (! map_acn[volume_id]) { map_acn[ volume_id ] = obj.network.simple_request('FM_ACN_RETRIEVE',[ volume_id ]); } } - list = []; for (v in map_acn) list.push(map_acn[v]); + list = []; + for (v in map_acn) { + list.push(map_acn[v]); + } netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite'); var xml = ''; @@ -899,8 +931,8 @@ circ.copy_status.prototype = { 'title' : document.getElementById('circStrings').getString('staff.circ.copy_status.transfer_volume.override_failure'), 'overridable_events' : [ 1208 /* TITLE_LAST_COPY */, - 1219 /* COPY_REMOTE_CIRC_LIB */, - ], + 1219 /* COPY_REMOTE_CIRC_LIB */ + ] } ); @@ -919,7 +951,7 @@ circ.copy_status.prototype = { } } - ], + ] } } ); @@ -956,8 +988,10 @@ circ.copy_status.prototype = { var obj = this; try { try { document.getElementById('last_scanned').setAttribute('value',''); } catch(E) {} - if (!barcode) barcode = obj.controller.view.copy_status_barcode_entry_textbox.value; - if (!barcode) return; + if (!barcode) { + barcode = obj.controller.view.copy_status_barcode_entry_textbox.value; + } + if (!barcode) { return; } if (barcode) { if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; } } @@ -1002,9 +1036,10 @@ circ.copy_status.prototype = { msg += document.getElementById('circStrings').getString('staff.circ.copy_status.status.hold') + ' '; } if (details.transit) { - msg += document.getElementById('circStrings').getString('staff.circ.copy_status.status.transit') + ' '; } + msg += document.getElementById('circStrings').getString('staff.circ.copy_status.status.transit') + ' '; + } if (details.circ && ! details.circ.checkin_time()) { - msg += document.getElementById('circStrings').getString('staff.circ.copy_status.status.circ') + ' '; } + msg += document.getElementById('circStrings').getString('staff.circ.copy_status.status.circ') + ' '; } try { document.getElementById('last_scanned').setAttribute('value',msg); } catch(E) {} if (document.getElementById('trim_list')) { diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.xul b/Open-ILS/xul/staff_client/server/circ/copy_status.xul index bf05ed64b3..59d82377f6 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.xul @@ -1,4 +1,4 @@ - + @@ -12,7 +12,7 @@ + ]> @@ -35,7 +35,9 @@ function my_init() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); } + if (typeof JSAN == 'undefined') { + throw( document.getElementById("commonStrings").getString('common.jsan.missing') ); + } JSAN.errorLevel = "die"; // none, warn, or die JSAN.addRepository('/xul/server/'); JSAN.use('util.error'); g.error = new util.error(); @@ -48,7 +50,11 @@ ); if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { - try { window.xulG.set_tab_name('Item Status'); } catch(E) { alert(E); } + try { + window.xulG.set_tab_name(document.getElementById('circStrings').getString('staff.circ.copy_status.tab_name')); + } catch(E) { + alert(E); + } } JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve(); @@ -78,9 +84,7 @@ } } catch(E) { - var err_msg = "!! This software has encountered an error. Please tell your friendly " + - "system administrator or software developer the following:\n" - + 'circ.copy_status.xul\n' + E + '\n'; + var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['circ.copy_status.xul', E]); try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); } alert(err_msg); } @@ -90,6 +94,8 @@ ]]> + + diff --git a/Open-ILS/xul/staff_client/server/circ/hold_capture.js b/Open-ILS/xul/staff_client/server/circ/hold_capture.js index cc544a0505..3c65993714 100644 --- a/Open-ILS/xul/staff_client/server/circ/hold_capture.js +++ b/Open-ILS/xul/staff_client/server/circ/hold_capture.js @@ -1,4 +1,5 @@ dump('entering circ.hold_capture.js\n'); +// vim:noet:sw=4:ts=4: if (typeof circ == 'undefined') circ = {}; circ.hold_capture = function (params) { @@ -49,7 +50,7 @@ circ.hold_capture.prototype = { ], 'cmd_broken' : [ ['command'], - function() { alert('Not Yet Implemented'); } + function() { alert(document.getElementById('circStrings').getString('staff.circ.unimplemented')); } ], 'cmd_hold_capture_submit_barcode' : [ ['command'], @@ -121,10 +122,12 @@ circ.hold_capture.prototype = { ); try { - alert('To Printer\n' + hold_capture.text + '\r\n' + 'Barcode: ' + barcode + ' Title: ' + hold_capture.record.title() + - ' Author: ' + hold_capture.record.author() + '\r\n' + - 'Route To: ' + hold_capture.route_to + - ' Patron: ' + au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + + alert(document.getElementById('circStrings').getString('staff.circ.hold_capture.print.to_printer') + '\n' + hold_capture.text + '\r\n' + + document.getElementById('circStrings').getString('staff.circ.hold_capture.print.barcode') + ' ' + barcode + + document.getElementById('circStrings').getString('staff.circ.hold_capture.print.title') + ' ' + hold_capture.record.title() + + document.getElementById('circStrings').getString('staff.circ.hold_capture.print.author') + ' ' + hold_capture.record.author() + '\r\n' + + document.getElementById('circStrings').getString('staff.circ.hold_capture.print.route_to') + ' ' + hold_capture.route_to + + document.getElementById('circStrings').getString('staff.circ.hold_capture.print.patron') + ' ' + au_obj.card().barcode() + ' ' + au_obj.family_name() + ', ' + au_obj.first_given_name() + '\r\n'); //FIXME } catch(E) { dump('errors\n'); } /* @@ -140,26 +143,26 @@ circ.hold_capture.prototype = { obj.on_hold_capture(hold_capture); } if (typeof window.xulG == 'object' && typeof window.xulG.on_hold_capture == 'function') { - obj.error.sdump('D_CIRC','circ.hold_capture: Calling external .on_hold_capture()\n'); + obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.hold_capture.calling_external') + '\n'); window.xulG.on_hold_capture(hold_capture); } else { - obj.error.sdump('D_CIRC','circ.hold_capture: No external .on_hold_capture()\n'); + obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.hold_capture.no_external') + '\n'); } } else { - throw("Could not capture hold."); + throw(document.getElementById('circStrings').getString('staff.circ.hold_capture.capture_failed')); } } catch(E) { - alert('FIXME: need special alert and error handling\n' + alert(document.getElementById('circStrings').getString('staff.circ.hold_capture.error') + '\n' + js2JSON(E)); if (typeof obj.on_failure == 'function') { obj.on_failure(E); } if (typeof window.xulG == 'object' && typeof window.xulG.on_failure == 'function') { - obj.error.sdump('D_CIRC','circ.hold_capture: Calling external .on_failure()\n'); + obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.hold_capture.calling_external') + '\n'); window.xulG.on_failure(E); } else { - obj.error.sdump('D_CIRC','circ.hold_capture: No external .on_failure()\n'); + obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.hold_capture.no_external') + '\n'); } } diff --git a/Open-ILS/xul/staff_client/server/circ/hold_capture.xul b/Open-ILS/xul/staff_client/server/circ/hold_capture.xul index 55f7cad4d6..4699977a53 100644 --- a/Open-ILS/xul/staff_client/server/circ/hold_capture.xul +++ b/Open-ILS/xul/staff_client/server/circ/hold_capture.xul @@ -1,4 +1,4 @@ - + @@ -12,7 +12,7 @@ + ]> @@ -35,7 +35,9 @@ function my_init() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); } + if (typeof JSAN == 'undefined') { + throw( document.getElementById("commonStrings").getString('common.jsan.missing') ); + } JSAN.errorLevel = "die"; // none, warn, or die JSAN.addRepository('/xul/server/'); JSAN.use('util.error'); g.error = new util.error(); @@ -52,9 +54,7 @@ } } catch(E) { - var err_msg = "!! This software has encountered an error. Please tell your friendly " + - "system administrator or software developer the following:\n" - + 'circ.hold_capture.xul\n' + E + '\n'; + var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['circ.hold_capture.xul', E]); try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); } alert(err_msg); } @@ -63,6 +63,8 @@ ]]> + + diff --git a/Open-ILS/xul/staff_client/server/circ/hold_capture_overlay.xul b/Open-ILS/xul/staff_client/server/circ/hold_capture_overlay.xul index 91bc0e4286..236e64374a 100644 --- a/Open-ILS/xul/staff_client/server/circ/hold_capture_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/hold_capture_overlay.xul @@ -1,6 +1,6 @@ - + + ]> diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.js b/Open-ILS/xul/staff_client/server/circ/in_house_use.js index 9c2d24e72d..a46ea048c8 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.js +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.js @@ -1,4 +1,5 @@ dump('entering circ.in_house_use.js\n'); +// vim:noet:sw=4:ts=4: if (typeof circ == 'undefined') circ = {}; circ.in_house_use = function (params) { @@ -54,7 +55,7 @@ circ.in_house_use.prototype = { function(e) { return function() { JSAN.use('util.widgets'); JSAN.use('util.functional'); JSAN.use('util.fm_utils'); - var items = [ [ 'Barcode:' , 'barcode' ] ].concat( + var items = [ [ document.getElementById('circStrings').getString('staff.circ.in_house_use.barcode') , 'barcode' ] ].concat( util.functional.map_list( util.functional.filter_list( obj.data.list.cnct, @@ -70,7 +71,7 @@ circ.in_house_use.prototype = { [ b.owning_lib(), b.name() ] ); } catch(E) { - alert('error in noncat sorting: ' + E); + alert(document.getElementById('circStrings').getString('staff.circ.in_house_use.noncat_sort_error') + ' ' + E); return 0; } } @@ -81,7 +82,7 @@ circ.in_house_use.prototype = { } ) ); - g.error.sdump('D_TRACE','items = ' + js2JSON(items)); + g.error.sdump('D_TRACE', document.getElementById('circStrings').getString('staff.circ.in_house_use.items_dump') + js2JSON(items)); util.widgets.remove_children( e ); var ml = util.widgets.make_menulist( items @@ -99,7 +100,7 @@ circ.in_house_use.prototype = { tb.focus(); } else { tb.disabled = true; - tb.value = 'Non-Cataloged'; + tb.value = document.getElementById('circStrings').getString('staff.circ.in_house_use.noncataloged'); } }, false ); @@ -144,7 +145,7 @@ circ.in_house_use.prototype = { ], 'cmd_broken' : [ ['command'], - function() { alert('Not Yet Implemented'); } + function() { alert(document.getElementById('circStrings').getString('staff.circ.unimplemented')); } ], 'cmd_in_house_use_submit_barcode' : [ ['command'], @@ -195,12 +196,12 @@ circ.in_house_use.prototype = { return true; } else { if ( 1 == obj.error.yns_alert( - 'Bad checkdigit; possible mis-scan. Use this barcode ("' + bc + '") anyway?', - 'Bad Barcode', - 'Cancel', - 'Accept Barcode', + document.getElementById('circStrings').getFormattedString('staff.circ.check_digit.bad', [bc]), + document.getElementById('circStrings').getString('staff.circ.barcode.bad'), + document.getElementById('circStrings').getString('staff.circ.cancel'), + document.getElementById('circStrings').getString('staff.circ.barcode.accept'), null, - 'Check here to confirm this action', + document.getElementById('circStrings').getString('staff.circ.confirm'), '/xul/server/skin/media/images/bad_barcode.png' ) ) { return true; @@ -237,7 +238,14 @@ circ.in_house_use.prototype = { } if (multiplier > 20) { - var r = obj.error.yns_alert('Are you sure you want to mark ' + barcode + ' as having been used ' + multiplier + ' times?','In-House Use Verification', 'Yes', 'No', null, 'Check here to confirm this message.'); + var r = obj.error.yns_alert( + document.getElementById('circStrings').getFormattedString('staff.circ.in_house_use.confirm_multiple', [barcode, multiplier]), + document.getElementById('circStrings').getString('staff.circ.in_house_use.confirm_multiple.title'), + document.getElementById('circStrings').getString('staff.circ.in_house_use.yes'), + document.getElementById('circStrings').getString('staff.circ.in_house_use.no'), + null, + document.getElementById('circStrings').getString('staff.circ.confirm.msg') + ); if (r != 0) { obj.controller.view.in_house_use_multiplier_textbox.focus(); obj.controller.view.in_house_use_multiplier_textbox.select(); @@ -252,9 +260,21 @@ circ.in_house_use.prototype = { var copy = obj.network.simple_request('FM_ACP_RETRIEVE_VIA_BARCODE',[ barcode ]); if (copy.ilsevent) { switch(copy.ilsevent) { - case -1 : obj.error.standard_network_error_alert('In House Use Failed. If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface'); break; - case 1502 /* ASSET_COPY_NOT_FOUND */ : obj.error.yns_alert(copy.textcode,'In House Use Failed','Ok',null,null,'Check here to confirm this message'); break; - default: throw(copy); + case -1 : + obj.error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.in_house_use.failed.verbose')); + break; + case 1502 /* ASSET_COPY_NOT_FOUND */ : + obj.error.yns_alert( + copy.textcode, + document.getElementById('circStrings').getString('staff.circ.in_house_use.failed'), + document.getElementById('circStrings').getString('staff.circ.in_house_use.ok'), + null, + null, + document.getElementById('circStrings').getString('staff.circ.confirm.msg') + ); + break; + default: + throw(copy); } return; } @@ -294,22 +314,22 @@ circ.in_house_use.prototype = { obj.on_in_house_use(result); } if (typeof window.xulG == 'object' && typeof window.xulG.on_in_house_use == 'function') { - obj.error.sdump('D_CIRC','circ.in_house_use: Calling external .on_in_house_use()\n'); + obj.error.sdump('D_CIRC', + document.getElementById('circStrings').getString('staff.circ.in_house_use.external') + '\n'); window.xulG.on_in_house_use(result); } else { - obj.error.sdump('D_CIRC','circ.in_house_use: No external .on_in_house_use()\n'); + obj.error.sdump('D_CIRC', + document.getElementById('circStrings').getString('staff.circ.in_house_use.no_external') + '\n'); } } catch(E) { - obj.error.standard_unexpected_error_alert('In House Use Failed',E); + obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.in_house_use.failed'), E); if (typeof obj.on_failure == 'function') { obj.on_failure(E); } if (typeof window.xulG == 'object' && typeof window.xulG.on_failure == 'function') { - obj.error.sdump('D_CIRC','circ.in_house_use: Calling external .on_failure()\n'); + obj.error.sdump('D_CIRC', + document.getElementById('circStrings').getString('staff.circ.in_house_use.on_failure.external') + '\n'); window.xulG.on_failure(E); } else { - obj.error.sdump('D_CIRC','circ.in_house_use: No external .on_failure()\n'); + obj.error.sdump('D_CIRC', + document.getElementById('circStrings').getString('staff.circ.in_house_use.on_failure.external') + '\n'); } } diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.xul b/Open-ILS/xul/staff_client/server/circ/in_house_use.xul index db11262d6b..4b376cdbeb 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.xul +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.xul @@ -1,4 +1,4 @@ - + @@ -12,7 +12,7 @@ + ]> @@ -34,7 +34,9 @@ function my_init() { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); } + if (typeof JSAN == 'undefined') { + throw( document.getElementById("commonStrings").getString('common.jsan.missing') ); + } JSAN.errorLevel = "die"; // none, warn, or die JSAN.addRepository('/xul/server/'); JSAN.use('util.error'); g.error = new util.error(); @@ -47,13 +49,15 @@ ); if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') { - try { window.xulG.set_tab_name('In-House Use'); } catch(E) { alert(E); } + try { + window.xulG.set_tab_name(document.getElementById('circStrings').getString('staff.circ.in_house_use.tab_name')); + } catch(E) { + alert(E); + } } } catch(E) { - var err_msg = "!! This software has encountered an error. Please tell your friendly " + - "system administrator or software developer the following:\n" - + 'circ.in_house_use.xul\n' + E + '\n'; + var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['circ.in_house_use.xul', E]); try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); } alert(err_msg); } @@ -63,6 +67,8 @@ ]]> + + @@ -77,40 +83,40 @@ - - + -