acq - action menu cleanup
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 7 Mar 2013 22:58:41 +0000 (17:58 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 7 Mar 2013 23:06:11 +0000 (18:06 -0500)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/acq/common/li_table.tt2
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 0d021e6..a45b00a 100644 (file)
                                         <span name='pl' class='hidden'> | <a title='[% l('Select List') %]' name='pl_link' href='javascript:void(0);'>&#x2756; </a></span>
                                         <span name='po' class='hidden'> | <a title='[% l('Purchase Order') %]' name='po_link' href='javascript:void(0);'>&#x2318; </a></span>
                                         <span name="show_requests"> | <a title='[% l('Patron Requests') %]' name="show_requests_link" href="javascript:void(0);">[% l('requests') %]</a></span> 
+                                        <span name="invoices_span" class="hidden"> | <a href="javascript:void(0);" name="invoices_link">[% l("view invoice(s)") %] </a></span>
                                         <span name="claim_policy" class="hidden"> | [% l("claim policy:") %] <span name="claim_policy_name"></span></span>
                                         <span name='pro' class='hidden'> | <a title='[% l('Provider') %]' name='pro_link' href='javascript:void(0);'>&#x235F; </a></span>
                                         <span name='queue' class='hidden'> | <a title='[% l('Import Queue') %]' name='queue_link' href='javascript:void(0);'>[% l('&#x27AC; queue') %]</a></span>
                     <td>
                         <select name='actions'>
                             <option name='action_none'>[% l('-- Actions --') %]</option>
-                            <option name='action_mark_recv' disabled='disabled'>[% l('Mark Received') %]</option>
-                            <option name='action_mark_unrecv' disabled='disabled'>[% l('Un-Receive') %]</option>
                             <option name='action_update_barcodes'>[% l('Update Barcodes') %]</option>
                             <option name='action_holdings_maint'>[% l('Holdings Maint.') %]</option>
-                            <option name='action_new_invoice' disabled='disabled'>[% l('New Invoice') %]</option>
-                            <option name='action_link_invoice' disabled='disabled'>[% l('Link to Invoice') %]</option>
-                            <option name='action_view_invoice' disabled='disabled'>[% l('View Invoice(s)') %]</option>
                             <option name='action_manage_claims'>[% l('Claims') %]</option>
                             <option name='action_view_history'>[% l('View History') %]</option>
                         </select>
index 62fafa1..41c0c95 100644 (file)
@@ -662,13 +662,8 @@ function AcqLiTable() {
     this.updateLiState = function(li, row) {
         if (!row) row = this._findLiRow(li);
 
-        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);
 
         // always allow access to LI history
         nodeByName('action_view_history', row).onclick = 
@@ -679,33 +674,16 @@ function AcqLiTable() {
         openils.Util.addCSSClass(row, "oils-acq-li-state-" + li.state());
 
         // 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 =
-                        new InvoiceLinkDialogManager("li");
-                }
-                self.invoiceLinkDialogManager.target = li;
-                acqLitLinkInvoiceDialog.show();
-                nodeByName("action_none", row).selected = true;
-            };
-
-            actViewInvoice.onclick = function() {
-                location.href = oilsBasePath +
-                    "/acq/search/unified?so=" +
-                    base64Encode({"jub":[{"id": li.id()}]}) +
-                    "&rt=invoice";
-                nodeByName("action_none", row).selected = true;
+        if (li.purchase_order()) {
+            /* XXX LFW change to be link thing */
+            openils.Util.show(nodeByName("invoices_span", row), "inline");
+            var link = nodeByName("invoices_link", row);
+            link.onclick = function() {
+                openils.XUL.newTabEasy(
+                    oilsBasePath + "/acq/search/unified?so=" +
+                    base64Encode({"jub":[{"id": li.id()}]}) + "&rt=invoice"
+                );
+                return false;
             };
         }
                 
@@ -752,21 +730,9 @@ function AcqLiTable() {
                 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;
         }