[open-ils-commits] r9722 - in branches/acq-experiment/Open-ILS/web: js/dojo/openils js/dojo/openils/acq oilsweb/oilsweb/templates/oils/default/common

svn at svn.open-ils.org svn at svn.open-ils.org
Wed May 28 19:39:46 EDT 2008


Author: djfiander
Date: 2008-05-28 19:39:46 -0400 (Wed, 28 May 2008)
New Revision: 9722

Modified:
   branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js
   branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Fund.js
   branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
Log:
Move buildPermFundSelector into Fund.js

Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js	2008-05-28 20:44:58 UTC (rev 9721)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/User.js	2008-05-28 23:39:46 UTC (rev 9722)
@@ -43,7 +43,6 @@
             this.location = kwargs.location;
             this.authcookie = kwargs.authcookie || openils.User.authcookie;
 	    this.orgCache = {perm: null, store: null};
-	    this.fundCache = [];
 
             if (this.id && this.authtoken) this.user = this.getById( this.id );
             else if (this.authtoken) this.getBySession();
@@ -258,50 +257,6 @@
 	    }
         },
 
-        /**
-         * Sets the store for an existing openils.widget.FundFilteringSelect 
-         * using the funds where the user has the requested permission.
-         * @param perm The permission to check
-         * @param selector The pre-created dijit.form.FilteringSelect object.  
-         */
-	buildPermFundSelector : function(perm, selector) {
-	    var _u = this;
-
-	    dojo.require('dojo.data.ItemFileReadStore');
-
-	    function hookupStore(store) {
-		selector.store = store;
-                selector.startup();
-	    }
-
-	    function buildPicker(r) {
-		var msg;
-		var fundList = [];
-		while (msg = r.recv()) {
-		    var fund = msg.content();
-		    fundList.push(fund);
-		}
-
-		var store = new dojo.data.ItemFileReadStore({data:acqf.toStoreData(fundList)});
-
-		hookupStore(store);
-		_u.fundCache[perm] = store;
-	    }
-
-	    if (this.fundCache[perm]) {
-		hookupStore(this.fundCache[perm]);
-	    } else {
-		fieldmapper.standardRequest(
-		    ['open-ils.acq', 'open-ils.acq.fund.org.retrieve'],
-                    {   params: [this.authtoken, null, {flesh_summary:1, limit_perm:perm}],
-			oncomplete: buildPicker,
-			async: true
-                    }
-		)
-	    }
-	}
-
-
     });
 
 	openils.User.user = null;

Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Fund.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Fund.js	2008-05-28 20:44:58 UTC (rev 9721)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/Fund.js	2008-05-28 23:39:46 UTC (rev 9722)
@@ -161,4 +161,50 @@
 	openils.acq.Fund.createStore(buildMap);
     }
 };
+
+/**
+  * Sets the store for an existing openils.widget.FundFilteringSelect 
+  * using the funds where the user has the requested permission.
+  * @param perm The permission to check
+  * @param selector The pre-created dijit.form.FilteringSelect object.  
+  */
+
+openils.acq.Fund.storeCache = [];
+
+openils.acq.Fund.buildPermFundSelector = function(perm, selector) {
+    dojo.require('dojo.data.ItemFileReadStore');
+
+    function hookupStore(store) {
+	selector.store = store;
+        selector.startup();
+    }
+
+    function buildPicker(r) {
+	var msg;
+	var fundList = [];
+	while (msg = r.recv()) {
+	    var fund = msg.content();
+	    fundList.push(fund);
+	}
+
+	var store = new dojo.data.ItemFileReadStore({data:acqf.toStoreData(fundList)});
+
+	hookupStore(store);
+	openils.acq.Fund.storeCache[perm] = store;
+    }
+
+    if (openils.acq.Fund.storeCache[perm]) {
+	hookupStore(openils.acq.Fund.storeCache[perm]);
+    } else {
+	fieldmapper.standardRequest(
+	    ['open-ils.acq', 'open-ils.acq.fund.org.retrieve'],
+            {   params: [openils.User.authtoken, null,
+			 {flesh_summary:1, limit_perm:perm}],
+		oncomplete: buildPicker,
+		async: true
+            }
+	)
+    }
 }
+
+}

Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js	2008-05-28 20:44:58 UTC (rev 9721)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/editors.js	2008-05-28 23:39:46 UTC (rev 9722)
@@ -10,6 +10,8 @@
 dojo.require("openils.widget.FundSelector");
 dojo.require("openils.widget.OrgUnitFilteringSelect");
 
+dojo.require("openils.acq.Fund");
+
 dojo.declare("openils.editors.NumberSpinner", dojox.grid.editors.Dijit, {
     editorClass: "dijit.form.NumberSpinner",
 
@@ -32,7 +34,7 @@
     editorClass: "openils.widget.FundSelector",
     createEditor: function(inNode, inDatum, inRowIndex) {
 	var editor = new this.editorClass(this.getEditorProps(inDatum), inNode);
-	globalUser.buildPermFundSelector(this.cell.perm || this.perm,
+	openils.acq.Fund.buildPermFundSelector(this.cell.perm || this.perm,
 					 editor);
 	return editor;
     },

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html	2008-05-28 20:44:58 UTC (rev 9721)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/common/jubgrid.html	2008-05-28 23:39:46 UTC (rev 9722)
@@ -93,7 +93,7 @@
 		     execute="createLID(arguments[0]);">
 		    <script type='dojo/connect' event='onOpen'>
 			globalUser.buildPermOrgSelector('MANAGE_FUND', copyOwnerSelect);
-			globalUser.buildPermFundSelector('MANAGE_FUND', acqlidFund);
+			openils.acq.Fund.buildPermFundSelector('MANAGE_FUND', acqlidFund);
 		    </script>
 		    <table class="dijitTooltipTable">
 			<tr>



More information about the open-ils-commits mailing list