Bucket related enhancements:
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jan 2010 21:17:03 +0000 (21:17 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jan 2010 21:17:03 +0000 (21:17 +0000)
* Add to Record Bucket action for Item Status interface
* Authoritative methods in bucket interfaces immune to database replication lag
* Removed a CGI param for better caching of the quick Add to Record Bucket interface
* Added a cat.util.add_titles_to_bucket utility method (but forgot to put it into cat.util.EXPORT_OK, though harmless)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15271 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul
Open-ILS/xul/staff_client/server/cat/util.js
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/copy_status.xul
Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul

index 6d86372..c3d85d0 100644 (file)
@@ -37,6 +37,7 @@ sub _sort_buckets {
 __PACKAGE__->register_method(
        method  => "bucket_retrieve_all",
        api_name        => "open-ils.actor.container.all.retrieve_by_user",
+    authoritative => 1,
        notes           => <<"  NOTES");
                Retrieves all un-fleshed buckets assigned to given user 
                PARAMS(authtoken, bucketOwnerId)
@@ -65,6 +66,7 @@ sub bucket_retrieve_all {
 __PACKAGE__->register_method(
        method  => "bucket_flesh",
        api_name        => "open-ils.actor.container.flesh",
+    authoritative => 1,
        argc            => 3, 
 );
 
index 1f34e80..0a30634 100644 (file)
 <!ENTITY staff.circ.copy_status_overlay.sel_clip.accesskey "C">
 <!ENTITY staff.circ.copy_status_overlay.sel_bucket.label "Add to Item Bucket">
 <!ENTITY staff.circ.copy_status_overlay.sel_bucket.accesskey "A">
+<!ENTITY staff.circ.copy_status_overlay.sel_record_bucket.label "Add to Record Bucket">
+<!ENTITY staff.circ.copy_status_overlay.sel_record_bucket.accesskey "">
 <!ENTITY staff.circ.copy_status_overlay.sel_opac.label "Show in Catalog">
 <!ENTITY staff.circ.copy_status_overlay.sel_opac.accesskey "S">
 <!ENTITY staff.circ.copy_status_overlay.sel_copy_details.label "Show Item Details">
index 133e6c5..7875502 100644 (file)
@@ -249,10 +249,12 @@ function remove_me() {
 function add_to_bucket() {
     JSAN.use('util.window'); var win = new util.window();
     win.open(
-        xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK)
-        + '?record_ids=' + js2JSON( [ docid ] ),
+        xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK),
         'sel_bucket_win' + win.window_name_increment(),
-        'chrome,resizable,modal,center'
+        'chrome,resizable,modal,center',
+        {
+            record_ids: [ docid ]
+        }
     );
 }
 
index e5f0391..9fe17d3 100644 (file)
@@ -53,9 +53,9 @@ const api = {
     'BLOB_MOBTS_CIRC_MVR_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.fleshed' },
     'BLOB_BALANCE_OWED_VIA_USERGROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.members.balance_owed.authoritative' },
     'BUCKET_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.create' },
-    'BUCKET_FLESH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.flesh' },
+    'BUCKET_FLESH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.flesh.authoritative' },
     'BUCKET_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.full_delete' },
-    'BUCKET_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.all.retrieve_by_user' },
+    'BUCKET_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.all.retrieve_by_user.authoritative' },
     'BUCKET_ITEM_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.item.create' },
     'BUCKET_ITEM_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.item.delete' },
     'CAPTURE_COPY_FOR_HOLD_VIA_BARCODE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.capture_copy.barcode' },
index b7331c2..e1ffdee 100644 (file)
                 g.record_ids = xul_param(
                     'record_ids',{
                         'concat' : true,
+                        'modal_xulG' : true,
                         'JSON2js_if_cgi' : true,
                         'JSON2js_if_xpcom' : true,
                         'stash_name':'rb_temp_record_ids',
-                        'clear_xpcom' : true,
+                        'clear_xpcom' : true
                     }
                 );
 
index 2632954..4fb5e10 100644 (file)
@@ -239,6 +239,18 @@ cat.util.add_copies_to_bucket = function(selection_list) {
     );
 }
 
