From 755592d396ecb81309dc6c7ffe95fec265cad723 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 0d021e6add..a45b00a48a 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -120,6 +120,7 @@ | [% l('requests') %] + @@ -135,13 +136,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 62fafa1278..41c0c95416 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 @@ -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; } -- 2.11.0