From b1ac245da85b3ddd669f46b739ddcb3159b4b0b4 Mon Sep 17 00:00:00 2001 From: djfiander Date: Wed, 28 May 2008 02:13:44 +0000 Subject: [PATCH] Can now edit owning lib of acqlids git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9713 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/acq/Lineitems.js | 2 ++ Open-ILS/web/js/dojo/openils/editors.js | 14 ++++++++++++++ .../oilsweb/templates/oils/default/common/jubgrid.html | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/dojo/openils/acq/Lineitems.js b/Open-ILS/web/js/dojo/openils/acq/Lineitems.js index 3c0e5c169e..e643db33af 100644 --- a/Open-ILS/web/js/dojo/openils/acq/Lineitems.js +++ b/Open-ILS/web/js/dojo/openils/acq/Lineitems.js @@ -100,6 +100,8 @@ openils.acq.Lineitems.alertOnSet = function(griditem, attr, oldVal, newVal) { if (attr == "fund") { item.fund(newVal); + } else if (attr == "owning_lib") { + item.owning_lib(newVal); } else { alert("Unexpected attr in Lineitems.alertOnSet: '"+attr+"'"); return; diff --git a/Open-ILS/web/js/dojo/openils/editors.js b/Open-ILS/web/js/dojo/openils/editors.js index 981bf7cb46..b0db5cdc8a 100644 --- a/Open-ILS/web/js/dojo/openils/editors.js +++ b/Open-ILS/web/js/dojo/openils/editors.js @@ -7,6 +7,9 @@ dojo.require("dojox.grid._data.editors"); dojo.require("dijit.form.NumberSpinner"); dojo.require('dijit.form.FilteringSelect'); +dojo.require("openils.widget.FundSelector"); +dojo.require("openils.widget.OrgUnitFilteringSelect"); + dojo.declare("openils.editors.NumberSpinner", dojox.grid.editors.Dijit, { editorClass: "dijit.form.NumberSpinner", @@ -35,4 +38,15 @@ dojo.declare('openils.editors.FundSelectEditor', dojox.grid.editors.Dijit, { }, }); +dojo.declare('openils.editors.OrgUnitSelectEditor', dojox.grid.editors.Dijit, { + editorClass: "openils.widget.OrgUnitFilteringSelect", + createEditor: function(inNode, inDatum, inRowIndex) { + var editor = new this.editorClass(this.getEditorProps(inDatum), inNode); + globalUser.buildPermOrgSelector(this.cell.perm || this.perm, + editor); + editor.setValue(inDatum); + return editor; + }, +}); + } 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 151e208e51..c5b47bdbd0 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 @@ -64,7 +64,10 @@ pointing to the JUB model (and store) that you have created. get:JUBGrid.getLIDFundName, editor: openils.editors.FundSelectEditor, }, - {name:"Location", field:"location", get:JUBGrid.getLIDLibName} + {name:"Branch", field:"owning_lib", + get:JUBGrid.getLIDLibName, + editor: openils.editors.OrgUnitSelectEditor + }, ]] }]; -- 2.11.0