From: erickson Date: Tue, 17 Mar 2009 14:53:33 +0000 (+0000) Subject: display localized labels for li attrs. added button to return to li list X-Git-Tag: sprint4-merge-nov22~10492 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8722b6374ef5f28d00799ac2bc2d3c0c6f16994f;p=working%2FEvergreen.git display localized labels for li attrs. added button to return to li list git-svn-id: svn://svn.open-ils.org/ILS/trunk@12558 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/css/skin/default/acq.css b/Open-ILS/web/css/skin/default/acq.css index 02e9c9cde9..09b612fb41 100644 --- a/Open-ILS/web/css/skin/default/acq.css +++ b/Open-ILS/web/css/skin/default/acq.css @@ -97,4 +97,5 @@ #acq-lit-table td {padding:2px;} .acq-lit-row { border-bottom: 1px solid #AAA; } .acq-lit-alt-row td:first-child { width:30px; } +#acq-lit-info-tbody td {padding:5px;} 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 5abe5d80fe..47e049560a 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 @@ -12,6 +12,7 @@ function AcqLiTable() { this.rowTemplate = this.tbody.removeChild(dojo.byId('acq-lit-row')); this.authtoken = openils.User.authtoken; dojo.byId('acq-lit-select-toggle').onclick = function(){self.toggleSelect()}; + dojo.byId('acq-lit-info-back-button').onclick = function(){self.showTable()}; this.reset = function() { while(self.tbody.childNodes[0]) @@ -76,9 +77,13 @@ function AcqLiTable() { }; this.drawInfo = function(liId) { - //if(!this.liAttrDefs) - this.showInfo(); + openils.acq.Lineitem.fetchAttrDefs( + function() { self._fetchLineitem(liId); } + ); + }; + + this._fetchLineitem = function(liId) { fieldmapper.standardRequest( ['open-ils.acq', 'open-ils.acq.lineitem.retrieve'], { async: true, @@ -102,10 +107,20 @@ function AcqLiTable() { this.infoTbody = dojo.byId('acq-lit-info-tbody'); if(!this.infoRow) this.infoRow = this.infoTbody.removeChild(dojo.byId('acq-lit-info-row')); + while(this.infoTbody.childNodes[0]) + this.infoTbody.removeChild(this.infoTbody.childNodes[0]); for(var i = 0; i < li.attributes().length; i++) { var attr = li.attributes()[i]; var row = this.infoRow.cloneNode(true); - dojo.query('[name=label]', row)[0].appendChild(document.createTextNode(attr.attr_name())); + + var type = attr.attr_type().replace(/lineitem_(.*)_attr_definition/, '$1'); + var name = openils.acq.Lineitem.attrDefs[type].filter( + function(a) { + return (a.code() == attr.attr_name()); + } + ).pop().description(); + + dojo.query('[name=label]', row)[0].appendChild(document.createTextNode(name)); dojo.query('[name=value]', row)[0].appendChild(document.createTextNode(attr.attr_value())); this.infoTbody.appendChild(row); } diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index 25f41e7058..94ae1252e8 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -36,6 +36,7 @@