[open-ils-commits] r9674 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/po
templates/oils/default/acq/po
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu May 22 16:58:53 EDT 2008
Author: erickson
Date: 2008-05-22 16:58:49 -0400 (Thu, 22 May 2008)
New Revision: 9674
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/view_po.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/view_po.html
Log:
now using common lineitem display
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/view_po.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/view_po.js 2008-05-22 20:21:05 UTC (rev 9673)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/view_po.js 2008-05-22 20:58:49 UTC (rev 9674)
@@ -40,42 +40,6 @@
return dojo.date.locale.format(date, {formatLength:'medium'});
}
-function getLi(id) {
- for(var i in lineitems) {
- var li = lineitems[i];
- if(li.id() == id)
- return li;
- }
-}
-
-function getJUBTitle(rowIndex) {
- var data = liGrid.model.getRow(rowIndex);
- if(!data) return '';
- return new openils.acq.Lineitems(
- {lineitem:getLi(data.id)}).findAttr('title', 'lineitem_marc_attr_definition')
-}
-
-function getJUBIsbn(rowIndex) {
- var data = liGrid.model.getRow(rowIndex);
- if(!data) return '';
- return new openils.acq.Lineitems(
- {lineitem:getLi(data.id)}).findAttr('isbn', 'lineitem_marc_attr_definition')
-}
-
-function getJUBPubdate(rowIndex) {
- var data = liGrid.model.getRow(rowIndex);
- if(!data) return '';
- return new openils.acq.Lineitems(
- {lineitem:getLi(data.id)}).findAttr('pubdate', 'lineitem_marc_attr_definition')
-}
-
-function getJUBPrice(rowIndex) {
- var data = liGrid.model.getRow(rowIndex);
- if(!data) return;
- return new openils.acq.Lineitems(
- {lineitem:getLi(data.id)}).findAttr('price', 'lineitem_marc_attr_definition')
-}
-
function loadPOGrid() {
if(!PO) return;
var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData([PO])});
@@ -94,8 +58,7 @@
var store = new dojo.data.ItemFileReadStore({data:jub.toStoreData(lineitems)});
var model = new dojox.grid.data.DojoData(
null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- liGrid.setModel(model);
- liGrid.update();
+ JUBGrid.populate(liGrid, model, lineitems)
}
fieldmapper.standardRequest(
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/view_po.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/view_po.html 2008-05-22 20:21:05 UTC (rev 9673)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/view_po.html 2008-05-22 20:58:49 UTC (rev 9674)
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
<%inherit file='base.html' />
+<%namespace file='/oils/default/common/jubgrid.html' name='jubgrid'/>
<%def name='page_title()'>${_('View PO')}</%def>
<%def name='block_content()'>
@@ -34,24 +35,9 @@
</script>
<div jsId='poGrid' dojoType="dojox.Grid" structure='poGridStructure'> </div>
</div>
-
<div dojoType="dijit.layout.ContentPane" class='oils-acq-detail-content-pane' title="${_('Line Items')}">
<script type='dojo/connect' event='onShow'>loadLIGrid();</script>
- <script>
- var liGridStructure = [{
- cells: [[
- {name: '${_("ID")}', field: 'id'},
- {name: '${_("Title")}', width: 'auto', get:getJUBTitle},
- {name: '${_("ISBN")}', get:getJUBIsbn},
- {name: '${_("Pubdate")}', get:getJUBPubdate},
- {name: '${_("Price")}', get:getJUBPrice},
- {name: '${_("Vendor")}', get:getProvider},
- {name: '${_("# of Copies")}', field: 'item_count'},
- {name: '${_("State")}', field: 'state'}
- ]]
- }];
- </script>
- <div jsId='liGrid' dojoType="dojox.Grid" structure='liGridStructure'> </div>
+ ${jubgrid.jubgrid('oils-acq-lineitem', 'liGrid')}
</div>
</div>
</div>
More information about the open-ils-commits
mailing list