[open-ils-commits] [GIT] Evergreen ILS branch rel_2_4 updated. 72d2ddd5076e72bfc8c3dbf64e3d892e3aa78a38

Evergreen Git git at git.evergreen-ils.org
Thu Jun 20 11:25:55 EDT 2013


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, rel_2_4 has been updated
       via  72d2ddd5076e72bfc8c3dbf64e3d892e3aa78a38 (commit)
      from  711739ce885afc1075408afc34db599d2bfb330c (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 72d2ddd5076e72bfc8c3dbf64e3d892e3aa78a38
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon May 13 13:22:37 2013 -0400

    LP1179609 ACQ lineitem identifier inline update
    
    When the identifier value for a linetiem is changed, apply the change
    and refresh the lineitem in real time instead of requiring users to
    click the 'Apply Lineitem Identifier' link.
    
    The 'Apply Lineitem Identifier' link has also been removed, since it is
    no longer needed.
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>

diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2
index b19e5c3..c6f2908 100644
--- a/Open-ILS/src/templates/acq/common/li_table.tt2
+++ b/Open-ILS/src/templates/acq/common/li_table.tt2
@@ -118,12 +118,6 @@
                     <td><span><a id='acq-lit-select-toggle' href='javascript:void(0);'>&#x2713</a></span></td>
                     <td>
                         [% l('Line Items') %]
-                        <span style='padding-left: 10px;'>
-                            <a href='javascript:;' 
-                                id='acq-lit-apply-idents'>
-                                [% l('Apply Order Identifiers') %]
-                            </a>
-                        </span>
                     </td>
                     <td style='white-space:nowrap;'>
                         <a id='acq-inline-copies-toggle' 
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 7a804da..f007bf6 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
@@ -575,11 +575,30 @@ function AcqLiTable() {
         );
     }
 
+    // fetch an updated copy of the lineitem 
+    // and add it back to the lineitem table
+    this.refreshLineitem = function(li, focus) {
+        var self = this;
+        this._fetchLineitem(li.id(), 
+            function(newLi) {
+                if (focus) {
+                    self.focusLineitem = li.id();
+                } else {
+                    self.focusLineitem = null;
+                }
+                var row = dojo.query('[li='+li.id()+']', self.tbody)[0];
+                var nextSibling = row.nextSibling;
+                self.tbody.removeChild(row);
+                self.addLineitem(newLi, false, nextSibling);
+            }, true
+        );
+    }
+
     /**
      * Inserts a single lineitem into the growing table of lineitems
      * @param {Object} li The lineitem object to insert
      */
-    this.addLineitem = function(li, skip_final_placement) {
+    this.addLineitem = function(li, skip_final_placement, nextSibling) {
         this.liCache[li.id()] = li;
 
         // insert the row right away so that final order isn't
@@ -587,8 +606,15 @@ function AcqLiTable() {
         // for a given line item
         var row = self.rowTemplate.cloneNode(true);
         if (!skip_final_placement) {
-            self.tbody.appendChild(row);
+            if (!nextSibling) {
+                // either no nextSibling was provided or it was null
+                // meaning the row was already at the end of the table
+                self.tbody.appendChild(row);
+            } else {
+                self.tbody.insertBefore(row, nextSibling);
+            }
         }
+
         self.selectors.push(dojo.query('[name=selectbox]', row)[0]);
 
         // sort the lineitem notes on edit_time
@@ -804,7 +830,7 @@ function AcqLiTable() {
     };
 
     // returns true if request was sent
-    this._applyOrderIdentValue = function(li) {
+    this._applyOrderIdentValue = function(li, oncomplete) {
         var self = this;
 
         console.log('applying ident value for lineitem ' + li.id());
@@ -826,8 +852,10 @@ function AcqLiTable() {
             oldIdent.attr_name() == name &&
             oldIdent.attr_value() == val) {
                 console.log('selected ident attr matches existing attr');
-                if (--this._identValuesInFlight == 0) 
-                    location.href = location.href;
+                if (--this._identValuesInFlight == 0) {
+                    if (oncomplete) oncomplete(li);
+                    else location.href = location.href;
+                }
                 return false;
         }
 
@@ -861,8 +889,11 @@ function AcqLiTable() {
                 params : [openils.User.authtoken, args],
                 oncomplete : function() {
                     console.log('order_ident oncomplete');
-                    if (--self._identValuesInFlight == 0) 
-                        location.href = location.href;
+                    if (--self._identValuesInFlight == 0) {
+                        if (oncomplete) oncomplete(li);
+                        else location.href = location.href;
+                    }
+                    console.log(self._identValuesInFlight + ' still in flight');
                 }
             }
         );
@@ -937,8 +968,14 @@ function AcqLiTable() {
             }
         );
 
-        function updateOrderIdent(box) {
-            console.log('updating order ident for box ' + box);
+        function updateOrderIdent(val) {
+            self._identValuesInFlight = 1;
+            self._applyOrderIdentValue(
+                this._lineitem,
+                function(li) {
+                    self.refreshLineitem(li);
+                }
+            );
         }
 
         // replace the ident combobox with a new 

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

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


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list