select all for trees, and renew all for items out
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 18:18:10 +0000 (18:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 18:18:10 +0000 (18:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5251 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/list.js
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/items.xul
Open-ILS/xul/staff_client/server/patron/items_overlay.xul

index 0154aa8..1607429 100644 (file)
@@ -577,6 +577,19 @@ util.list.prototype = {
                this.error.sdump('D_LIST',s);
        },
 
+       'select_all' : function(params) {
+               var obj = this;
+               switch(this.node.nodeName) {
+                       case 'tree' : return this._select_all_from_tree(params); break;
+                       default: throw('NYI: Need ._select_all_from_() for ' + this.node.nodeName); break;
+               }
+       },
+
+       '_select_all_from_tree' : function(params) {
+               var obj = this;
+               this.node.view.selection.selectAll();
+       },
+
        'retrieve_selection' : function(params) {
                var obj = this;
                switch(this.node.nodeName) {
index be3d9d6..b62fcb4 100644 (file)
@@ -26,6 +26,7 @@ patron.items.prototype = {
                                        'cmd_items_print' : [ ['command'], function() { obj.items_print(1); } ],
                                        'cmd_items_print2' : [ ['command'], function() { obj.items_print(2); } ],
                                        'cmd_items_renew' : [ ['command'], function() { obj.items_renew(1); } ],
+                                       'cmd_items_renew_all' : [ ['command'], function() { obj.items_renew_all(); } ],
                                        'cmd_items_renew2' : [ ['command'], function() { obj.items_renew(2); } ],
                                        'cmd_items_edit' : [ ['command'], function() { obj.items_edit(1); } ],
                                        'cmd_items_edit2' : [ ['command'], function() { obj.items_edit(2); } ],
@@ -92,6 +93,15 @@ patron.items.prototype = {
                }
        },
 
+       'items_renew_all' : function() {
+               try {
+                       this.list.select_all();
+                       this.items_renew(1);    
+               } catch(E) {
+                       this.error.standard_unexpected_error_alert('Items were not likely renewed',E);
+               }
+       },
+
        'items_renew' : function(which) {
                var obj = this;
                try{
index bb5f821..f1f99e3 100644 (file)
@@ -66,6 +66,7 @@
        <commandset id="items_cmds">
                <command id="cmd_items_print" />
                <command id="cmd_items_renew" />
+               <command id="cmd_items_renew_all" />
                <command id="cmd_items_claimed_returned" />
                <command id="cmd_items_checkin" />
                <command id="cmd_items_edit" />
index 34ae66b..1008149 100644 (file)
@@ -16,6 +16,7 @@
                <menuitem label="Mark Lost (by Patron)" command="cmd_items_mark_lost" />
                <menuitem label="Mark Claimed Returned" command="cmd_items_claimed_returned" />
                <menuitem label="Renew" command="cmd_items_renew" />
+               <menuitem label="Renew All" command="cmd_items_renew_all" />
                <menuitem label="Check In" command="cmd_items_checkin" />
                <menuitem label="Add Billing" command="cmd_add_billing" />
        </popup>
@@ -70,6 +71,7 @@
                                <menuitem label="Mark Lost (by Patron)" command="cmd_items_mark_lost" />
                                <menuitem label="Mark Claimed Returned" command="cmd_items_claimed_returned" />
                                <menuitem label="Renew" command="cmd_items_renew" />
+                               <menuitem label="Renew All" command="cmd_items_renew_all" />
                                <menuitem label="Check In" command="cmd_items_checkin" />
                                <menuitem label="Add Billing" command="cmd_add_billing" />
                        </menupopup>