menu entry Circulation->Clear Shelf-Expired Holds
authorJason Etheridge <jason@esilibrary.com>
Tue, 10 Apr 2012 19:35:31 +0000 (15:35 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 25 May 2012 17:16:11 +0000 (13:16 -0400)
This spawns the Browse Hold Shelf interface but automatically triggers the View
Shelf-Expired Holds and Clear these Holds options.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_overlay.xul
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/holds.xul

index 8839740..8180820 100644 (file)
 <!ENTITY staff.main.menu.circ.found.label "Mark Found">
 <!ENTITY staff.main.menu.circ.hold_browse.accesskey "B">
 <!ENTITY staff.main.menu.circ.hold_browse.label "Browse Holds Shelf">
+<!ENTITY staff.main.menu.circ.hold_clear.accesskey "">
+<!ENTITY staff.main.menu.circ.hold_clear.label "Clear Shelf-Expired Holds">
 <!ENTITY staff.main.menu.circ.hold_capture.accesskey "H">
 <!ENTITY staff.main.menu.circ.hold_capture.label "Capture Holds">
 <!ENTITY staff.main.menu.circ.hold_pull.accesskey "S">
index 86e08e1..f3c0222 100644 (file)
@@ -567,6 +567,23 @@ main.menu.prototype = {
                     obj.command_tab(event,obj.url_prefix(urls.XUL_HOLDS_BROWSER)+'?shelf=1',{ 'tab_name' : offlineStrings.getString('menu.cmd_browse_holds_shelf.tab') },{});
                 }
             ],
+            'cmd_clear_holds_shelf' : [
+                ['oncommand'],
+                function(event) {
+                    obj.data.stash_retrieve();
+                    obj.command_tab(
+                        event,
+                        obj.url_prefix(urls.XUL_HOLDS_BROWSER),
+                        {
+                            'tab_name' : offlineStrings.getString('menu.cmd_browse_holds_shelf.tab')
+                        },
+                        {
+                            'shelf':1,
+                            'clear':true
+                        }
+                    );
+                }
+            ],
             'cmd_circ_hold_pull_list' : [
                 ['oncommand'],
                 function(event) { 
index 5316bbf..836d2b3 100644 (file)
@@ -32,6 +32,7 @@
     <command id="cmd_circ_hold_pull_list" />
     <command id="cmd_browse_holds" />
     <command id="cmd_browse_holds_shelf" />
+    <command id="cmd_clear_holds_shelf" />
     <command id="cmd_in_house_use" />
     <command id="cmd_scan_item_as_missing_pieces" />
     <command id="cmd_copy_status" />
         <menuitem label="&staff.main.menu.circ.hold_capture.label;" accesskey="&staff.main.menu.circ.hold_capture.accesskey;" command="cmd_circ_hold_capture"/>
         <menuitem label="&staff.main.menu.circ.hold_pull.label;" accesskey="&staff.main.menu.circ.hold_pull.accesskey;" command="cmd_circ_hold_pull_list"/>
         <menuitem label="&staff.main.menu.circ.hold_browse.label;" command="cmd_browse_holds_shelf" accesskey="&staff.main.menu.circ.hold_browse.accesskey;"/>
+        <menuitem label="&staff.main.menu.circ.hold_clear.label;" command="cmd_clear_holds_shelf" accesskey="&staff.main.menu.circ.hold_clear.accesskey;"/>
         <menuitem label="&staff.main.menu.circ.place_hold.label;" accesskey="&staff.main.menu.circ.place_hold.accesskey;" command="cmd_search_opac"/>
         <menuseparator />
         <menuitem label="&staff.main.menu.circ.barcode.show_item;" accesskey="&staff.main.menu.circ.barcode.show_item.accesskey;" command="cmd_copy_status"/>
index 921fdfa..9588022 100644 (file)
         command="cmd_browse_holds_shelf"
         templateid="browse_holds_shelf" />
     <toolbarbutton
+        label="&staff.main.menu.circ.hold_clear.label;"
+        tooltiptext="&staff.main.menu.circ.hold_clear.label;"
+        command="cmd_clear_holds_shelf"
+        templateid="clear_holds_shelf" />
+    <toolbarbutton
         label="&staff.main.menu.circ.patron_retrieve.label;"
         tooltiptext="&staff.main.menu.circ.patron_retrieve.label;"
         command="cmd_retrieve_last_patron"
index bf4bdad..cad4e88 100644 (file)
@@ -1570,7 +1570,15 @@ patron.holds.prototype = {
                     if (obj.controller.view.lib_menu) obj.controller.view.lib_menu.disabled = true;
                 }
                 obj.controller.render();
-                obj.retrieve(true);
+                if (params['clear']) {
+                    JSAN.use('util.widgets');
+                    var x = document.getElementById('expired_checkbox');
+                    x.checked = true;
+                    obj.expired = true;
+                    util.widgets.dispatch('command','cmd_clear_expired_onshelf_holds');
+                } else {
+                    obj.retrieve(true);
+                }
 
                 obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','true');
                 obj.controller.view.cmd_holds_edit_pickup_lib.setAttribute('disabled','true');
index 50f5b15..7954004 100644 (file)
@@ -52,6 +52,7 @@
                         'docid' : xul_param('docid'),
                         'shelf' : xul_param('shelf'),
                         'pull' : xul_param('pull'),
+                        'clear' : xul_param('clear')
                     } 
                 );
                 window.refresh = function(p) { g.holds.list.clear(); g.holds.retrieve(p); }