[open-ils-commits] r9611 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/financial
templates/oils/default/acq/financial
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed May 14 22:29:05 EDT 2008
Author: erickson
Date: 2008-05-14 22:29:04 -0400 (Wed, 14 May 2008)
New Revision: 9611
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html
Log:
added logic to extract the tag and subfield from the xpath for display
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js 2008-05-15 02:12:46 UTC (rev 9610)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/view_provider.js 2008-05-15 02:29:04 UTC (rev 9611)
@@ -8,6 +8,7 @@
dojo.require('openils.User');
var provider = null;
+var marcRegex = /\/\/\*\[@tag="(\d+)"]\/\*\[@code="(\w)"]/;
function getOrgInfo(rowIndex) {
data = providerGrid.model.getRow(rowIndex);
@@ -15,6 +16,19 @@
return fieldmapper.aou.findOrgUnit(data.owner).shortname();
}
+function getTag(rowIdx) {
+ data = padGrid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$1');
+}
+
+function getSubfield(rowIdx) {
+ data = padGrid.model.getRow(rowIdx);
+ if(!data) return;
+ return data.xpath.replace(marcRegex, '$2');
+}
+
+
function loadProviderGrid() {
var store = new dojo.data.ItemFileReadStore({data:acqpro.toStoreData([provider])});
var model = new dojox.grid.data.DojoData(
@@ -22,6 +36,7 @@
providerGrid.setModel(model);
providerGrid.update();
}
+
function loadPADGrid() {
openils.acq.Provider.retrieveLineitemAttrDefs(providerId,
function(attrs) {
@@ -34,6 +49,7 @@
);
}
+
function fetchProvider() {
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.provider.retrieve'],
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html 2008-05-15 02:12:46 UTC (rev 9610)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_provider.html 2008-05-15 02:29:04 UTC (rev 9611)
@@ -72,8 +72,8 @@
{name: '${_("Code")}', field:'code'},
{name: '${_("Description")}', field: "description", width:'auto'},
{name: '${_("XPath")}', field:'xpath', width:'auto'},
- {name: '${_("Tag")}', value:'test'},
- {name: '${_("Subfield")}', value:'test'}
+ {name: '${_("Tag")}', get:getTag},
+ {name: '${_("Subfield")}', get:getSubfield}
]]
}];
</script>
More information about the open-ils-commits
mailing list