[open-ils-commits] r9573 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq
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
Tue May 13 09:50:08 EDT 2008
Author: erickson
Date: 2008-05-13 09:50:06 -0400 (Tue, 13 May 2008)
New Revision: 9573
Added:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/navigate.js
Log:
PO search interface
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js 2008-05-13 13:50:06 UTC (rev 9573)
@@ -0,0 +1,44 @@
+dojo.require('dijit.form.Form');
+dojo.require('dijit.form.Button');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.NumberTextBox');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.acq.Provider');
+
+function doSearch(fields) {
+ var itemList = [];
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.purchase_order.search'],
+ {
+ async:1,
+ params: [openils.User.authtoken, fields],
+ onresponse : function(r) {
+ var msg = r.recv();
+ if(msg) itemList.push(msg.content());
+ },
+ oncomplete : function(r) {
+ dojo.style('po-grid', 'visibility', 'visible');
+ var store = new dojo.data.ItemFileReadStore({data:acqpo.toStoreData(itemList)});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+ poGrid.setModel(model);
+ poGrid.update();
+ },
+ }
+ );
+}
+
+function loadForm() {
+
+ /* load the providers */
+ openils.acq.Provider.createStore(
+ function(store) {
+ providerSelector.store =
+ new dojo.data.ItemFileReadStore({data:store});
+ },
+ 'MANAGE_PROVIDER'
+ );
+}
+
+dojo.addOnLoad(loadForm);
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/navigate.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/navigate.js 2008-05-13 13:28:06 UTC (rev 9572)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/navigate.js 2008-05-13 13:50:06 UTC (rev 9573)
@@ -2,4 +2,9 @@
label : '${_("Manage")}',
id : 'acq-po-list',
dest : 'acq/po/list'
+},
+{
+ label : '${_("Search")}',
+ id : 'acq-po-search',
+ dest: 'acq/po/search'
}
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html 2008-05-13 13:50:06 UTC (rev 9573)
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+<%inherit file='../base.html'/>
+<%def name="page_title()">${_('PO Search')}</%def>
+<%def name="block_content()">
+
+<div id='oils-acq-list-header' class='container'>
+ <div id='oils-acq-list-header-label'>${_('PO Search')}</div>
+</div>
+
+<!-- load the page-specific JS -->
+<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/po/search.js'> </script>
+
+
+<form dojoType='dijit.form.Form' action='' method=''>
+ <script type="dojo/method" event="onSubmit">
+ fields = this.getValues();
+ if(fields.provider == '')
+ delete fields.provider;
+ if(isNaN(fields.id))
+ delete fields.id;
+ doSearch(fields);
+ return false; /* don't redirect */
+ </script>
+ <label for='id'>${_('ID')}</label>
+ <input dojoType='dijit.form.NumberTextBox' name='id'> </input>
+ <label for='provider'>${_('Provider')}</label>
+ <select name='provider' style='overflow-y:auto;' jsId="providerSelector" dojoType="dijit.form.FilteringSelect"> </select>
+ <div dojoType='dijit.form.Button' type='submit'>${_("Search")}</div>
+</form>
+
+<script>
+ var poGridStructure = [{
+ cells : [[
+ {name: '${_("ID")}', field: 'id'},
+ {name: '${_("Owner")}', field:'owner'},
+ {name: '${_("Ordering Agency")}', field: "ordering_agency"},
+ {name: '${_("Create Time")}', field:'create_time'},
+ {name: '${_("Edit Time")}', field: "edit_time"},
+ {name: '${_("Provider")}', field:'provider'},
+ {name: '${_("State")}', field:'state'}
+ ]]
+ }];
+</script>
+<div jsId='poGrid' id='po-grid' dojoType="dojox.Grid" structure='poGridStructure'></div>
+<script>dojo.style('po-grid', 'visibility', 'hidden');</script>
+
+</%def>
+
+
More information about the open-ils-commits
mailing list