if (circs.length > 0) {
patrons[circs[0].usr()] = 1;
} else {
- alert('Item ' + obj.selection_list[i].barcode + ' has never circulated');
+ alert(document.getElementById('circStrings').getFormattedString('staff.circ.item_no_circs', [obj.selection_list[i].barcode]));
}
}
for (var i in patrons) {
throw('invalid date format');
}
var d = new Date( year, month - 1, day );
- if (d.toString() == 'Invalid Date') throw('Invalid Date');
- if ( d > new Date() ) throw('Future Date');
+ if (d.toString() == 'Invalid Date') throw(document.getElementById('circStrings').getString('staff.circ.invalid_date'));
+ if ( d > new Date() ) throw(document.getElementById('circStrings').getString('staff.circ.future_date'));
ev.target.value = util.date.formatted_date(d,'%F');
var x = document.getElementById('background');
if (x) {
if ( ev.target.value == util.date.formatted_date(new Date(),'%F') ) {
x.setAttribute('style','background-color: green');
- document.getElementById('background-text').setAttribute('value','Check In / Process Item');
+ document.getElementById('background-text').setAttribute('value',document.getElementById('circStrings').getString('staff.circ.process_item'));
} else {
x.setAttribute('style','background-color: red');
- document.getElementById('background-text').setAttribute('value','Backdated ' + ev.target.value + ' Check In');
+ document.getElementById('background-text').setAttribute('value',document.getElementById('circStrings').getFormattedString('staff.circ.backdated_checkin', [ev.target.value]));
}
}
} catch(E) {
dump('checkin:effective_date: ' + E + '\n');
- alert('Problem setting backdate: ' + E);
+ alert(document.getElementById('circStrings').getFormattedString('staff.circ.backdate.exception', [E]));
ev.target.value = util.date.formatted_date(new Date(),'%F');
}
}
],
'cmd_broken' : [
['command'],
- function() { alert('Not Yet Implemented'); }
+ function() { alert(document.getElementById('circStrings').getString('staff.circ.unimplemented')); }
],
'cmd_checkin_submit_barcode' : [
['command'],
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;
}
);
} catch(E) {
- obj.error.standard_unexpected_error_alert('Something went wrong in circ.util.checkin: ',E);
+ obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.exception', [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.util.checkin: Calling external .on_failure()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.util.checkin.exception.external') + '\n');
window.xulG.on_failure(E);
} else {
- obj.error.sdump('D_CIRC','circ.util.checkin: No external .on_failure()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.util.checkin.exception.no_external') + '\n');
}
}
obj.on_checkin(checkin);
}
if (typeof window.xulG == 'object' && typeof window.xulG.on_checkin == 'function') {
- obj.error.sdump('D_CIRC','circ.checkin: Calling external .on_checkin()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.checkin.exception.external') + '\n');
window.xulG.on_checkin(checkin);
} else {
- obj.error.sdump('D_CIRC','circ.checkin: No external .on_checkin()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.checkin.exception.no_external') + '\n');
}
return true;
} catch(E) {
- obj.error.standard_unexpected_error_alert('Something went wrong in circ.util.checkin2: ',E);
+ obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin2.exception', [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.util.checkin2: Calling external .on_failure()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.checkin2.exception.external') + '\n');
window.xulG.on_failure(E);
} else {
- obj.error.sdump('D_CIRC','circ.util.checkin2: No external .on_failure()\n');
+ obj.error.sdump('D_CIRC', document.getElementById('circStrings').getString('staff.circ.checkin2.exception.no_external') + '\n');
}
}
--- /dev/null
+staff.circ.item_no_circs=Item %1$s has never circulated.
+staff.circ.invalid_date=Invalid Date
+staff.circ.future_date=Future Date
+staff.circ.process_item=Check In / Process Item
+staff.circ.backdated_checkin=Backdated %1$s Check In
+staff.circ.backdate.exception=Problem setting backdate: %1$s
+staff.circ.unimplemented=Not Yet Implemented
+staff.circ.check_digit.bad=Bad check digit; possible mis-scan. Use this barcode ("%1$s") anyway?
+staff.circ.barcode.bad=Bad Barcode
+staff.circ.cancel=Cancel
+staff.circ.barcode.accept=Accept Barcode
+staff.circ.confirm=Check here to confirm this action
+# If we know the name of the object, we could parameterize that as well
+staff.circ.checkin.exception=Something went wrong in circ.util.checkin: %1$s
+staff.circ.checkin2.exception=Something went wrong in circ.util.checkin2: %1$s
+staff.circ.checkin.exception.external=circ.checkin: Calling external .on_checkin()
+staff.circ.checkin2.exception.external=circ.checkin2: Calling external .on_checkin()
+staff.circ.checkin.exception.no_external=circ.checkin: Calling external .on_checkin()
+staff.circ.checkin2.exception.checkin2: circ.util.checkin2: No external .on_failure()
+staff.circ.util.checkin.exception.external=circ.util.checkin: Calling external .on_checkin()
+staff.circ.util.checkin.exception.no_external=circ.util.checkin: Calling external .on_checkin()