+cat.util.add_titles_to_bucket = function(record_ids) {
+    JSAN.use('util.window'); var win = new util.window();
+    win.open(
+        xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK),
+        'sel_bucket_win' + win.window_name_increment(),
+        'chrome,resizable,modal,center',
+        {
+            record_ids: record_ids 
+        }
+    );
+}
+
 cat.util.spawn_copy_editor = function(params) {
     try {
         if (!params.copy_ids && !params.copies) return;
index e2271d4..d4ddb89 100644 (file)
@@ -59,6 +59,7 @@ circ.copy_status.prototype = {
                             obj.controller.view.sel_edit.setAttribute('disabled','true');
                             obj.controller.view.sel_opac.setAttribute('disabled','true');
                             obj.controller.view.sel_bucket.setAttribute('disabled','true');
+                            obj.controller.view.sel_record_bucket.setAttribute('disabled','true');
                             obj.controller.view.sel_copy_details.setAttribute('disabled','true');
                             obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true');
                             obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true');
@@ -87,6 +88,7 @@ circ.copy_status.prototype = {
                             obj.controller.view.sel_patron.setAttribute('disabled','false');
                             obj.controller.view.cmd_triggered_events.setAttribute('disabled','false');
                             obj.controller.view.sel_bucket.setAttribute('disabled','false');
+                            obj.controller.view.sel_record_bucket.setAttribute('disabled','false');
                             obj.controller.view.sel_copy_details.setAttribute('disabled','false');
                             obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','false');
                             obj.controller.view.sel_mark_items_missing.setAttribute('disabled','false');
@@ -380,6 +382,19 @@ circ.copy_status.prototype = {
                             cat.util.add_copies_to_bucket(obj.selection_list);
                         }
                     ],
+                    'sel_record_bucket' : [
+                        ['command'],
+                        function() {
+                            JSAN.use('cat.util'); JSAN.use('util.functional');
+                            cat.util.add_titles_to_bucket(
+                                util.functional.map_list(
+                                    obj.selection_list, function (o) {
+                                        return o.doc_id;
+                                    }
+                                )
+                            );
+                        }
+                    ],
                     'copy_status_barcode_entry_textbox' : [
                         ['keypress'],
                         function(ev) {
index fdb1433..aa955fe 100644 (file)
         <command id="sel_edit" disabled="true"/>
         <command id="sel_opac" disabled="true"/>
         <command id="sel_bucket" disabled="true"/>
+        <command id="sel_record_bucket" disabled="true" label="&staff.circ.copy_status_overlay.sel_record_bucket.label;" accesskey="&staff.circ.copy_status_overlay.sel_record_bucket.accesskey;" />
         <command id="sel_spine" disabled="true"/>
         <command id="sel_transit_abort" disabled="true"/>
         <command id="sel_clip" disabled="true"/>
index 5b8586d..8036a67 100644 (file)
@@ -13,6 +13,7 @@
     <popup id="copy_status_actions" position="at_pointer"> 
         <menuitem command="sel_clip" label="&staff.circ.copy_status_overlay.sel_clip.label;" accesskey="&staff.circ.copy_status_overlay.sel_clip.accesskey;" />
         <menuitem command="sel_bucket" label="&staff.circ.copy_status_overlay.sel_bucket.label;" accesskey="&staff.circ.copy_status_overlay.sel_bucket.accesskey;"/>
+        <menuitem command="sel_record_bucket" />
         <menuitem command="sel_opac" label="&staff.circ.copy_status_overlay.sel_opac.label;" accesskey="&staff.circ.copy_status_overlay.sel_opac.accesskey;" />
         <menuitem command="sel_copy_details" label="&staff.circ.copy_status_overlay.sel_copy_details.label;" accesskey="&staff.circ.copy_status_overlay.sel_copy_details.accesskey;" />
         <menuitem command="sel_patron" label="&staff.circ.copy_status_overlay.sel_patron.label;" accesskey="&staff.circ.copy_status_overlay.sel_patron.accesskey;"/>
@@ -42,6 +43,7 @@
     <popup id="copy_cat_status_actions" position="at_pointer"> 
         <menuitem command="sel_clip" label="&staff.circ.copy_status_overlay.sel_clip.label;" accesskey="&staff.circ.copy_status_overlay.sel_clip.accesskey;" />
         <menuitem command="sel_bucket" label="&staff.circ.copy_status_overlay.sel_bucket.label;" accesskey="&staff.circ.copy_status_overlay.sel_bucket.accesskey;"/>
+        <menuitem command="sel_record_bucket" />
         <menuitem command="sel_opac" label="&staff.circ.copy_status_overlay.sel_opac.label;" accesskey="&staff.circ.copy_status_overlay.sel_opac.accesskey;" />
         <menuitem command="sel_copy_details" label="&staff.circ.copy_status_overlay.sel_copy_details.label;" accesskey="&staff.circ.copy_status_overlay.sel_copy_details.accesskey;" />
         <menuitem command="sel_patron" label="&staff.circ.copy_status_overlay.sel_patron.label;" accesskey="&staff.circ.copy_status_overlay.sel_patron.accesskey;"/>
         <menupopup>
             <menuitem command="sel_clip" label="&staff.circ.copy_status_overlay.sel_clip.label;" accesskey="&staff.circ.copy_status_overlay.sel_clip.accesskey;" />
             <menuitem command="sel_bucket" label="&staff.circ.copy_status_overlay.sel_bucket.label;" accesskey="&staff.circ.copy_status_overlay.sel_bucket.accesskey;"/>
+            <menuitem command="sel_record_bucket" />
             <menuitem command="sel_opac" label="&staff.circ.copy_status_overlay.sel_opac.label;" accesskey="&staff.circ.copy_status_overlay.sel_opac.accesskey;" />
             <menuitem command="sel_copy_details" label="&staff.circ.copy_status_overlay.sel_copy_details.label;" accesskey="&staff.circ.copy_status_overlay.sel_copy_details.accesskey;" />
             <menuitem command="sel_patron" label="&staff.circ.copy_status_overlay.sel_patron.label;" accesskey="&staff.circ.copy_status_overlay.sel_patron.accesskey;"/>
         <menupopup>
             <menuitem command="sel_clip" label="&staff.circ.copy_status_overlay.sel_clip.label;" accesskey="&staff.circ.copy_status_overlay.sel_clip.accesskey;" />
             <menuitem command="sel_bucket" label="&staff.circ.copy_status_overlay.sel_bucket.label;" accesskey="&staff.circ.copy_status_overlay.sel_bucket.accesskey;"/>
+            <menuitem command="sel_record_bucket" />
             <menuitem command="sel_opac" label="&staff.circ.copy_status_overlay.sel_opac.label;" accesskey="&staff.circ.copy_status_overlay.sel_opac.accesskey;" />
             <menuitem command="sel_copy_details" label="&staff.circ.copy_status_overlay.sel_copy_details.label;" accesskey="&staff.circ.copy_status_overlay.sel_copy_details.accesskey;" />
             <menuitem command="sel_patron" label="&staff.circ.copy_status_overlay.sel_patron.label;" accesskey="&staff.circ.copy_status_overlay.sel_patron.accesskey;"/>