Edit Request Date action for more hold queue juggling
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 11 Dec 2009 20:38:32 +0000 (20:38 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 11 Dec 2009 20:38:32 +0000 (20:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15148 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/holds_overlay.xul

index e45233b..895a83e 100644 (file)
 <!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_request_date "Edit Request Date">
+<!ENTITY staff.circ.holds.edit_request_date.accesskey "q">
 <!ENTITY staff.circ.holds.edit_expire_time "Edit Expiration Date">
 <!ENTITY staff.circ.holds.edit_expire_time.accesskey "E">
 <!ENTITY staff.circ.holds.edit_shelf_expire_time "Edit Shelf Expire Time">
index b42964f..70e80bf 100644 (file)
@@ -385,6 +385,10 @@ staff.circ.holds.activation_date.prompt=Please enter an Activation Date (or leav
 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.request_date.prompt=Please enter a new Request Date for hold %1$s.
+staff.circ.holds.request_date.prompt.plural=Please enter a new Request Date for holds %1$s.
+staff.circ.holds.request_date.dialog.description=Request Date
+staff.circ.holds.request_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.
index c6fa875..6cc7f0a 100644 (file)
@@ -143,6 +143,7 @@ patron.holds.prototype = {
                         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_edit_request_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_alt_view.setAttribute('disabled','false');
@@ -164,6 +165,7 @@ patron.holds.prototype = {
                         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_edit_request_date.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_activate.setAttribute('disabled','true');
                         obj.controller.view.cmd_holds_suspend.setAttribute('disabled','true');
                         obj.controller.view.cmd_alt_view.setAttribute('disabled','true');
@@ -872,7 +874,42 @@ patron.holds.prototype = {
                             }
                         }
                     ],
+                    'cmd_holds_edit_request_date' : [
+                        ['command'],
+                        function() {
+                            try {
+                                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.request_date.prompt',[hold_list.join(', ')]);
+                                var msg_plural = document.getElementById('circStrings').getFormattedString('staff.circ.holds.request_date.prompt.plural',[hold_list.join(', ')]);
+                                var msg = obj.retrieve_ids.length > 1 ? msg_plural : msg_singular;
+                                var title = document.getElementById('circStrings').getString('staff.circ.holds.modifying_holds');
+                                var desc = document.getElementById('circStrings').getString('staff.circ.holds.request_date.dialog.description');
 
+                                JSAN.use('util.window'); var win = new util.window();
+                                var my_xulG = win.open( 
+                                    urls.XUL_TIMESTAMP_DIALOG, 'edit_request_date', 'chrome,resizable,modal', 
+                                    { 
+                                        'title' : title, 
+                                        'description' : desc, 
+                                        'msg' : msg, 
+                                        'allow_unset' : false,
+                                        'disallow_future_dates' : true,
+                                        'disallow_past_dates' : false,
+                                        'disallow_today' : false
+                                    }
+                                );
+                                if (my_xulG.complete) {
+                                    circ.util.batch_hold_update(
+                                        hold_list, 
+                                        { 'request_time' : my_xulG.timestamp }, 
+                                        { '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'],
                         function() {
index 7f17564..7ab83a6 100644 (file)
@@ -25,6 +25,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_request_date" />
         <command id="cmd_holds_edit_expire_time" />
         <command id="cmd_holds_edit_shelf_expire_time" />
         <command id="cmd_holds_activate" />
@@ -58,6 +59,7 @@
             <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.edit_request_date;" command="cmd_holds_edit_request_date" accesskey="&staff.circ.holds.edit_request_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;"/>
                     <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.edit_request_date;" command="cmd_holds_edit_request_date" accesskey="&staff.circ.holds.edit_request_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;"/>