From 41a7bcb782ce04cefa77776fea783b48cf388766 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 21 Jul 2010 21:16:59 +0000 Subject: [PATCH] pushed view-in-catalog link up to the main lineitem display. moved pl/po/worksheet/catalog links to a row of their own for a more consistent location (visually). replaced 'PO:' 'PL:' with small icons to easier catch the eye; added 'worksheet' tag to the worksheet icon for clarity TODO: plug in bib discovery and linking mechanism for freerange lineitems git-svn-id: svn://svn.open-ils.org/ILS/trunk@17004 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/js/ui/default/acq/common/li_table.js | 41 ++++++++----------- .../web/templates/default/acq/common/info.tt2 | 3 -- .../templates/default/acq/common/li_table.tt2 | 16 +++++--- 3 files changed, 28 insertions(+), 32 deletions(-) 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 abeb2ae60c..c86523751c 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 @@ -274,6 +274,14 @@ function AcqLiTable() { ); } + if(li.eg_bib_id()) { + openils.Util.show(nodeByName('catalog', row), 'inline'); + nodeByName("catalog_link", row).onclick = this.generateMakeRecTab(li.eg_bib_id()); + } else { + // TODO: Add discovery mechanism for bib linking + openils.Util.show(nodeByName('link_to_catalog', row), 'inline'); + } + nodeByName("worksheet_link", row).href = oilsBasePath + "/acq/lineitem/worksheet/" + li.id(); @@ -305,7 +313,7 @@ function AcqLiTable() { openils.Util.show(nodeByName('po', row), 'inline'); var link = nodeByName('po_link', row); link.setAttribute('href', oilsBasePath + '/acq/po/view/' + li.purchase_order()); - link.innerHTML = 'PO: ' + po.name(); // TODO i18n + link.innerHTML += po.name(); } } @@ -318,13 +326,16 @@ function AcqLiTable() { ['open-ils.acq', 'open-ils.acq.picklist.retrieve'], {params: [this.authtoken, li.picklist()]}); if (pl) { - if (pl.name() == "") + if (pl.name() == "") { openils.Util.show(nodeByName("bib_origin", row), "inline"); - openils.Util.show(nodeByName('pl', row), 'inline'); - var link = nodeByName('pl_link', row); - link.setAttribute('href', oilsBasePath + '/acq/picklist/view/' + li.picklist()); - link.innerHTML = 'PL: '+pl.name(); // TODO i18n + } else { + + openils.Util.show(nodeByName('pl', row), 'inline'); + var link = nodeByName('pl_link', row); + link.setAttribute('href', oilsBasePath + '/acq/picklist/view/' + li.picklist()); + link.innerHTML += pl.name(); + } } } @@ -839,24 +850,6 @@ function AcqLiTable() { oilsBasePath + "/acq/lineitem/related/" + li.id(); } - if(li.eg_bib_id()) { - - openils.Util.show('acq-lit-info-cat-link'); - var link = dojo.byId('acq-lit-info-cat-link').getElementsByTagName('a')[0]; - - if(openils.XUL.isXUL()) { - - link.setAttribute('href', 'javascript:void(0);'); - link.onclick = this.generateMakeRecTab( li.eg_bib_id() ); - - } else { - var href = link.getAttribute('href'); - if(href.match(/=$/)) - link.setAttribute('href', href + li.eg_bib_id()); - } - } else { - openils.Util.hide('acq-lit-info-cat-link'); - } }; this.generateMakeRecTab = function(bib_id,default_view, row) { diff --git a/Open-ILS/web/templates/default/acq/common/info.tt2 b/Open-ILS/web/templates/default/acq/common/info.tt2 index 9284aa65b1..6fc5456339 100644 --- a/Open-ILS/web/templates/default/acq/common/info.tt2 +++ b/Open-ILS/web/templates/default/acq/common/info.tt2 @@ -8,9 +8,6 @@ - [% IF which == "Lit" %]