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

Evergreen Git git at git.evergreen-ils.org
Mon Aug 20 16:50:16 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  1a0a373a6f8da16bfc22b0503fdf6c1f0453469c (commit)
      from  c1505ea06b6a20736d107ad267d449fd6e218030 (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 1a0a373a6f8da16bfc22b0503fdf6c1f0453469c
Author: Bill Erickson <berick at esilibrary.com>
Date:   Fri Aug 17 17:15:25 2012 -0400

    ACQ return-to-[search/invoice] buttons repair
    
    With changes in place to support newer version of xulrunner, several
    buttons no longer work in the staff client.  These include:
    
    Return to Search in PO and Selection List pages
    Return to Invoice in PO and Selection List pages
    Return in lineitem worksheet page
    
    This fix avoids using document.referrer (which is no longer available)
    with an explicit 'source' CGI parameter, which contains the path and
    params of the source page.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/acq/lineitem/worksheet.tt2 b/Open-ILS/src/templates/acq/lineitem/worksheet.tt2
index 8b95e03..8fdf885 100644
--- a/Open-ILS/src/templates/acq/lineitem/worksheet.tt2
+++ b/Open-ILS/src/templates/acq/lineitem/worksheet.tt2
@@ -3,9 +3,10 @@
 <script type="text/javascript">
     var liId = "[% ctx.page_args.0 %]";
     dojo.require('openils.CGI');
-    var cgi = new openils.CGI({url : document.referrer});
-    cgi.param('focus_li', liId);
-    var returnRef = cgi.url();
+    var cgi = new openils.CGI();
+    var newCgi = new openils.CGI({url : cgi.param('source')});
+    newCgi.param('focus_li', liId);
+    var returnRef = newCgi.url();
 </script>
 <h1>Lineitem Worksheet</h1>
 <div dojoType='dijit.form.Button' scrollOnFocus='false' onClick='location.href = returnRef'>&#x2196; Return</div>
diff --git a/Open-ILS/src/templates/acq/po/view.tt2 b/Open-ILS/src/templates/acq/po/view.tt2
index 2084e10..afa2edc 100644
--- a/Open-ILS/src/templates/acq/po/view.tt2
+++ b/Open-ILS/src/templates/acq/po/view.tt2
@@ -106,9 +106,6 @@
                 </tr>
                 <tr>
                     <th></th>
-                    <td></td>
-                    <th>[% l('Allow activation with <br/> zero-copy lineitems') %]</th>
-                    <td><input type='checkbox' id='acq-po-activate-zero-copies' onclick='checkCouldActivatePo()'/></td>
                     <td>
                         <div class='hidden' id='acq-po-return-to-search'>
                             <button dojoType='dijit.form.Button' id='acq-po-return-to-search-button'>[% l('&#x2196; Return to Search') %]</button>
@@ -117,7 +114,8 @@
                             <button dojoType='dijit.form.Button' id='acq-po-return-to-invoice-button'>[% l('&#x2196; Return to Invoice') %]</button>
                         </div>
                     </td>
-                    <td/>
+                    <th>[% l('Allow activation with <br/> zero-copy lineitems') %]</th>
+                    <td><input type='checkbox' id='acq-po-activate-zero-copies' onclick='checkCouldActivatePo()'/></td>
                 </tr>
                 <tr>
                     <td colspan='3'>
diff --git a/Open-ILS/web/js/dojo/openils/acq/Lineitem.js b/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
index ec28214..ee69ef7 100644
--- a/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
+++ b/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
@@ -181,6 +181,7 @@ openils.acq.Lineitem.fetchAndRender = function(liId, args, callback) {
                         liLink,
                         (po) ? 'foo' : '', // forces class='hiddenfoo' i.e. not hidden
                         (pl) ? 'foo' : '', // ditto
+                        encodeURIComponent(location.pathname + location.search)
                     ],
                     function(str) {
                         // prevent long titles from filling up the page
diff --git a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
index 26a0452..f323a0e 100644
--- a/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
+++ b/Open-ILS/web/js/dojo/openils/acq/nls/acq.js
@@ -62,7 +62,7 @@
     "INVOICE_ITEM_DETAILS" : "${0} <br/> ${1} <br/> ${2}. <br/> Estimated Price: $${3}. <br/> Lineitem ID: ${4} <br/> PO: ${5} <br/> Order Date: ${6}",
     "INVOICE_CONFIRM_ITEM_DELETE" : "Remove this $${0} '${1}' charge from the invoice?",
     "INVOICE_CONFIRM_ENTRY_DETACH" : "Remove $${0} charge for item '${1}, ${2} [${3}] from the invoice?",
-    "LINEITEM_SUMMARY" : "<div class='acq-lineitem-summary'><a href='${19}?focus_li=${10}'>${0}</a>, by ${1} (${2})</div>\n<div class='acq-lineitem-summary-extra'>\n${3} Ordered, ${4} Received, ${7} Invoiced, ${8} Claimed, ${9} Cancelled</div>\n<div class='acq-lineitem-summary-extra'>Estimated $${6}, Encumbered $${16}, Paid $${17}</div>\n<div class='acq-lineitem-summary-extra'>\n# ${10} <a style='padding-right: 10px;' class='hidden${20}'  href='${11}/acq/po/view/${12}?focus_li=${10}'>&#x2318; ${13} ${18}</a>\n<a style='padding-right: 10px;' class='hidden${21}' href='${11}/acq/picklist/view/${14}?focus_li=${10}'>&#x2756; ${15}</a></div>",
+    "LINEITEM_SUMMARY" : "<div class='acq-lineitem-summary'><a href='${19}?focus_li=${10}&source=${22}'>${0}</a>, by ${1} (${2})</div>\n<div class='acq-lineitem-summary-extra'>\n${3} Ordered, ${4} Received, ${7} Invoiced, ${8} Claimed, ${9} Cancelled</div>\n<div class='acq-lineitem-summary-extra'>Estimated $${6}, Encumbered $${16}, Paid $${17}</div>\n<div class='acq-lineitem-summary-extra'>\n# ${10} <a style='padding-right: 10px;' class='hidden${20}'  href='${11}/acq/po/view/${12}?focus_li=${10}&source=${22}'>&#x2318; ${13} ${18}</a>\n<a style='padding-right: 10px;' class='hidden${21}' href='${11}/acq/picklist/view/${14}?focus_li=${10}&source=${22}'>&#x2756; ${15}</a></div>",
     "INVOICE_CONFIRM_PRORATE" : "Prorate charges?\n\nAny subsequent changes to the invoice that would affect prorated amounts should be resolved manually.",
     "INVOICE_EXTRA_COPIES" : "You are attempting to invoice <b>${0}</b> more copies than originally ordered.  <br/><br/>To add these items to the original order, select a fund and choose 'Add New Items' below.  <br/>After saving the invoice, you may finish editing and importing the new copies from the lineitem details page.",
     "INVOICE_ITEM_PO_DETAILS" : "<b>${0}</b><br/><a href='${1}/acq/po/view/${2}'>PO #${3} ${4}</a><br/>Total Estimated Cost: $${5}",
diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js
index aba6da9..0ed491e 100644
--- a/Open-ILS/web/js/ui/default/acq/common/li_table.js
+++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js
@@ -423,10 +423,12 @@ function AcqLiTable() {
         }
 
         nodeByName("worksheet_link", row).href =
-            oilsBasePath + "/acq/lineitem/worksheet/" + li.id();
+            oilsBasePath + "/acq/lineitem/worksheet/" + li.id() + 
+            '?source=' + encodeURIComponent(location.pathname + location.search)
 
         nodeByName("show_requests_link", row).href =
-            oilsBasePath + "/acq/picklist/user_request?lineitem=" + li.id();
+            oilsBasePath + "/acq/picklist/user_request?lineitem=" + li.id() + 
+            '?source=' + encodeURIComponent(location.pathname + location.search)
 
         dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())};
         dojo.query('[name=copieslink]', row)[0].onclick = function() {self.drawCopies(li.id())};
