From 77cc15fcfec7a9b9803401d8130822167558d460 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 7 Mar 2013 17:58:41 -0500 Subject: [PATCH] acq - action menu cleanup Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/templates/acq/common/li_table.tt2 | 6 +-- Open-ILS/web/js/ui/default/acq/common/li_table.js | 54 +++++------------------ 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2 index 59165363ac..157d60ccf4 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -142,6 +142,7 @@ | [% l('requests') %] + @@ -161,13 +162,8 @@ 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 02353b068f..303883ad9f 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 @@ -898,13 +898,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 = @@ -915,33 +910,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; }; } @@ -988,21 +966,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; } -- 2.11.0