[open-ils-commits] r12558 - in trunk/Open-ILS/web: css/skin/default js/ui/default/acq/common templates/default/acq/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 17 10:53:35 EDT 2009
Author: erickson
Date: 2009-03-17 10:53:33 -0400 (Tue, 17 Mar 2009)
New Revision: 12558
Modified:
trunk/Open-ILS/web/css/skin/default/acq.css
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
display localized labels for li attrs. added button to return to li list
Modified: trunk/Open-ILS/web/css/skin/default/acq.css
===================================================================
--- trunk/Open-ILS/web/css/skin/default/acq.css 2009-03-17 14:53:21 UTC (rev 12557)
+++ trunk/Open-ILS/web/css/skin/default/acq.css 2009-03-17 14:53:33 UTC (rev 12558)
@@ -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;}
Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-03-17 14:53:21 UTC (rev 12557)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-03-17 14:53:33 UTC (rev 12558)
@@ -12,6 +12,7 @@
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 @@
};
this.drawInfo = function(liId) {
- //if(!this.liAttrDefs)
+ this.showInfo();
+ openils.acq.Lineitem.fetchAttrDefs(
+ function() { self._fetchLineitem(liId); }
+ );
+ };
- this.showInfo();
+ this._fetchLineitem = function(liId) {
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.lineitem.retrieve'],
{ async: true,
@@ -102,10 +107,20 @@
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);
}
Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-17 14:53:21 UTC (rev 12557)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2 2009-03-17 14:53:33 UTC (rev 12558)
@@ -36,6 +36,7 @@
</table>
</div>
<div id='acq-lit-info-div' class='hidden'>
+ <div dojoType='dijit.form.Button' id='acq-lit-info-back-button'>↖ Return</div>
<table>
<tbody id='acq-lit-info-tbody'>
<tr id='acq-lit-info-row'><td name='label'/><td name='value'/></tr>
More information about the open-ils-commits
mailing list