[open-ils-commits] r14768 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/locale/en-US xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Nov 4 14:32:32 EST 2009


Author: phasefx
Date: 2009-11-04 14:32:28 -0500 (Wed, 04 Nov 2009)
New Revision: 14768

Modified:
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
   trunk/Open-ILS/xul/staff_client/server/patron/holds.js
   trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
Log:
gui for Edit Shelf Expire Time for holds

Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2009-11-04 19:07:15 UTC (rev 14767)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2009-11-04 19:32:28 UTC (rev 14768)
@@ -2043,6 +2043,8 @@
 <!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.edit_shelf_expire_time "Edit Shelf Expire Time">
+<!ENTITY staff.circ.holds.edit_shelf_expire_time.accesskey "X">
 <!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/locale/en-US/circ.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-11-04 19:07:15 UTC (rev 14767)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/circ.properties	2009-11-04 19:32:28 UTC (rev 14768)
@@ -389,6 +389,10 @@
 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.shelf_expire_time.prompt=Please enter a Shelf Expiration Date (or leave blank to unset) for hold %1$s.
+staff.circ.holds.shelf_expire_time.prompt.plural=Please enter a Shelf Expiration Date (or leave blank to unset) for holds %1$s.
+staff.circ.holds.shelf_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/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-11-04 19:07:15 UTC (rev 14767)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js	2009-11-04 19:32:28 UTC (rev 14768)
@@ -141,6 +141,7 @@
                         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');
@@ -161,6 +162,7 @@
                         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');
@@ -831,9 +833,49 @@
                             }
                         }
                     ],
+                    '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'],
                         function() {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-11-04 19:07:15 UTC (rev 14767)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul	2009-11-04 19:32:28 UTC (rev 14768)
@@ -26,6 +26,7 @@
         <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" />
@@ -55,6 +56,7 @@
             <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;"/>
@@ -130,6 +132,7 @@
                     <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;"/>



More information about the open-ils-commits mailing list