[open-ils-commits] [GIT] Evergreen ILS branch master updated. a7a2c7037c1bc3c22b309b57963a4abe7c6d2ee0

Evergreen Git git at git.evergreen-ils.org
Fri Mar 23 16:24:38 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  a7a2c7037c1bc3c22b309b57963a4abe7c6d2ee0 (commit)
       via  6e5bc73796b3f666cfc35a4896ccd5788e3fb870 (commit)
       via  51b6fd0b5b75124e20598a9bc20cc8d167b3434e (commit)
       via  bcdbd3ab560658c8f83f9de624c3a39b1dcc2e2b (commit)
       via  f5838ec4eb32121fc8dc3ebaafd342f63f8bbd22 (commit)
       via  7075d7e798b1a5651d16d8a30851eaf5686addec (commit)
       via  0afa4f752912543356f711df5b6d808167c195f4 (commit)
      from  56121886c72b2d41b327ebbc0cb55ad66561c710 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a7a2c7037c1bc3c22b309b57963a4abe7c6d2ee0
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Mon Mar 19 14:39:09 2012 -0400

    Alt serials opac reloading cleanup
    
    Removed a call to xulG.reload_opac() that was no longer wanted
    
    More debuggable.  I think it might still be possbile to get to alt
    serial control interfaces in contexts where they don't have
    xulG.reload_opac(), but I can't think of any way to do it just now.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/serial/list_item.tt2 b/Open-ILS/src/templates/serial/list_item.tt2
index 950b9d5..30dd390 100644
--- a/Open-ILS/src/templates/serial/list_item.tt2
+++ b/Open-ILS/src/templates/serial/list_item.tt2
@@ -47,7 +47,7 @@
         showSequenceFields="true"
         fmClass="sitem"
         editPaneOnSubmit="update_sitem_safely"
-        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
+        onPostSubmit="attempt_reload_opac"
         showPaginator="true"
         editOnEnter="true">
         <thead>
@@ -120,5 +120,6 @@
         </div>
     </div>
 </div>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/common.js"></script>
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/list_item.js"></script>
 [% END %]
diff --git a/Open-ILS/src/templates/serial/list_stream.tt2 b/Open-ILS/src/templates/serial/list_stream.tt2
index 0b8c2f7..71ffa27 100644
--- a/Open-ILS/src/templates/serial/list_stream.tt2
+++ b/Open-ILS/src/templates/serial/list_stream.tt2
@@ -37,7 +37,7 @@
         fieldOrder="['id','distribution','routing_label']"
         suppressFields="['distribution']"
         showSequenceFields="true"
-        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
+        onPostSubmit="attempt_reload_opac"
         fmClass="sstr"
         showPaginator="true"
         editOnEnter="true">
@@ -146,5 +146,6 @@
     </div>
     <div dojoType="openils.widget.ProgressDialog" jsId="progress_dialog"></div>
 </div>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/common.js"> </script>
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/list_stream.js"> </script>
 [% END %]
diff --git a/Open-ILS/src/templates/serial/list_subscription.tt2 b/Open-ILS/src/templates/serial/list_subscription.tt2
index dc23bc9..719bee0 100644
--- a/Open-ILS/src/templates/serial/list_subscription.tt2
+++ b/Open-ILS/src/templates/serial/list_subscription.tt2
@@ -1,7 +1,9 @@
 [% WRAPPER base.tt2 %]
 [% ctx.page_title = "Subscriptions" %]
-<script
-    type="text/javascript"
+<script type="text/javascript"
+    src="[% ctx.media_prefix %]/js/ui/default/serial/common.js">
+</script>
+<script type="text/javascript"
     src="[% ctx.media_prefix %]/js/ui/default/serial/list_subscription.js">
 </script>
 <script type="text/javascript">
@@ -39,7 +41,7 @@
         suppressFields="['record_entry']"
         fmClass="ssub"
         showPaginator="true"
-        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
+        onPostSubmit="attempt_reload_opac"
         showSequenceFields="true"
         editOnEnter="true">
         <thead>
diff --git a/Open-ILS/src/templates/serial/subscription.tt2 b/Open-ILS/src/templates/serial/subscription.tt2
index c835d39..47eb714 100644
--- a/Open-ILS/src/templates/serial/subscription.tt2
+++ b/Open-ILS/src/templates/serial/subscription.tt2
@@ -3,6 +3,8 @@
     var cap_editor;
     var cap_importer;
 </script>
