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

Evergreen Git git at git.evergreen-ils.org
Sat Mar 31 22:36:19 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  9d38e1eee3a22bcc36b20305c9faf723fd79d0c7 (commit)
       via  1c9afe4c64fa34a300ee58bb9ef4694abf5d46d5 (commit)
       via  743552bb96f730e1ea20532ccb630d3ea825e298 (commit)
      from  b922420e98cfb3fefdba1987c3c5d20dd5493ece (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 9d38e1eee3a22bcc36b20305c9faf723fd79d0c7
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Aug 30 13:56:44 2011 -0400

    Remove block on mark-receive from non-PO UI
    
    Allow lineitem mark-received action to take place from lineitem table UI
    even when not viewing a PO (e.g. from search results)
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

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 c9b70d4..9e3e350 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
@@ -2323,10 +2323,6 @@ function AcqLiTable() {
     }
 
     this.issueReceive = function(obj, rollback) {
-        /* (For now) there shall be no marking LI or LIDs (un)received
-         * except from the actual "view PO" interface. */
-        if (!this.isPO) return;
-
         var part =
             {"jub": "lineitem", "acqlid": "lineitem_detail"}[obj.classname];
         var method =

commit 1c9afe4c64fa34a300ee58bb9ef4694abf5d46d5
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Nov 22 16:53:30 2011 -0500

    ACQ: allow recv actions on copies from non-PO interface
    
    * Allow PO actions on copies, like recieve, unreceive, and cancel from
      non-PO interfaces like the picklist UI and lineitem search interfaces.
      Instead of relying on whether the user is viewing a PO, use the status
      of each copy to determine which actions are appropriate to display.
    
    * General cleanup and better arrangment of the copy actions hide/display
      logic
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

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 b44a53f..c9b70d4 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
@@ -1722,13 +1722,13 @@ function AcqLiTable() {
     };
 
     this.updateLidState = function(copy, row) {
+        var self = this;
+
         if (typeof(row) == "undefined") {
-            row = dojo.query(
-                'tr[copy_id="' + copy.id() + '"]', this.copyTbody
-            )[0];
+            row = dojo.query('tr[copy_id="' + copy.id() + '"]', this.copyTbody)[0];
         }
 
-        var self = this;
+        // action links
         var recv_link = nodeByName("receive", row);
         var unrecv_link = nodeByName("unreceive", row);
         var del_link = nodeByName("delete", row);
@@ -1736,90 +1736,78 @@ function AcqLiTable() {
         var claim_link = nodeByName("claim", row);
         var cxl_reason_link = nodeByName("cancel_reason", row);
 
-        if (copy.cancel_reason()) {
-            openils.Util.hide(del_link.parentNode);
-            openils.Util.hide(recv_link);
-            openils.Util.hide(unrecv_link);
-            openils.Util.hide(cxl_link);
-            openils.Util.hide(claim_link);
-
-            /* XXX the following may leak memory in a long lived table: dijits may not get destroyed... not positive. revisit. */
-            var holds_reason = dojo.create(
-                "span", {
-                    "style": "border-bottom: 1px dashed #000;",
-                    "innerHTML": "Cancelled" /* XXX [sic] and i18n */
-                }, cxl_reason_link, "only"
-            );
-            new dijit.Tooltip(
-                {
-                    "label": "<em>" + copy.cancel_reason().label() +
-                        "</em><br />" + copy.cancel_reason().description(),
-                    "connectId": [holds_reason]
-                }, dojo.create("span", null, cxl_reason_link, "last")
-            );
-            openils.Util.show(cxl_reason_link, "inline");
-        } else if (this.isPO) {
-            /* Only using this in one place so far, but may want it for better
-             * decisions on when to display certain controls. */
-            var li_state = this.liCache[copy.lineitem()].state();
-
-            openils.Util.hide(del_link.parentNode);
-            openils.Util.hide(cxl_reason_link);
-
-            /* Avoid showing (un)receive links, cancel links, for virt copies */
-            if (copy.id() > 0) {
-                if (copy.recv_time()) {
-                    openils.Util.hide(cxl_link);
-                    openils.Util.hide(recv_link);
-                    openils.Util.hide(claim_link);
-
-                    openils.Util.show(unrecv_link, "inline");
-                    unrecv_link.onclick = function() {
-                        if (confirm(localeStrings.UNRECEIVE_LID))
-                            self.issueReceive(copy, /* rollback */ true);
-                    };
-                } else {
-                    openils.Util.hide(unrecv_link);
+        // by default, hide all the actions
+        openils.Util.hide(del_link.parentNode);
+        openils.Util.hide(recv_link);
+        openils.Util.hide(unrecv_link);
+        openils.Util.hide(cxl_link);
+        openils.Util.hide(claim_link);
+        openils.Util.hide(cxl_reason_link);
 
-                    if (this.claimEligibleLid[copy.id()]) {
-                        openils.Util.show(claim_link, "inline");
-                        claim_link.onclick = function() {
-                            self.claimDialog.show(
-                                self.liCache[copy.lineitem()], copy.id()
-                            );
-                        };
-                    } else {
-                        openils.Util.hide(claim_link);
-                    }
+        if (copy.id() > 0) { // real copies (LIDs)
+
+            if (copy.cancel_reason()) { 
+
+                /* --------- cancelled -------------------------- */
+
+                /* XXX the following may leak memory in a long lived table: 
+                 * dijits may not get destroyed... not positive. revisit. */
+                var holds_reason = dojo.create(
+                    "span", {
+                        "style": "border-bottom: 1px dashed #000;",
+                        "innerHTML": "Cancelled" /* XXX [sic] and i18n */
+                    }, cxl_reason_link, "only"
+                );
+                new dijit.Tooltip(
+                    {
+                        "label": "<em>" + copy.cancel_reason().label() +
+                            "</em><br />" + copy.cancel_reason().description(),
+                        "connectId": [holds_reason]
+                    }, dojo.create("span", null, cxl_reason_link, "last")
+                );
+                openils.Util.show(cxl_reason_link, "inline");
+
+            } else if (copy.recv_time()) { 
+
+                /* --------- received -------------------------- */
+
+                openils.Util.show(unrecv_link, "inline");
+                unrecv_link.onclick = function() {
+                    if (confirm(localeStrings.UNRECEIVE_LID))
+                        self.issueReceive(copy, /* rollback */ true);
+                };
+
+            } else if (this.liCache[copy.lineitem()].state() == 'on-order') {
+                
+                /* --------- on order -------------------------- */
+
+                openils.Util.show(recv_link, 'inline');
+                openils.Util.show(cxl_link, "inline");
+
+                recv_link.onclick = function() {
+                    if (self.checkLiAlerts(copy.lineitem()))
+                        self.issueReceive(copy);
+                };
+
+                cxl_link.onclick = function() { self.cancelLid(copy.id()) };
 
-                    openils.Util[li_state == "on-order" ? "show" : "hide"](
-                        recv_link, "inline"
-                    );
-                    openils.Util.show(cxl_link, "inline");
-                    recv_link.onclick = function() {
-                        if (self.checkLiAlerts(copy.lineitem()))
-                            self.issueReceive(copy);
-                    };
-                    cxl_link.onclick = function() {
-                        self.cancelLid(copy.id());
-                    };
-                }
             } else {
-                openils.Util.hide(cxl_link);
-                openils.Util.hide(unrecv_link);
-                openils.Util.hide(recv_link);
-                openils.Util.hide(claim_link);
+
+                /* --------- pre-order copies  -------------------------- */
+
+                del_link.onclick = function() { self.deleteCopy(row) };
+                openils.Util.show(del_link.parentNode);
+
             }
-        } else {
-            openils.Util.hide(unrecv_link);
-            openils.Util.hide(recv_link);
-            openils.Util.hide(cxl_reason_link);
-            openils.Util.hide(claim_link);
+
+        } else { 
+
+            /* --------- virtual copies  -------------------------- */
 
             del_link.onclick = function() { self.deleteCopy(row) };
             openils.Util.show(del_link.parentNode);
         }
-    }
+    };
 
     this.cancelLid = function(lid_id) {
         lidCancelDialog._lid_id = lid_id;

commit 743552bb96f730e1ea20532ccb630d3ea825e298
Author: Bill Erickson <berick at esilibrary.com>
Date:   Thu Aug 25 16:03:12 2011 -0400

    Make ACQ Lineitem actions more readily accessible
    
    No longer limit PO-related lineitem actions to the PO view UI.  Instead,
    limit lineitem actions on the state of the lineitem.  This allows staff
    to perform PO-related (e.g. create invoice) directly from the LI search
    interface.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2
index 3628b88..1ec4d17 100644
--- a/Open-ILS/src/templates/acq/common/li_table.tt2
+++ b/Open-ILS/src/templates/acq/common/li_table.tt2
@@ -123,13 +123,13 @@
                             <option name='action_none'>-- Actions --</option>
                             <option name='action_mark_recv' disabled='disabled'>Mark Received</option>
                             <option name='action_mark_unrecv' disabled='disabled'>Un-Receive</option>
-                            <option name='action_update_barcodes' disabled='disabled'>Update Barcodes</option>
-                            <option name='action_holdings_maint' disabled='disabled'>Holdings Maint.</option>
+                            <option name='action_update_barcodes'>Update Barcodes</option>
+                            <option name='action_holdings_maint'>Holdings Maint.</option>
                             <option name='action_new_invoice' disabled='disabled'>New Invoice</option>
                             <option name='action_link_invoice' disabled='disabled'>Link to Invoice</option>
                             <option name='action_view_invoice' disabled='disabled'>View Invoice(s)</option>
                             <option name='action_view_claim_policy'>Apply Claim Policy</option>
-                            <option name='action_manage_claims' disabled='disabled'>Claims</option>
+                            <option name='action_manage_claims'>Claims</option>
                             <option name='action_view_history'>View History</option>
                         </select>
                     </td>
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 860f82a..b44a53f 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
@@ -578,51 +578,30 @@ function AcqLiTable() {
         var actUnRecv = nodeByName("action_mark_unrecv", row);
         var actUpdateBarcodes = nodeByName("action_update_barcodes", row);
         var actHoldingsMaint = nodeByName("action_holdings_maint", row);
-
         var actNewInvoice = nodeByName('action_new_invoice', row);
         var actLinkInvoice = nodeByName('action_link_invoice', row);
         var actViewInvoice = nodeByName('action_view_invoice', row);
 
+        // always allow access to LI history
         nodeByName('action_view_history', row).onclick = 
             function() { location.href = oilsBasePath + '/acq/lineitem/history/' + li.id(); };
 
-        var state_cell = nodeByName("li_state", row);
-
-        if (li.state() == "cancelled") {
-            if (typeof li.cancel_reason() == "object") {
-                var holds_state = dojo.create(
-                    "span", {
-                        "style": "border-bottom: 1px dashed #000;",
-                        "innerHTML": li.state()
-                    }, state_cell, "only"
-                );
-                new dijit.Tooltip(
-                    {
-                        "label": "<em>" + li.cancel_reason().label() +
-                            "</em><br />" + li.cancel_reason().description(),
-                        "connectId": [holds_state]
-                    }, dojo.create("span", null, state_cell, "last")
-                );
-            } else {
-                state_cell.innerHTML = li.state(); // TODO i18n state labels
-            }
-        } else {
-            state_cell.innerHTML = li.state(); // TODO i18n state labels
-        }
-
-
         /* handle row coloring for based on LI state */
         openils.Util.removeCSSClass(row, /^oils-acq-li-state-/);
         openils.Util.addCSSClass(row, "oils-acq-li-state-" + li.state());
 
-        /* handle links that appear/disappear based on whether LI is received */
-        if (this.isPO) {
-            var self = this;
+        // Expose invoice actions for any lineitem that is linked to a PO 
+        if( li.purchase_order() ) {
+
+            actNewInvoice.disabled = false;
+            actLinkInvoice.disabled = false;
+            actViewInvoice.disabled = false;
 
             actNewInvoice.onclick = function() {
                 location.href = oilsBasePath + '/acq/invoice/view?create=1&attach_li=' + li.id();
                 nodeByName("action_none", row).selected = true;
             };
+
             actLinkInvoice.onclick = function() {
                 if (!self.invoiceLinkDialogManager) {
                     self.invoiceLinkDialogManager =
@@ -632,6 +611,7 @@ function AcqLiTable() {
                 acqLitLinkInvoiceDialog.show();
                 nodeByName("action_none", row).selected = true;
             };
+
             actViewInvoice.onclick = function() {
                 location.href = oilsBasePath +
                     "/acq/search/unified?so=" +
@@ -639,41 +619,70 @@ function AcqLiTable() {
                     "&rt=invoice";
                 nodeByName("action_none", row).selected = true;
             };
+        }
+                
 
-            actNewInvoice.disabled = false;
-            actLinkInvoice.disabled = false;
-            actViewInvoice.disabled = false;
+        /*
+         * If we haven't fleshed the lineitem_details, default to allowing access to the 
+         * holdings maintenence actions.  The alternative is to flesh LIDs on every lineitem, 
+         * but that will add to page render time.  Let's see if this will suffice...
+         */
+        var lids = li.lineitem_details();
+        if( !lids || 
+                (lids && !lids.filter(function(lid) { return lid.eg_copy_id() })[0] )) {
 
-            switch(li.state()) {
-                case "on-order":
-                    actReceive.disabled = false;
-                    actReceive.onclick = function() {
-                        if (self.checkLiAlerts(li.id()))
-                            self.issueReceive(li);
-                        nodeByName("action_none", row).selected = true;
-                    };
-                    return;
+            actUpdateBarcodes.disabled = false;
+            actUpdateBarcodes.onclick = function() {
+                self.showRealCopyEditUI(li);
+                nodeByName("action_none", row).selected = true;
+            }
+            actHoldingsMaint.disabled = false;
+            actHoldingsMaint.onclick = 
+                self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row );
+        }
 
-                case "received":
-                    actUnRecv.disabled = false;
-                    actUnRecv.onclick = function() {
-                        if (confirm(localeStrings.UNRECEIVE_LI))
-                            self.issueReceive(li, /* rollback */ true);
-                        nodeByName("action_none", row).selected = true;
-                    };
-                    // TODO we should allow editing before receipt, in which case the
-                    // test should be "if 1 or more real (acp) copies exist
-                    actUpdateBarcodes.disabled = false;
-                    actUpdateBarcodes.onclick = function() {
-                        self.showRealCopyEditUI(li);
-                        nodeByName("action_none", row).selected = true;
-                    }
-                    actHoldingsMaint.disabled = false;
-                    actHoldingsMaint.onclick = self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row );
+        var state_cell = nodeByName("li_state", row);
 
-                    return;
-            }
+        switch(li.state()) {
+
+            case 'cancelled':
+                if(typeof li.cancel_reason() == "object") {
+                    var holds_state = dojo.create(
+                        "span", {
+                            "style": "border-bottom: 1px dashed #000;",
+                            "innerHTML": li.state()
+                        }, state_cell, "only"
+                    );
+                    new dijit.Tooltip(
+                        {
+                            "label": "<em>" + li.cancel_reason().label() +
+                                "</em><br />" + li.cancel_reason().description(),
+                            "connectId": [holds_state]
+                        }, dojo.create("span", null, state_cell, "last")
+                    );
+                }
+                return; // all done
+
+            case "on-order":
+                actReceive.disabled = false;
+                actReceive.onclick = function() {
+                    if (self.checkLiAlerts(li.id()))
+                        self.issueReceive(li);
+                    nodeByName("action_none", row).selected = true;
+                };
+                break;
+
+            case "received":
+                actUnRecv.disabled = false;
+                actUnRecv.onclick = function() {
+                    if (confirm(localeStrings.UNRECEIVE_LI))
+                        self.issueReceive(li, /* rollback */ true);
+                    nodeByName("action_none", row).selected = true;
+                };
+                break;
         }
+
+        state_cell.innerHTML = li.state(); // TODO i18n state labels
     };
 
 

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

Summary of changes:
 Open-ILS/src/templates/acq/common/li_table.tt2    |    6 +-
 Open-ILS/web/js/ui/default/acq/common/li_table.js |  279 ++++++++++-----------
 2 files changed, 139 insertions(+), 146 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list