obj.controller.view.cmd_holds_edit_email_notify.setAttribute('disabled','false');
obj.controller.view.cmd_holds_edit_selection_depth.setAttribute('disabled','false');
obj.controller.view.cmd_holds_edit_expire_time.setAttribute('disabled','false');
+ obj.controller.view.cmd_holds_edit_shelf_expire_time.setAttribute('disabled','false');
obj.controller.view.cmd_holds_edit_thaw_date.setAttribute('disabled','false');
obj.controller.view.cmd_holds_activate.setAttribute('disabled','false');
obj.controller.view.cmd_holds_suspend.setAttribute('disabled','false');
obj.controller.view.cmd_holds_edit_email_notify.setAttribute('disabled','true');
obj.controller.view.cmd_holds_edit_selection_depth.setAttribute('disabled','true');
obj.controller.view.cmd_holds_edit_expire_time.setAttribute('disabled','true');
+ obj.controller.view.cmd_holds_edit_shelf_expire_time.setAttribute('disabled','true');
obj.controller.view.cmd_holds_edit_thaw_date.setAttribute('disabled','true');
obj.controller.view.cmd_holds_activate.setAttribute('disabled','true');
obj.controller.view.cmd_holds_suspend.setAttribute('disabled','true');
}
}
],
+ 'cmd_holds_edit_shelf_expire_time' : [
+ ['command'],
+ function() {
+ try {
+ JSAN.use('util.date');
+ function check_date(value) {
+ try {
+ if (! util.date.check('YYYY-MM-DD',value) ) { throw(document.getElementById('circStrings').getString('staff.circ.holds.shelf_expire_time.invalid_date')); }
+ return true;
+ } catch(E) {
+ alert(E);
+ return false;
+ }
+ }
-
+ var hold_list = util.functional.map_list(obj.retrieve_ids, function(o){return o.id;});
+ var msg_singular = document.getElementById('circStrings').getFormattedString('staff.circ.holds.shelf_expire_time.prompt',[hold_list.join(', ')]);
+ var msg_plural = document.getElementById('circStrings').getFormattedString('staff.circ.holds.shelf_expire_time.prompt',[hold_list.join(', ')]);
+ var msg = obj.retrieve_ids.length > 1 ? msg_plural : msg_singular;
+ var value = 'YYYY-MM-DD';
+ var title = document.getElementById('circStrings').getString('staff.circ.holds.modifying_holds');
+ var shelf_expire_time; var invalid = true;
+ while(invalid) {
+ shelf_expire_time = window.prompt(msg,value,title);
+ if (shelf_expire_time) {
+ invalid = ! check_date(shelf_expire_time);
+ } else {
+ invalid = false;
+ }
+ }
+ if (shelf_expire_time || shelf_expire_time == '') {
+ circ.util.batch_hold_update(
+ hold_list,
+ { 'shelf_expire_time' : shelf_expire_time == '' ? null : util.date.formatted_date(shelf_expire_time + ' 00:00:00','%{iso8601}') },
+ { 'progressmeter' : progressmeter, 'oncomplete' : function() { obj.clear_and_retrieve(true); } }
+ );
+ }
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.holds.unexpected_error.not_likely_modified'),E);
+ }
+ }
+ ],
'cmd_holds_retarget' : [
['command'],
<command id="cmd_holds_edit_email_notify" />
<command id="cmd_holds_edit_thaw_date" />
<command id="cmd_holds_edit_expire_time" />
+ <command id="cmd_holds_edit_shelf_expire_time" />
<command id="cmd_holds_activate" />
<command id="cmd_holds_suspend" />
<command id="cmd_holds_cut_in_line" />
<menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>
<menuitem label="&staff.circ.holds.set_email_notification;" command="cmd_holds_edit_email_notify" accesskey="&staff.circ.holds.set_email_notification.accesskey;"/>
<menuitem label="&staff.circ.holds.edit_expire_time;" command="cmd_holds_edit_expire_time" accesskey="&staff.circ.holds.edit_expire_time.accesskey;"/>
+ <menuitem label="&staff.circ.holds.edit_shelf_expire_time;" command="cmd_holds_edit_shelf_expire_time" accesskey="&staff.circ.holds.edit_shelf_expire_time.accesskey;"/>
<menuitem label="&staff.circ.holds.edit_activation_date;" command="cmd_holds_edit_thaw_date" accesskey="&staff.circ.holds.edit_activation_date.accesskey;"/>
<menuitem label="&staff.circ.holds.activate_hold;" command="cmd_holds_activate" accesskey="&staff.circ.holds.activate_hold.accesskey;"/>
<menuitem label="&staff.circ.holds.suspend_hold;" command="cmd_holds_suspend" accesskey="&staff.circ.holds.suspend_hold.accesskey;"/>
<menuitem label="&staff.circ.holds.edit_phone_notification;" command="cmd_holds_edit_phone_notify" accesskey="&staff.circ.holds.edit_phone_notification.accesskey;"/>
<menuitem label="&staff.circ.holds.set_email_notification;" command="cmd_holds_edit_email_notify" accesskey="&staff.circ.holds.set_email_notification.accesskey;"/>
<menuitem label="&staff.circ.holds.edit_expire_time;" command="cmd_holds_edit_expire_time" accesskey="&staff.circ.holds.edit_expire_time.accesskey;"/>
+ <menuitem label="&staff.circ.holds.edit_shelf_expire_time;" command="cmd_holds_edit_shelf_expire_time" accesskey="&staff.circ.holds.edit_shelf_expire_time.accesskey;"/>
<menuitem label="&staff.circ.holds.edit_activation_date;" command="cmd_holds_edit_thaw_date" accesskey="&staff.circ.holds.edit_activation_date.accesskey;"/>
<menuitem label="&staff.circ.holds.activate_hold;" command="cmd_holds_activate" accesskey="&staff.circ.holds.activate_hold.accesskey;"/>
<menuitem label="&staff.circ.holds.suspend_hold;" command="cmd_holds_suspend" accesskey="&staff.circ.holds.suspend_hold.accesskey;"/>