+<script src="[% ctx.media_prefix %]/js/ui/default/serial/common.js">
+</script>
 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription.js">
 </script>
 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/caption_and_pattern.js">
diff --git a/Open-ILS/src/templates/serial/subscription/distribution.tt2 b/Open-ILS/src/templates/serial/subscription/distribution.tt2
index 3258c3a..8a344bb 100644
--- a/Open-ILS/src/templates/serial/subscription/distribution.tt2
+++ b/Open-ILS/src/templates/serial/subscription/distribution.tt2
@@ -23,7 +23,7 @@
         suppressFields="['record_entry','subscription','receive_call_number','bind_call_number','bind_unit_template']"
         suppressEditFields="['record_entry','receive_call_number','bind_call_number','bind_unit_template']"
         requiredFields="['receive_unit_template']"
-        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
+        onPostSubmit="attempt_reload_opac"
         fmClass="sdist"
         query="{id: '*'}"
         editOnEnter="true"
diff --git a/Open-ILS/src/templates/serial/subscription/issuance.tt2 b/Open-ILS/src/templates/serial/subscription/issuance.tt2
index 21777ff..57a291e 100644
--- a/Open-ILS/src/templates/serial/subscription/issuance.tt2
+++ b/Open-ILS/src/templates/serial/subscription/issuance.tt2
@@ -22,7 +22,7 @@
         suppressFields="['subscription','holding_link_id','create_date','edit_date','creator','editor']"
         suppressEditFields="['id','holding_link_id','create_date','edit_date']"
         defaultCellWidth="'auto'"
-        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
+        onPostSubmit="attempt_reload_opac"
         fmClass="siss"
         query="{id: '*'}"
         editOnEnter="true"
diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
index 7587251..1fd41ad 100644
--- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js
+++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
@@ -253,14 +253,6 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                 } else {
                     (new openils.PermaCrud())[this.mode](this.fmObject, opts);
                 }
-
-                /* If we happen to have been spawned by something that
-                 * puts an reload_opac() function into our context, call it. */
-                try {
-                    xulG.reload_opac();
-                } catch(E) {
-                    (dump ? dump : console.log)(E);
-                }
             }
         }
     );
diff --git a/Open-ILS/web/js/ui/default/serial/common.js b/Open-ILS/web/js/ui/default/serial/common.js
new file mode 100644
index 0000000..22c1abe
--- /dev/null
+++ b/Open-ILS/web/js/ui/default/serial/common.js
@@ -0,0 +1,7 @@
+function attempt_reload_opac() {
+    try {
+        xulG.reload_opac();
+    } catch (E) {
+        (dump || console.log)(E);
+    }
+}

commit 6e5bc73796b3f666cfc35a4896ccd5788e3fb870
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Mar 19 11:12:06 2012 -0400

    Alt serials reload opac after changes
    
    Using the new onPostSubmit handler for AutoGrid.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/serial/list_item.tt2 b/Open-ILS/src/templates/serial/list_item.tt2
index edbbb82..950b9d5 100644
--- a/Open-ILS/src/templates/serial/list_item.tt2
+++ b/Open-ILS/src/templates/serial/list_item.tt2
@@ -47,6 +47,7 @@
         showSequenceFields="true"
         fmClass="sitem"
         editPaneOnSubmit="update_sitem_safely"
+        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
         showPaginator="true"
         editOnEnter="true">
         <thead>
diff --git a/Open-ILS/src/templates/serial/list_stream.tt2 b/Open-ILS/src/templates/serial/list_stream.tt2
index 7aedaf2..0b8c2f7 100644
--- a/Open-ILS/src/templates/serial/list_stream.tt2
+++ b/Open-ILS/src/templates/serial/list_stream.tt2
@@ -37,6 +37,7 @@
         fieldOrder="['id','distribution','routing_label']"
         suppressFields="['distribution']"
         showSequenceFields="true"
+        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
         fmClass="sstr"
         showPaginator="true"
         editOnEnter="true">
