[open-ils-commits] r16138 - in trunk/Open-ILS/web: js/ui/default/acq/common templates/default/acq/common (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Apr 6 10:10:54 EDT 2010


Author: erickson
Date: 2010-04-06 10:10:52 -0400 (Tue, 06 Apr 2010)
New Revision: 16138

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
   trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
Moved lineitem actions into drop-down widget to prevent horizontal crowding

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-04-05 20:23:54 UTC (rev 16137)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-04-06 14:10:52 UTC (rev 16138)
@@ -304,10 +304,15 @@
         if (typeof(row) == "undefined")
             row = dojo.query('tr[li="' + li.id() + '"]', "acq-lit-tbody")[0];
 
-        var recv_link = nodeByName("receive_link", row);
-        var unrecv_link = nodeByName("unreceive_link", row);
-        var real_copies_link = nodeByName("real_copies_link", row);
-        var holdings_maintenance_link = nodeByName("holdings_maintenance_link", row);
+        var actReceive = nodeByName("action_mark_recv", row);
+        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);
+
         var state_cell = nodeByName("li_state", row);
 
         if (li.state() == "cancelled") {
@@ -342,36 +347,50 @@
             var self = this;
             switch(li.state()) {
                 case "on-order":
-                    openils.Util.hide(real_copies_link);
-                    openils.Util.hide(unrecv_link);
-                    openils.Util.show(recv_link, "inline");
-                    recv_link.onclick = function() {
+                    actReceive.disabled = false;
+                    actReceive.onclick = function() {
                         if (self.checkLiAlerts(li.id()))
                             self.issueReceive(li);
+                        nodeByName("action_none", row).selected = true;
                     };
                     return;
                 case "received":
-                    openils.Util.hide(recv_link);
-                    openils.Util.show(unrecv_link, "inline");
-                    unrecv_link.onclick = function() {
+                    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
-                    openils.Util.show(real_copies_link, "inline");
-                    real_copies_link.onclick = function() {
+                    actUpdateBarcodes.disabled = false;
+                    actUpdateBarcodes.onclick = function() {
                         self.showRealCopyEditUI(li);
+                        nodeByName("action_none", row).selected = true;
                     }
-                    openils.Util.show(holdings_maintenance_link, "inline");
-                    holdings_maintenance_link.onclick = self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser' );
+                    actHoldingsMaint.disabled = false;
+                    actHoldingsMaint.onclick = self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row );
+
+                    actNewInvoice.disabled = false;
+                    actLinkInvoice.disabled = false;
+                    actViewInvoice.disabled = false;
+
+                    actNewInvoice.onclick = function() {
+                        location.href = oilsBasePath + '/acq/invoice/attach?create=1&attach_li=' + li.id();
+                        nodeByName("action_none", row).selected = true;
+                    };
+                    actLinkInvoice.onclick = function() {
+                        // TODO: show inv #/vendor entry then relocate to invoice attach page
+                        nodeByName("action_none", row).selected = true;
+                    };
+                    actViewInvoice.onclick = function() {
+                        // TODO: go to invoice search page, with lineitem filter = li.id()
+                        nodeByName("action_none", row).selected = true;
+                    };
+
                     return;
             }
         }
-
-        openils.Util.hide(recv_link);
-        openils.Util.hide(unrecv_link);
-        openils.Util.hide(real_copies_link);
     };
 
 
@@ -696,7 +715,7 @@
         }
     };
 
-    this.generateMakeRecTab = function(bib_id,default_view) {
+    this.generateMakeRecTab = function(bib_id,default_view, row) {
         return function() {
             xulG.new_tab(
                 XUL_OPAC_WRAPPER,
@@ -709,6 +728,8 @@
                     default_view : default_view
                 }
             );
+
+            if(row) nodeByName("action_none", row).selected = true;
         }
     };
 

Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2010-04-05 20:23:54 UTC (rev 16137)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2010-04-06 14:10:52 UTC (rev 16138)
@@ -58,12 +58,11 @@
                 <tr>
                     <td><span><a id='acq-lit-select-toggle' href='javascript:void(0);'>&#x2713</a></span></td>
                     <td>Line Items</td>
-                    <td></td>
-                    <td></td>
                     <td>Items</td>
                     <td>Notes</td>
+                    <td>Actions</td>
                     <td>Status</td>
-                    <td>Price</td>
+                    <td>Estimated Price</td>
                 </tr>
             </tbody>
             <tbody id='acq-lit-tbody'>
@@ -97,13 +96,22 @@
                             </tbody>
                         </table>
                     </td>
-                    <td><a class='hidden' name='real_copies_link' href='javascript:void(0);'>Update&nbsp;Barcodes</a>&nbsp;&nbsp;<a class='hidden' name='holdings_maintenance_link' href='javascript:void(0);'>Holdings&nbsp;Maintenance</a></td>
-                    <td><a name='receive_link' href='javascript:void(0);'>Mark&nbsp;Received</a><a name='unreceive_link' href='javascript:void(0);'>Un-Receive</a></td>
-                    </td>
                     <td><a name='copieslink' href='javascript:void(0);'>Copies(<span name='count'>0</span>)</a></td>
                     <td>
                         <a name='noteslink' href='javascript:void(0);'>Notes(<span name='notes_count'>0</span>)</a><span name="notes_alert_flag"></span>
                     </td>
+                    <td>
+                        <select name='actions'>
+                            <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_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>
+                        </select>
+                    </td>
                     <td><span name='li_state'></span></td>
                     <td><input type='text' size='8' name='price'/></td>
                 </tr>



More information about the open-ils-commits mailing list