[open-ils-commits] r9221 - in
trunk/Open-ILS/xul/staff_client/server: locale/en-US patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 4 01:34:31 EDT 2008
Author: phasefx
Date: 2008-04-04 00:57:59 -0400 (Fri, 04 Apr 2008)
New Revision: 9221
Modified:
trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
Log:
more i18n, prevent hold activation date from being set to Today, and auto-suspend holds when activation date is set
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties 2008-04-04 04:44:47 UTC (rev 9220)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties 2008-04-04 04:57:59 UTC (rev 9221)
@@ -318,6 +318,10 @@
staff.circ.holds.activate.prompt.plural=Are you sure you would like to activate holds %1$s?
staff.circ.holds.suspend.prompt=Are you sure you would like to suspend hold %1$s?
staff.circ.holds.suspend.prompt.plural=Are you sure you would like to suspend holds %1$s?
+staff.circ.holds.activation_date.prompt=Please enter an Activation Date (or leave blank to unset) for hold %1$s. This will also Suspend the hold.
+staff.circ.holds.activation_date.prompt.plural=Please enter an Activation Date (or leave blank to unset) for holds %1$s. This will also Suspend the holds.
+staff.circ.holds.activation_date.too_early.error=Activation Date needs to be either unset or set to fall on a future date.
+staff.circ.holds.activation_date.invalid_date=Invalid Date
staff.circ.holds.modifying_holds=Modifying Holds
staff.circ.holds.modifying_holds.yes=Yes
staff.circ.holds.modifying_holds.no=No
@@ -328,4 +332,3 @@
staff.circ.holds.unexpected_error.not_likely_modified=Holds not likely modified.
staff.circ.holds.unexpected_error.not_likely_activated=Holds not likely activated.
staff.circ.holds.unexpected_error.not_likely_suspended=Holds not likely suspended.
-
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-04-04 04:44:47 UTC (rev 9220)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-04-04 04:57:59 UTC (rev 9221)
@@ -544,9 +544,9 @@
JSAN.use('util.date');
function check_date(value) {
try {
- if (! util.date.check('YYYY-MM-DD',value) ) { throw('Invalid Date'); }
- if (util.date.check_past('YYYY-MM-DD',value) ) {
- throw('Thaw date for frozen holds needs to be after today.');
+ if (! util.date.check('YYYY-MM-DD',value) ) { throw(document.getElementById('circStrings').getString('staff.circ.holds.activation_date.invalid_date')); }
+ if (util.date.check_past('YYYY-MM-DD',value) || util.date.formatted_date(new Date(),'%F') == value ) {
+ throw(document.getElementById('circStrings').getString('staff.circ.holds.activation_date.too_early.error'));
}
return true;
} catch(E) {
@@ -555,9 +555,12 @@
}
}
- var msg = 'Please enter a thaw date for hold' + ( obj.retrieve_ids.length > 1 ? 's ' : ' ') + util.functional.map_list( obj.retrieve_ids, function(o){return o.id;}).join(', ') + '\nOr set to blank to unset the thaw date for these holds. Frozen holds without a thaw date will remain frozen until manually unfrozen, otherwise they unfreeze on the thaw date.';
+ var hold_ids = util.functional.map_list( obj.retrieve_ids, function(o){return o.id;}).join(', ');
+ var msg_singular = document.getElementById('circStrings').getFormattedString('staff.circ.holds.activation_date.prompt',[hold_ids]);
+ var msg_plural = document.getElementById('circStrings').getFormattedString('staff.circ.holds.activation_date.prompt',[hold_ids]);
+ var msg = obj.retrieve_ids.length > 1 ? msg_plural : msg_singular;
var value = 'YYYY-MM-DD';
- var title = 'Modifying Holds';
+ var title = document.getElementById('circStrings').getString('staff.circ.holds.modifying_holds');
var thaw_date; var invalid = true;
while(invalid) {
thaw_date = window.prompt(msg,value,title);
@@ -570,6 +573,7 @@
if (thaw_date || thaw_date == '') {
for (var i = 0; i < obj.retrieve_ids.length; i++) {
var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ hold.frozen('t');
hold.thaw_date( thaw_date == '' ? null : util.date.formatted_date(thaw_date + ' 00:00:00','%{iso8601}') ); hold.ischanged('1');
hold = obj.flatten_copy(hold);
var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
@@ -578,7 +582,7 @@
obj.clear_and_retrieve(true);
}
} catch(E) {
- obj.error.standard_unexpected_error_alert('Holds not likely modified.',E);
+ obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.holds.unexpected_error.not_likely_modified'),E);
}
}
],
More information about the open-ils-commits
mailing list