diff --git a/Open-ILS/src/templates/serial/list_subscription.tt2 b/Open-ILS/src/templates/serial/list_subscription.tt2
index 42e43ec..dc23bc9 100644
--- a/Open-ILS/src/templates/serial/list_subscription.tt2
+++ b/Open-ILS/src/templates/serial/list_subscription.tt2
@@ -39,6 +39,7 @@
         suppressFields="['record_entry']"
         fmClass="ssub"
         showPaginator="true"
+        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
         showSequenceFields="true"
         editOnEnter="true">
         <thead>
diff --git a/Open-ILS/src/templates/serial/subscription/distribution.tt2 b/Open-ILS/src/templates/serial/subscription/distribution.tt2
index d8f4b0d..3258c3a 100644
--- a/Open-ILS/src/templates/serial/subscription/distribution.tt2
+++ b/Open-ILS/src/templates/serial/subscription/distribution.tt2
@@ -23,6 +23,7 @@
         suppressFields="['record_entry','subscription','receive_call_number','bind_call_number','bind_unit_template']"
         suppressEditFields="['record_entry','receive_call_number','bind_call_number','bind_unit_template']"
         requiredFields="['receive_unit_template']"
+        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
         fmClass="sdist"
         query="{id: '*'}"
         editOnEnter="true"
diff --git a/Open-ILS/src/templates/serial/subscription/issuance.tt2 b/Open-ILS/src/templates/serial/subscription/issuance.tt2
index b74df6e..21777ff 100644
--- a/Open-ILS/src/templates/serial/subscription/issuance.tt2
+++ b/Open-ILS/src/templates/serial/subscription/issuance.tt2
@@ -22,6 +22,7 @@
         suppressFields="['subscription','holding_link_id','create_date','edit_date','creator','editor']"
         suppressEditFields="['id','holding_link_id','create_date','edit_date']"
         defaultCellWidth="'auto'"
+        onPostSubmit="function(){window.xulG && xulG.reload_opac()}"
         fmClass="siss"
         query="{id: '*'}"
         editOnEnter="true"

commit 51b6fd0b5b75124e20598a9bc20cc8d167b3434e
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Mar 19 11:10:55 2012 -0400

    AutoGrid generic onPostSubmit handler
    
    Called w/ no arguments after any CRUD actions occur.  This includes
    EditPane / EditDialog actions as well as deleteSelected.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
index 947d56c..715a7c0 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
@@ -16,6 +16,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
 
             /* if true, pop up an edit dialog when user hits Enter on a give row */
             editPaneOnSubmit : null,
+            onPostSubmit : null, // called after any CRUD actions are complete
             createPaneOnSubmit : null,
             editOnEnter : false, 
             defaultCellWidth : null,
@@ -347,19 +348,14 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                             fmObject, {
                                 oncomplete : function(r) {
                                     self.store.deleteItem(item);
-                                    if (--total < 1) {
-                                        try {
-                                            xulG.reload_opac();
-                                        } catch (E) {
-                                            (dump ? dump : console.log)(E);
-                                        }
+                                    if (--total < 1 && self.onPostSubmit) {
+                                        self.onPostSubmit();
                                     }
                                 }
                             }
                         );
                     }
                 );
