[open-ils-commits] r9517 - in branches/acq-experiment/Open-ILS/web:
js/dojo/openils/widget
oilsweb/oilsweb/templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 6 22:55:02 EDT 2008
Author: djfiander
Date: 2008-05-06 22:55:00 -0400 (Tue, 06 May 2008)
New Revision: 9517
Added:
branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
Log:
stage one of editing funds on lineitems
Added: branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js 2008-05-07 02:55:00 UTC (rev 9517)
@@ -0,0 +1,43 @@
+if(!dojo._hasResource["openils.widget.FundSelector"]){
+ dojo._hasResource["openils.widget.FundSelector"] = true;
+ dojo.provide("openils.widget.FundSelector");
+
+ dojo.require("dojox.grid.editors");
+
+ /**
+ * This widget provides a specific selector for selecting
+ * a fund.
+ */
+
+ dojo.declare("openils.widget.FundSelector", dojox.grid.editors.Select, {
+
+ constructor: function(inCell) {
+ console.dir(this);
+ this.store = this.store || this.cell.store;
+ this.identifier = this.identifier || this.cell.identifier || "id";
+ this.name = this.name || this.cell.name || "name";
+ this.options = openils.widget.FundSelector.fundNames;
+ this.values = openils.widget.FundSelector.fundCodes;
+ }
+ });
+
+ openils.widget.FundSelector.fundNames = [];
+ openils.widget.FundSelector.fundCodes = [];
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.fund.org.retrieve'],
+ {
+ async: true,
+ params: [openils.User.authtoken, null, {flesh_summary:1}],
+ oncomplete: function (r) {
+ var msg;
+
+ while (msg = r.recv()) {
+ var f = msg.content();
+ openils.widget.FundSelector.fundNames.push(f.name());
+ openils.widget.FundSelector.fundCodes.push(f.id());
+ }
+ }
+ }
+ );
+}
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-05-07 02:08:33 UTC (rev 9516)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-05-07 02:55:00 UTC (rev 9517)
@@ -63,9 +63,11 @@
<div jsid='pickListGrid' dojoType='dojox.Grid'
id="oils-acq-picklist-grid"> </div>
<script type="text/javascript" src="/js/dojo/openils/acq/Lineitems.js"></script>
+ <script type="text/javascript" src="/js/dojo/openils/widget/FundSelector.js"></script>
<script type="text/javascript">
dojo.require("openils.acq.Picklist");
-// dojo.require("openils.acq.Lineitems");
+ dojo.require("openils.acq.Lineitems");
+// dojo.require("openils.widget.FundSelector");
dojo.require('dojo.data.ItemFileReadStore');
var picklistLayout = [{
@@ -80,7 +82,9 @@
var lineitemLayout = [{ cells: [[
{name:"ID", field:"id"},
- {name:"Fund", get:getLIDFundName},
+ {name:"Fund", field:"fund",
+ editor: openils.widget.FundSelector,
+ get:getLIDFundName},
{name:"Location", get:getLIDLibName} ]] }];
openils.acq.Picklist.createStore(${c.oils.acq.picklist.value.id()},
More information about the open-ils-commits
mailing list