[open-ils-commits] r9487 -
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 29 21:07:26 EDT 2008
Author: djfiander
Date: 2008-04-29 20:27:17 -0400 (Tue, 29 Apr 2008)
New Revision: 9487
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
Log:
Pretty display of fund names instead of fund IDs
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-04-29 17:50:09 UTC (rev 9486)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-04-30 00:27:17 UTC (rev 9487)
@@ -12,18 +12,29 @@
<script type="text/javascript">
dojo.require("dijit.layout.SplitContainer")
dojo.require('openils.acq.Picklist');
+ // For decoding fund IDs into names
+ dojo.require("openils.acq.Fund");
</script>
<script type='text/javascript'>
function getJUBTitle(rowIndex) {
- data = pickListGrid.model.getRow(rowIndex);
+ var data = pickListGrid.model.getRow(rowIndex);
if (!data) return '';
return openils.acq.Picklist.find_attr(data.id, "title", "lineitem_marc_attr_definition")
}
function getJUBPrice(rowIndex) {
- data = pickListGrid.model.getRow(rowIndex);
+ var data = pickListGrid.model.getRow(rowIndex);
if (!data) return;
return openils.acq.Picklist.find_attr(data.id, "price", "lineitem_marc_attr_definition")
}
+ function getLIDFundName(rowIndex) {
+ var data = lineItemGrid.model.getRow(rowIndex);
+ if (!data) return;
+ try {
+ return openils.acq.Fund.retrieve(data.fund).name();
+ } catch (evt) {
+ return data.fund;
+ }
+ }
</script>
</%def>
<%def name="page_title()">${_('Picklist')}</%def>
@@ -57,9 +68,9 @@
}];
var lineitemLayout = [{ cells: [[
- {name:'ID', field:'id'},
- {name:'Fund', field:'fund'},
- {name:'Location', field:'location'} ]] }];
+ {name:"ID", field:"id"},
+ {name:"Fund", get:getLIDFundName},
+ {name:"Location", field:"location"} ]] }];
openils.acq.Picklist.createStore(${c.oils.acq.picklist.value.id()},
function(storeData) {
More information about the open-ils-commits
mailing list