-
             },
 
             _formatRowSelectInput : function(rowIdx) {
@@ -410,7 +406,6 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                 var grid = this;
                 var fmObject = new fieldmapper[this.fmClass]().fromStoreItem(storeItem);
                 var idents = grid.store.getIdentityAttributes();
-                var self = this;
 
                 var pane = new openils.widget.EditPane({
                     fmObject:fmObject,
@@ -429,8 +424,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                                 continue; // don't try to edit an identifier field
                             grid.store.setValue(storeItem, field, fmObject[field]());
                         }
-                        if(self.onPostUpdate)
-                            self.onPostUpdate(storeItem, rowIndex);
+                        if(grid.onPostUpdate)
+                            grid.onPostUpdate(storeItem, rowIndex);
                         setTimeout(
                             function(){
                                 try { 
@@ -440,6 +435,9 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                         );
                         if(onPostSubmit) 
                             onPostSubmit();
+                        if (grid.onPostSubmit)
+                            grid.onPostSubmit();
+
                     },
                     onCancel : function() {
                         setTimeout(function(){
@@ -479,6 +477,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                         },200);
                         if(onPostSubmit)
                             onPostSubmit(fmObject);
+                        if (grid.onPostSubmit)
+                            grid.onPostSubmit();
                     },
                     onCancel : function() {
                         if(onCancel) onCancel();

commit bcdbd3ab560658c8f83f9de624c3a39b1dcc2e2b
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri Mar 9 12:54:37 2012 -0500

    Followup fix to teaching AutoGrid to reload_opac()
    
    For deleting a list of selected items, only reload_opac() once at the
    end, not once for each item deleted.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
index 69df9a7..947d56c 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
@@ -343,15 +343,23 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                 dojo.forEach(items,
                     function(item) {
                         var fmObject = new fieldmapper[self.fmClass]().fromStoreItem(item);
-                        new openils.PermaCrud()['eliminate'](fmObject, {oncomplete : function(r) { self.store.deleteItem(item) }});
+                        new openils.PermaCrud()['eliminate'](
+                            fmObject, {
+                                oncomplete : function(r) {
+                                    self.store.deleteItem(item);
+                                    if (--total < 1) {
+                                        try {
+                                            xulG.reload_opac();
+                                        } catch (E) {
+                                            (dump ? dump : console.log)(E);
+                                        }
+                                    }
+                                }
+                            }
+                        );
                     }
                 );
 
-                try {
-                    xulG.reload_opac();
-                } catch (E) {
-                    (dump ? dump : console.log)(E);
-                }
             },
 
             _formatRowSelectInput : function(rowIdx) {

commit f5838ec4eb32121fc8dc3ebaafd342f63f8bbd22
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Fri Mar 9 12:10:20 2012 -0500

    Alt Serial Control interfaces and Batch Receive reload OPAC when possible
    
    Really, since the Alt Serial Control interfaces are built on AutoGrid,
    all we have to do there is teach AutoGrid (and its constituent EditPane)
    to try for reload_opac on write operations.
    
    This may cause more reloads of the OPAC than are truly necessary, but
    mainly in cases when nobody's looking because the OPAC is hidden away
    in another tab.  That's preferable to the alternative of littering the
    codebase with dozens of instances of
        try { xulG.reload_opac(); } catch (E) { }
    which would just be ugly, bad and unmaintainable.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
index 9210b36..69df9a7 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
@@ -346,6 +346,12 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                         new openils.PermaCrud()['eliminate'](fmObject, {oncomplete : function(r) { self.store.deleteItem(item) }});
                     }
                 );
+
+                try {
+                    xulG.reload_opac();
+                } catch (E) {
+                    (dump ? dump : console.log)(E);
+                }
             },
 
             _formatRowSelectInput : function(rowIdx) {
diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
index 1fd41ad..7587251 100644
--- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js
+++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
@@ -253,6 +253,14 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                 } else {
                     (new openils.PermaCrud())[this.mode](this.fmObject, opts);
                 }
+
+                /* If we happen to have been spawned by something that
+                 * puts an reload_opac() function into our context, call it. */
+                try {
+                    xulG.reload_opac();
+                } catch(E) {
+                    (dump ? dump : console.log)(E);
+                }
             }
         }
     );
diff --git a/Open-ILS/web/js/ui/default/serial/subscription.js b/Open-ILS/web/js/ui/default/serial/subscription.js
index 2429836..d3e3d4b 100644
--- a/Open-ILS/web/js/ui/default/serial/subscription.js
+++ b/Open-ILS/web/js/ui/default/serial/subscription.js
@@ -217,6 +217,10 @@ function _clone_subscription(bre_id) {
                     location.href =
                         oilsBasePath + "/serial/subscription?id=" + r;
                 }
+
+                /* cloning doesn't clone holdings, so nothing changes at
+                 * OPAC view just because of this, so no need to try
+                 * reload_opac().  */
             }
         }
     );
diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
index d1e0d02..d0657a9 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -355,7 +355,10 @@ function open_alt_serial_mgmt() {
             "authtime": ses("authtime"),
             "show_nav_buttons": true,
             "no_xulG": false,
-            "show_print_button": false
+            "show_print_button": false,
+            "passthru_content_params": {
+                "reload_opac": xulG.reload_opac
+            }
         };
 
         ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab",
diff --git a/Open-ILS/xul/staff_client/server/serial/batch_receive.js b/Open-ILS/xul/staff_client/server/serial/batch_receive.js
index 503a2ec..433843c 100644
--- a/Open-ILS/xul/staff_client/server/serial/batch_receive.js
+++ b/Open-ILS/xul/staff_client/server/serial/batch_receive.js
@@ -1063,6 +1063,11 @@ function BatchReceiver() {
                         alert(E);
                     }
                     busy(false);
