[open-ils-commits] r10687 - in trunk/Open-ILS:
web/opac/locale/en-US xul/staff_client/server/circ
xul/staff_client/server/locale/en-US xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Sep 22 16:52:27 EDT 2008
Author: phasefx
Date: 2008-09-22 16:52:22 -0400 (Mon, 22 Sep 2008)
New Revision: 10687
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/server/circ/util.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
trunk/Open-ILS/xul/staff_client/server/patron/holds.xul
trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
staff function for editing expiration date for arbitrary holds in various hold interfaces
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2008-09-22 20:52:22 UTC (rev 10687)
@@ -1723,6 +1723,8 @@
<!ENTITY staff.circ.holds.set_email_notification.accesskey "E">
<!ENTITY staff.circ.holds.edit_activation_date "Edit Activation Date">
<!ENTITY staff.circ.holds.edit_activation_date.accesskey "D">
+<!ENTITY staff.circ.holds.edit_expire_time "Edit Expiration Date">
+<!ENTITY staff.circ.holds.edit_expire_time.accesskey "E">
<!ENTITY staff.circ.holds.activate_hold "Activate Hold">
<!ENTITY staff.circ.holds.activate_hold.accesskey "A">
<!ENTITY staff.circ.holds.suspend_hold "Suspend Hold">
Modified: trunk/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/util.js 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/circ/util.js 2008-09-22 20:52:22 UTC (rev 10687)
@@ -1521,6 +1521,15 @@
},
{
'persist' : 'hidden width ordinal',
+ 'id' : 'expire_date',
+ 'label' : document.getElementById('commonStrings').getString('staff.ahr_expire_date_label'),
+ 'flex' : 1,
+ 'primary' : false,
+ 'hidden' : true,
+ 'render' : function(my) { return my.ahr.expire_time() ? my.ahr.expire_time().toString().substr(0,10) : ''; }
+ },
+ {
+ 'persist' : 'hidden width ordinal',
'id' : 'fulfillment_time',
'label' : document.getElementById('commonStrings').getString('staff.ahr_fulfillment_time_label'),
'flex' : 1,
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-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties 2008-09-22 20:52:22 UTC (rev 10687)
@@ -322,6 +322,11 @@
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.expire_time.prompt=Please enter an Expiration Date (or leave blank to unset) for hold %1$s.
+staff.circ.holds.expire_time.prompt.plural=Please enter an Expiration Date (or leave blank to unset) for holds %1$s.
+staff.circ.holds.expire_time.too_early.error=Expiration Date needs to be either unset or set to fall on a future date.
+staff.circ.holds.expire_time.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
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2008-09-22 20:52:22 UTC (rev 10687)
@@ -43,6 +43,7 @@
staff.ahr_current_copy_location_label=Current Copy Location
staff.ahr_email_notify_label=Email Notify
staff.ahr_expire_time_label=Expire Time
+staff.ahr_expire_date_label=Expire Date
staff.ahr_fulfillment_time_label=Fulfillment Time
staff.ahr_hold_type_label=Type
staff.ahr_holdable_formats_label=Holdable Formats
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-09-22 20:52:22 UTC (rev 10687)
@@ -128,6 +128,7 @@
obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','false');
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_thaw_date.setAttribute('disabled','false');
obj.controller.view.cmd_holds_activate.setAttribute('disabled','false');
obj.controller.view.cmd_holds_suspend.setAttribute('disabled','false');
@@ -145,6 +146,7 @@
obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','true');
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_thaw_date.setAttribute('disabled','true');
obj.controller.view.cmd_holds_activate.setAttribute('disabled','true');
obj.controller.view.cmd_holds_suspend.setAttribute('disabled','true');
@@ -662,7 +664,57 @@
}
}
],
+ 'cmd_holds_edit_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.expire_time.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.expire_time.too_early.error'));
+ }
+ return true;
+ } catch(E) {
+ alert(E);
+ return false;
+ }
+ }
+ 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.expire_time.prompt',[hold_ids]);
+ var msg_plural = document.getElementById('circStrings').getFormattedString('staff.circ.holds.expire_time.prompt',[hold_ids]);
+ 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 expire_time; var invalid = true;
+ while(invalid) {
+ expire_time = window.prompt(msg,value,title);
+ if (expire_time) {
+ invalid = ! check_date(expire_time);
+ } else {
+ invalid = false;
+ }
+ }
+ if (expire_time || expire_time == '') {
+ for (var i = 0; i < obj.retrieve_ids.length; i++) {
+ var hold = obj.holds_map[ obj.retrieve_ids[i].id ];
+ hold.expire_time( expire_time == '' ? null : util.date.formatted_date(expire_time + ' 00:00:00','%{iso8601}') ); hold.ischanged('1');
+ hold = obj.flatten_copy(hold);
+ var robj = obj.network.simple_request('FM_AHR_UPDATE',[ ses(), hold ]);
+ if (typeof robj.ilsevent != 'undefined') throw(robj);
+ }
+ 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'],
function() {
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.xul 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.xul 2008-09-22 20:52:22 UTC (rev 10687)
@@ -90,6 +90,7 @@
<command id="cmd_holds_edit_phone_notify" />
<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_activate" />
<command id="cmd_holds_suspend" />
<command id="cmd_holds_edit_selection_depth" />
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2008-09-22 20:40:38 UTC (rev 10686)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul 2008-09-22 20:52:22 UTC (rev 10687)
@@ -22,7 +22,8 @@
<menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.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_activation_date;" command="cmd_holds_edit_thaw_date" accesskey="&staff.circ.holds.edit_activation_date;"/>
+ <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_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_hold_range;" class="edit_hold_range" command="cmd_holds_edit_selection_depth" accesskey="&staff.circ.holds.edit_hold_range.accesskey;"/>
@@ -84,7 +85,8 @@
<menuitem label="&staff.circ.holds.edit_pickup_library;" command="cmd_holds_edit_pickup_lib" accesskey="&staff.circ.holds.edit_pickup_library.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_activation_date;" command="cmd_holds_edit_thaw_date" accesskey="&staff.circ.holds.edit_activation_date;"/>
+ <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_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_hold_range;" class="edit_hold_range" command="cmd_holds_edit_selection_depth" accesskey="&staff.circ.holds.edit_hold_range.accesskey;"/>
More information about the open-ils-commits
mailing list