@@ -459,7 +461,11 @@ function AcqLiTable() {
             if(po && !this.isMeta) {
                 openils.Util.show(nodeByName('po', row), 'inline');
                 var link = nodeByName('po_link', row);
-                link.setAttribute('href', oilsBasePath + '/acq/po/view/' + li.purchase_order() + '?focus_li=' + li.id());
+                link.setAttribute('href', oilsBasePath +
+                    '/acq/po/view/' + li.purchase_order() +
+                    '?focus_li=' + li.id() +
+                    '&source=' + encodeURIComponent(location.pathname + location.search)
+                );
                 link.innerHTML += po.name();
 
                 openils.Util.show(nodeByName('pro', row), 'inline');
@@ -485,7 +491,11 @@ function AcqLiTable() {
 
                     openils.Util.show(nodeByName('pl', row), 'inline');
                     var link = nodeByName('pl_link', row);
-                    link.setAttribute('href', oilsBasePath + '/acq/picklist/view/' + li.picklist() + '?focus_li=' + li.id());
+                    link.setAttribute('href', oilsBasePath +
+                        '/acq/picklist/view/' + li.picklist() +
+                        '?focus_li=' + li.id() +
+                        '&source=' + encodeURIComponent(location.pathname + location.search)
+                    );
                     link.innerHTML += pl.name();
                 }
             }
@@ -1121,9 +1131,11 @@ function AcqLiTable() {
         if (typeof force_fetch == "undefined")
             force_fetch = false;
 
-        if (document.referrer.match(/invoice/)) {
+        var cgi = new openils.CGI();
+        var source = cgi.param('source');
+        if (source && source.match(/invoice/)) {
             // got here from the invoice page, show the 'return-to-invoice' button
-            var cgi = new openils.CGI({url : document.referrer});
+            var cgi = new openils.CGI({url : source});
             cgi.param('focus_li', liId);
             openils.Util.show(dojo.byId('acq-lit-copies-back-to-invoice-button-wrapper'), 'inline');
             var button = dojo.byId('acq-lit-copies-back-to-invoice-button');
diff --git a/Open-ILS/web/js/ui/default/acq/picklist/view.js b/Open-ILS/web/js/ui/default/acq/picklist/view.js
index c125daf..818fb6e 100644
--- a/Open-ILS/web/js/ui/default/acq/picklist/view.js
+++ b/Open-ILS/web/js/ui/default/acq/picklist/view.js
@@ -29,15 +29,17 @@ function load() {
     /* if we got here from the search/invoice page with a focused LI,
      * return to the previous page with the same LI focused */
     var cgi = new openils.CGI();
-    if (cgi.param('focus_li')) {
+    var source = cgi.param('source');
+    var focus_li = cgi.param('focus_li');
+    if (source && focus_li) {
         dojo.forEach(
             ['search', 'invoice'], // perhaps a wee bit too loose
-            function(source) {
-                if (document.referrer.match(new RegExp(source))) {
-                    openils.Util.show('acq-pl-return-to-' + source);
-                    var newCgi = new openils.CGI({url : document.referrer});
+            function(srcType) {
+                if (source.match(new RegExp(srcType))) {
+                    openils.Util.show('acq-pl-return-to-' + srcType);
+                    var newCgi = new openils.CGI({url : source});
                     newCgi.param('focus_li', cgi.param('focus_li'));
-                    dojo.byId('acq-pl-return-to-' + source + '-button').onclick = function() {
+                    dojo.byId('acq-pl-return-to-' + srcType + '-button').onclick = function() {
                         location.href = newCgi.url();
                     }
                 }
diff --git a/Open-ILS/web/js/ui/default/acq/po/view_po.js b/Open-ILS/web/js/ui/default/acq/po/view_po.js
index f3cf4df..4c2a7e7 100644
--- a/Open-ILS/web/js/ui/default/acq/po/view_po.js
+++ b/Open-ILS/web/js/ui/default/acq/po/view_po.js
@@ -358,15 +358,17 @@ function renderPo() {
     /* if we got here from the search/invoice page with a focused LI,
      * return to the previous page with the same LI focused */
     var cgi = new openils.CGI();
-    if (cgi.param('focus_li')) {
+    var source = cgi.param('source');
+    var focus_li = cgi.param('focus_li');
+    if (focus_li && source) {
         dojo.forEach(
             ['search', 'invoice'], // perhaps a wee bit too loose
-            function(source) {
-                if (document.referrer.match(new RegExp(source))) {
-                    openils.Util.show('acq-po-return-to-' + source);
-                    var newCgi = new openils.CGI({url : document.referrer});
-                    newCgi.param('focus_li', cgi.param('focus_li'));
-                    dojo.byId('acq-po-return-to-' + source + '-button').onclick = function() {
+            function(srcType) {
+                if (source.match(new RegExp(srcType))) {
+                    openils.Util.show('acq-po-return-to-' + srcType);
+                    var newCgi = new openils.CGI({url : source});
+                    newCgi.param('focus_li', focus_li);
+                    dojo.byId('acq-po-return-to-' + srcType + '-button').onclick = function() {
                         location.href = newCgi.url();
                     }
                 }

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

Summary of changes:
 Open-ILS/src/templates/acq/lineitem/worksheet.tt2 |    7 +++--
 Open-ILS/src/templates/acq/po/view.tt2            |    6 +---
 Open-ILS/web/js/dojo/openils/acq/Lineitem.js      |    1 +
 Open-ILS/web/js/dojo/openils/acq/nls/acq.js       |    2 +-
 Open-ILS/web/js/ui/default/acq/common/li_table.js |   24 +++++++++++++++-----
 Open-ILS/web/js/ui/default/acq/picklist/view.js   |   14 +++++++-----
 Open-ILS/web/js/ui/default/acq/po/view_po.js      |   16 +++++++------
 7 files changed, 43 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list