+                    try {
+                        xulG.reload_opac();
+                    } catch(E) {
+                        (dump ? dump : console.log)(E);
+                    }
                 }
             }
         );

commit 7075d7e798b1a5651d16d8a30851eaf5686addec
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Fri Mar 9 04:45:14 2012 -0500

    updating item out count in patron display
    
    For checkouts (and checkouts converted into renewals), this updates the item out
    count in the patron summary sidebar, and under the Items Out navigation button.
    
    It also updates the Items Out sub-interface if that interface has been opened.
    
    However, we are adding an extra network call to update the summary sidebar.  We
    may want to have the checkout method return that data (the checkout count
    summary) instead.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js
index ee4d317..92bece2 100644
--- a/Open-ILS/xul/staff_client/server/circ/checkout.js
+++ b/Open-ILS/xul/staff_client/server/circ/checkout.js
@@ -436,11 +436,17 @@ circ.checkout.prototype = {
                             //I could override map_row_to_column here
                             }
                         );
+                        var is_renewal = (
+                            get_bool(checkout.payload.circ.opac_renewal())
+                            ||get_bool(checkout.payload.circ.phone_renewal())
+                            ||get_bool(checkout.payload.circ.desk_renewal())
+                        );
                         try {
                             obj.error.work_log(
                                 document.getElementById('circStrings').getFormattedString(
-                                    (get_bool(checkout.payload.circ.opac_renewal())||get_bool(checkout.payload.circ.phone_renewal())||get_bool(checkout.payload.circ.desk_renewal())) ?
-                                        'staff.circ.work_log_renew.message' : 'staff.circ.work_log_checkout.message',
+                                        is_renewal
+                                        ? 'staff.circ.work_log_renew.message'
+                                        : 'staff.circ.work_log_checkout.message',
                                     [
                                         ses('staff_usrname'),
                                         xulG.patron.family_name(),
@@ -464,7 +470,7 @@ circ.checkout.prototype = {
                         }
                         */
                         if (typeof window.xulG == 'object' && typeof window.xulG.on_list_change == 'function') {
-                            window.xulG.on_list_change(checkout.payload);
+                            window.xulG.on_list_change(checkout.payload,is_renewal);
                         } else {
                             obj.error.sdump('D_CIRC','circ.checkout: No external .on_checkout()\n');
                         }
diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js
index f18ecf5..054e364 100644
--- a/Open-ILS/xul/staff_client/server/patron/display.js
+++ b/Open-ILS/xul/staff_client/server/patron/display.js
@@ -844,30 +844,43 @@ patron.display.prototype = {
                     'patron_id' : obj.patron.id(),
                     'patron' : obj.patron,
                     'check_stop_checkouts' : function() { return obj.check_stop_checkouts(); },
-                    'on_list_change' : function(checkout) {
+                    'on_list_change_old' : function(checkout) {
                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                         var x = obj.summary_window.g.summary.controller.view.patron_checkouts;
                         var n = Number(x.getAttribute('value'));
                         x.setAttribute('value',n+1);
                     },
-                    'on_list_change_old' : function(checkout) {
+                    'on_list_change' : function(checkout,is_renewal) {
                     
-                        /* this stops noncats from getting pushed into Items Out */
-                        if (!checkout.circ.id()) return; 
-
                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                        // Downside here: an extra network call, open-ils.actor.user.checked_out.count.authoritative
                         obj.summary_window.g.summary.controller.render('patron_checkouts');
                         obj.summary_window.g.summary.controller.render('patron_standing_penalties');
+
+                        /* this stops noncats from getting pushed into Items Out */
+                        if (!checkout.circ.id()) return;
+
                         if (obj.items_window) {
-                            obj.items_window.g.items.list.append(
-                                {
-                                    'row' : {
-                                        'my' : {
-                                            'circ_id' : checkout.circ.id()
-                                        }
+                            if (is_renewal) {
+                                var original_circ_id = obj.items_window.g.items.list_circ_map_by_copy[ checkout.circ.target_copy() ];
+                                obj.items_window.g.items.list_circ_map[ original_circ_id ].row.my.circ = checkout.circ;
+                                obj.items_window.g.items.list_circ_map[ checkout.circ.id() ] =
+                                    obj.items_window.g.items.list_circ_map[ original_circ_id ];
+                                obj.items_window.g.items.refresh( checkout.circ.id() );
+                            } else {
+                                var nparams = obj.items_window.g.items.list.append(
+                                    {
+                                        'row' : {
+                                            'my' : {
+                                                'circ_id' : checkout.circ.id()
+                                            }
+                                        },
+                                        'to_bottom' : true
                                     }
-                                }
-                            )
+                                )
+                                obj.items_window.g.items.list_circ_map[ checkout.circ.id() ] = nparams;
+                                obj.items_window.g.items.list_circ_map_by_copy[ checkout.circ.target_copy() ] = checkout.circ.id();
+                            }
                         }
                     },
                     'get_barcode' : xulG.get_barcode,
diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js
index ee7215e..a38f728 100644
--- a/Open-ILS/xul/staff_client/server/patron/items.js
+++ b/Open-ILS/xul/staff_client/server/patron/items.js
@@ -14,6 +14,7 @@ patron.items = function (params) {
 patron.items.prototype = {
 
     'list_circ_map' : {},
+    'list_circ_map_by_copy' : {},
 
     'init' : function( params ) {
 
@@ -392,6 +393,7 @@ patron.items.prototype = {
                         obj.list_circ_map[ circ_id ].row.my.mvr = r[0].payload.record;
                         // A renewed circ is a new circ, and has a new circ_id.
                         obj.list_circ_map[ r[0].payload.circ.id() ] = obj.list_circ_map[ circ_id ];
+                        obj.list_circ_map_by_copy[ r[0].payload.copy.id() ] = r[0].payload.circ.id();
                     } else {
                         var msg = $("patronStrings").getFormattedString('staff.patron.items.items_renew.not_renewed',[bc, r[0].textcode + r[0].desc]);
                         l.setAttribute('value', msg);
@@ -464,6 +466,7 @@ patron.items.prototype = {
                         var robj = obj.network.simple_request('FM_CIRC_EDIT_DUE_DATE',[ses(),circs[i],my_xulG.timestamp]);
                         if (typeof robj.ilsevent != 'undefined') { if (robj.ilsevent != 0) throw(robj); }
                         obj.list_circ_map[ circs[i] ].row.my.circ = robj;
+                        obj.list_circ_map_by_copy[ robj.target_copy() ] = circs[i];
                         obj.refresh(circs[i]);
                     }
                 }
@@ -746,6 +749,8 @@ patron.items.prototype = {
                                 }
                                 
                                 params.treeitem_node.setAttribute( 'retrieve_id', js2JSON({'copy_id':copy_id,'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': ( row.my.record ? row.my.record.id() : null ) }) );
+
+                                obj.list_circ_map_by_copy[ copy_id ] = row.my.circ.id();
             
                                 if (typeof params.on_retrieve == 'function') {
                                     params.on_retrieve(row);

commit 0afa4f752912543356f711df5b6d808167c195f4
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Mar 8 14:51:32 2012 -0500

    Reload the OPAC via Holdings Maintenance
    
    Makes reloading a page wrapped in util.browser more accessible to foreign
    window contexts.  Gives all the interfaces hanging off the chrome OPAC wrapper
    the ability to reload the OPAC frame via xulG.reload_opac().  Have Holdings
    Maintenance do this whenever its list is refreshed.  And "Add Volumes", whether
    invoked from Actions for this Record, or from the click link in the record
    summary pane.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
index 52c84ef..d1e0d02 100644
--- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
+++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
@@ -1,4 +1,4 @@
-var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame; var opac_url;
+var docid; var marc_html; var top_pane; var bottom_pane; var opac_browser; var opac_url;
 
 var marc_view_reset = true;
 var marc_edit_reset = true;
@@ -106,7 +106,7 @@ function set_brief_view() {
         "set_patron_tab", "volume_item_creator", "get_new_session",
         "holdings_maintenance_tab", "open_chrome_window", "url_prefix",
         "network_meter", "page_meter", "set_statusbar", "set_help_context",
-        "get_barcode"
+        "get_barcode", "reload_opac"
     ].forEach(function(k) { content_params[k] = xulG[k]; });
 
     top_pane.set_iframe( 
@@ -240,7 +240,9 @@ function set_marc_edit() {
                                 );
 
                             } else {
-                                return cat.util.spawn_copy_editor( { 'handle_update' : 1, 'edit' : 1, 'docid' : doc_id, 'copies' : [ copy_obj ] });
+                                var x = cat.util.spawn_copy_editor( { 'handle_update' : 1, 'edit' : 1, 'docid' : doc_id, 'copies' : [ copy_obj ] });
+                                xulG.reload_opac();
+                                return x;
                             }
 
                         } catch(E) {
@@ -260,6 +262,7 @@ function set_marc_edit() {
                         marc_view_reset = true;
                         copy_browser_reset = true;
                         hold_browser_reset = true;
+                        xulG.reload_opac();
                         if (typeof r.ilsevent != 'undefined') {
                             throw(r);
                         } else {
@@ -325,7 +328,7 @@ function open_acq_orders() {
             "set_patron_tab", "volume_item_creator", "get_new_session",
             "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
             "url_prefix", "network_meter", "page_meter", "set_statusbar",
-            "set_help_context", "get_barcode"
+            "set_help_context", "get_barcode", "reload_opac"
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         var loc = urls.XUL_BROWSER + "?url=" + window.escape(
@@ -359,7 +362,7 @@ function open_alt_serial_mgmt() {
             "set_patron_tab", "volume_item_creator", "get_new_session",
             "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
             "url_prefix", "network_meter", "page_meter", "set_statusbar",
-            "set_help_context", "get_barcode"
+            "set_help_context", "get_barcode", "reload_opac"
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         var loc = urls.XUL_BROWSER + "?url=" + window.escape(
@@ -556,8 +559,18 @@ function set_opac() {
     } catch(E) {
         g.error.sdump('D_ERROR','set_opac: ' + E);
     }
-    opac_wrapper_set_help_context(); 
-    bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
+    opac_wrapper_set_help_context();
+    opac_browser = bottom_pane.get_contentWindow();
+    opac_browser.addEventListener('load',opac_wrapper_set_help_context,false);
+}
+
+xulG.reload_opac = function() {
+    try {
+        JSAN.use('util.widgets');
+        opac_browser.g.browser.reload();
+    } catch(E) {
+        g.error.sdump("D_ERROR", 'error reloading opac: ' + E + '\n');
+    }
 }
 
 function set_serctrl_view() {
@@ -616,7 +629,7 @@ function create_mfhd() {
             throw(r);
         }
         alert("MFHD record created."); //TODO: better success message
-        browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
+        xulG.reload_opac(); // browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
     } catch(E) {
         g.error.standard_unexpected_error_alert("Create MFHD failed", E); //TODO: better error handling
     }
@@ -638,7 +651,7 @@ function delete_mfhd(sre_id) {
             alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_deleted.error',  [docid, robj.textcode, robj.desc]) + '\n');
         } else {
             alert(document.getElementById('offlineStrings').getString('cat.opac.record_deleted'));
-            browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
+            xulG.reload_opac(); // browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
         }
     }
 }
@@ -672,6 +685,7 @@ function open_marc_editor(rec, label) {
                     'open-ils.permacrud', method,
                     [ses(), rec]
                 );
+                xulG.reload_opac();
             }
         }
     };
@@ -716,7 +730,7 @@ function batch_receive_in_new_tab() {
             "set_patron_tab", "volume_item_creator", "get_new_session",
             "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
             "url_prefix", "network_meter", "page_meter", "set_statusbar",
-            "set_help_context", "get_barcode"
+            "set_help_context", "get_barcode", "reload_opac"
         ].forEach(function(k) { content_params[k] = xulG[k]; });
 
         xulG.new_tab(
@@ -986,7 +1000,7 @@ function add_volumes() {
         var w = xulG.new_tab(
             url,
             { 'tab_name' : title },
-            { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] }
+            { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ], 'reload_opac' : xulG.reload_opac }
         );
     } catch(E) {
         alert('Error in chrome/content/cat/opac.js, add_volumes(): ' + E);
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/browser.js b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
index f0b4cd9..37f0466 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/browser.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/browser.js
@@ -132,17 +132,7 @@ util.browser.prototype = {
                             ['command'],
                             function() {
                                 try {
-                                    if (obj.lock_reload) {
-                                        if (window.confirm( $('offlineStrings').getString('browser.reload.unsaved_data_warning') )) {
-                                            obj.lock_reload = false;
-                                            window.xulG.unlock_tab();
-                                        } else {
-                                            return;
-                                        }
-                                    }
-                                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-                                    var n = obj.getWebNavigation();
-                                    n.reload( Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE );
+                                    obj.reload();
                                 } catch(E) {
                                     var err = 'cmd_reload: ' + E;
                                     obj.error.sdump('D_ERROR',err);
@@ -182,6 +172,21 @@ util.browser.prototype = {
         }
     },
 
+    'reload' : function() {
+        var obj = this;
+        if (obj.lock_reload) {
+            if (window.confirm( $('offlineStrings').getString('browser.reload.unsaved_data_warning') )) {
+                obj.lock_reload = false;
+                window.xulG.unlock_tab();
+            } else {
+                return;
+            }
+        }
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+        var n = obj.getWebNavigation();
+        n.reload( Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE );
+    },
+
     'find' : function(text) {
         var obj = this;
         try {
diff --git a/Open-ILS/xul/staff_client/server/cat/bib_brief.js b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
index face076..3f36c65 100644
--- a/Open-ILS/xul/staff_client/server/cat/bib_brief.js
+++ b/Open-ILS/xul/staff_client/server/cat/bib_brief.js
@@ -196,7 +196,7 @@ function add_volumes() {
         var w = xulG.new_tab(
             url,
             { 'tab_name' : title },
-            { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] }
+            { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ], 'reload_opac' : xulG.reload_opac }
         );
     } catch(E) {
         alert('Error in server/cat/bib_brief.js, add_volumes(): ' + E);
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
index d60a119..19fc6d7 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
@@ -1998,7 +1998,14 @@ cat.copy_browser.prototype = {
             obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
             obj.show_my_libs( obj.default_lib.id() );
             // FIXME - we get a null from the copy_count call if we call it too quickly here
-            setTimeout( function() { obj.show_consortial_count(); }, 2000 );
+            setTimeout(
+                function() {
+                    obj.show_consortial_count();
+                    if (typeof xulG.reload_opac == 'function') {
+                        xulG.reload_opac();
+                    }
+                }, 2000
+            );
         } catch(E) {
             this.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.refresh_list.error'),E);
         }
diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index d41b824..913fef6 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -1208,6 +1208,9 @@ g.stash_and_close = function(param) {
             xulG.unlock_copy_editor();
         }
 
+        if (typeof xulG.reload_opac == 'function') {
+            xulG.reload_opac();
+        }
         if (xul_param('load_opac_when_done')) {
             var opac_url = xulG.url_prefix( urls.opac_rdetail ) + g.doc_id;
             var content_params = {

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/serial/list_item.tt2        |    2 +
 Open-ILS/src/templates/serial/list_stream.tt2      |    2 +
 .../src/templates/serial/list_subscription.tt2     |    7 ++-
 Open-ILS/src/templates/serial/subscription.tt2     |    2 +
 .../templates/serial/subscription/distribution.tt2 |    1 +
 .../src/templates/serial/subscription/issuance.tt2 |    1 +
 Open-ILS/web/js/dojo/openils/widget/AutoGrid.js    |   22 +++++++++--
 Open-ILS/web/js/ui/default/serial/common.js        |    7 +++
 Open-ILS/web/js/ui/default/serial/subscription.js  |    4 ++
 .../xul/staff_client/chrome/content/cat/opac.js    |   41 ++++++++++++++------
 .../staff_client/chrome/content/util/browser.js    |   27 ++++++++-----
 Open-ILS/xul/staff_client/server/cat/bib_brief.js  |    2 +-
 .../xul/staff_client/server/cat/copy_browser.js    |    9 ++++-
 .../staff_client/server/cat/volume_copy_creator.js |    3 +
 Open-ILS/xul/staff_client/server/circ/checkout.js  |   12 ++++-
 Open-ILS/xul/staff_client/server/patron/display.js |   39 ++++++++++++------
 Open-ILS/xul/staff_client/server/patron/items.js   |    5 ++
 .../staff_client/server/serial/batch_receive.js    |    5 ++
 18 files changed, 144 insertions(+), 47 deletions(-)
 create mode 100644 Open-ILS/web/js/ui/default/serial/common.js


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list