From 8eb3e7b6235ae1ecdc0fb31ef56bb3c46f74739c Mon Sep 17 00:00:00 2001 From: senator Date: Sat, 13 Mar 2010 00:05:41 +0000 Subject: [PATCH] Acq: fix inaccurate word choice in "related lineitems" link; hide when only 1 git-svn-id: svn://svn.open-ils.org/ILS/trunk@15842 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/common/li_table.js | 46 +++++++++++----------- .../web/templates/default/acq/common/detail.tt2 | 2 +- 2 files changed, 25 insertions(+), 23 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 d3af1ed0a..13398e65c 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 @@ -537,26 +537,30 @@ function AcqLiTable() { } this.drawInfo = function(liId) { - if (!this.relCache[liId]) { - fieldmapper.standardRequest( - [ - "open-ils.acq", - "open-ils.acq.lineitems_for_bib.by_lineitem_id.count" - ], { - "async": true, - "params": [openils.User.authtoken, liId], - "onresponse": function(r) { - self.relCache[liId] = openils.Util.readResponse(r); - nodeByName( - "related_number", dojo.byId("acq-lit-info-related") - ).innerHTML = self.relCache[liId]; + if (!this._isRelatedViewer) { + var d = dojo.byId("acq-lit-info-related"); + if (!this.relCache[liId]) { + fieldmapper.standardRequest( + [ + "open-ils.acq", + "open-ils.acq.lineitems_for_bib.by_lineitem_id.count" + ], { + "async": true, + "params": [openils.User.authtoken, liId], + "onresponse": function(r) { + self.relCache[liId] = openils.Util.readResponse(r); + nodeByName("related_number", d).innerHTML = + self.relCache[liId]; + openils.Util[ + self.relCache[liId] >1 ? "show" : "hide" + ](d); + } } - } - ); - } else { - nodeByName( - "related_number", dojo.byId("acq-lit-info-related") - ).innerHTML = this.relCache[liId]; + ); + } else { + nodeByName("related_number", d).innerHTML = this.relCache[liId]; + openils.Util[this.relCache[liId] > 1 ? "show" : "hide"](d); + } } this.show('info'); @@ -629,10 +633,8 @@ function AcqLiTable() { this.infoTbody.appendChild(row); } - var rel_div = dojo.byId("acq-lit-info-related"); - nodeByName("rel_link", rel_div).href = + nodeByName("rel_link", dojo.byId("acq-lit-info-related")).href = "/eg/acq/lineitem/related/" + li.id(); - openils.Util.show(rel_div); } if(li.eg_bib_id()) { diff --git a/Open-ILS/web/templates/default/acq/common/detail.tt2 b/Open-ILS/web/templates/default/acq/common/detail.tt2 index 60188dbfc..9284aa65b 100644 --- a/Open-ILS/web/templates/default/acq/common/detail.tt2 +++ b/Open-ILS/web/templates/default/acq/common/detail.tt2 @@ -13,7 +13,7 @@ [% IF which == "Lit" %]

MARC Order Record

-- 2.11.0