From cea8831b1dfdeb7b34f3646b8dd22094b7154ee5 Mon Sep 17 00:00:00 2001 From: djfiander Date: Thu, 22 May 2008 15:40:34 +0000 Subject: [PATCH] Display provider name, fix template to use correct jsid when generating html. git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9663 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../templates/oils/default/common/jubgrid.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html index 38a34c1658..a18485f0c5 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html @@ -43,8 +43,10 @@ pointing to the JUB model (and store) that you have created. dojo.require('dojo.data.ItemFileReadStore'); dojo.require('dijit.layout.SplitContainer'); dojo.require('dojox.grid.Grid'); + dojo.require('openils.editors'); dojo.require('openils.acq.Picklist'); dojo.require("openils.acq.Fund"); + dojo.require('openils.acq.Provider'); dojo.require("openils.acq.Lineitems"); dojo.require("openils.widget.FundSelector"); dojo.require("fieldmapper.OrgUtils"); @@ -60,6 +62,11 @@ pointing to the JUB model (and store) that you have created. if (!data) return; return plist.find_attr(data.id, "price", "lineitem_marc_attr_definition") } + function getJUBProvider(rowIndex) { + var data = ${grid_jsid}.model.getRow(rowIndex); + if (!data || !data.provider) return; + return openils.acq.Provider.retrieve(data.provider).name(); + } function getLIDFundName(rowIndex) { var data = lineItemGrid.model.getRow(rowIndex); if (!data || !data.fund) return; @@ -89,7 +96,8 @@ pointing to the JUB model (and store) that you have created. {name: "ID", field: 'id'}, {name: "Title", width: "50%", get:getJUBTitle}, {name: "Price", get:getJUBPrice}, - {name: "Vendor", field: 'provider'}, + {name: "Vendor", field: 'provider', + get:getJUBProvider}, {name: "# of Copies", field: 'item_count'} ]] }]; @@ -106,15 +114,15 @@ pointing to the JUB model (and store) that you have created. ]] }]; function populateJUBGrid(gridDom, model) { - pickListGrid.setStructure(picklistLayout); - pickListGrid.setModel(model); + ${grid_js_id}.setStructure(picklistLayout); + ${grid_js_id}.setModel(model); dojo.connect(gridDom, "onRowClick", function(evt) { openils.acq.Lineitems.loadGrid( lineItemGrid, model.getRow(evt.rowIndex).id, lineitemLayout); }); - pickListGrid.update(); + ${grid_js_id}.update(); } @@ -127,3 +135,6 @@ pointing to the JUB model (and store) that you have created. + + + -- 2.11.0