Backporting changeset 15271
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jan 2010 22:13:02 +0000 (22:13 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jan 2010 22:13:02 +0000 (22:13 +0000)
Bucket related enhancements:
* 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/branches/rel_1_6@15272 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 9167617..c2eda9e 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 82f1b93..d5eeee3 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 12018b0..fc5a9ce 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 20d91c4..03f5a6c 100644 (file)
@@ -48,9 +48,9 @@ const api = {
        'BLOB_MOBTS_CIRC_MVR_HAVING_BALANCE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.have_balance.fleshed' },
        'BLOB_MOBTS_CIRC_MVR_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.fleshed' },
        '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 10ec0a0..4d5a025 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 0a73e17..59ec7fb 100644 (file)
@@ -231,6 +231,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 a247949..e623ea4 100644 (file)
@@ -58,6 +58,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');
@@ -82,6 +83,7 @@ circ.copy_status.prototype = {
                                                        obj.controller.view.sel_opac.setAttribute('disabled','false');
                                                        obj.controller.view.sel_patron.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');
@@ -274,6 +276,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 147da12..a7d279b 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 333f725..ef6f4e5 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;"/>
@@ -39,6 +40,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;"/>