[open-ils-commits] r9408 - branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 21 14:21:26 EDT 2008


Author: erickson
Date: 2008-04-21 13:42:22 -0400 (Mon, 21 Apr 2008)
New Revision: 9408

Modified:
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html
Log:
for now, alerting event when funding source cannot be retrieved

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html	2008-04-21 17:41:57 UTC (rev 9407)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html	2008-04-21 17:42:22 UTC (rev 9408)
@@ -8,12 +8,15 @@
     <div id='oils-acq-list-header-label'>${_('Funding Sources')}</div>
 </div>
 
+<script src='list_funding_sources.js'> </script>
+
 <script type="text/javascript">
     dojo.require("dijit.Dialog");
     dojo.require("dijit.form.FilteringSelect");
     dojo.require('openils.acq.FundingSource');
     dojo.require('openils.Event');
     dojo.require('openils.acq.CurrencyType');
+    dojo.require('openils.widget.OrgUnitFilteringSelect');
 
     function createFS(fields) {
         /** Creates a new funding source */
@@ -53,9 +56,10 @@
                     </td>
                 </tr>
                 <tr>
-                    <td><label for="owner">${_('Owning Location:')} </label></td>
+                    <td valign='top'><label for="owner">${_('Owning Location:')}</label></td>
                     <td>
-                        <div id='oils-acq-funding_source-owner-tree'> </div>
+                        <input dojoType="openils.widget.OrgUnitFilteringSelect" jsId='fsOwnerSelect'
+                            searchAttr="shortname" name="owner" autocomplete="true" labelAttr='shortname'> </input>
                     </td>
                 </tr>
                 <tr>
@@ -92,37 +96,12 @@
         );
     }
 
-    function loadPermOrgs() {
-        var ses = new OpenSRF.ClientSession('open-ils.actor');
-        var req = ses.request(
-            'open-ils.actor.user.work_perm.org_unit_list',
-            openils.User.authtoken, 'ADMIN_FUNDING_SOURCE');
-
-        req.oncomplete = function(r) {
-            var orgList = r.recv().content();
-            var store = new dojo.data.ItemFileReadStore({data:aou.toStoreData(orgList)});
-            var model = new dijit.tree.ForestStoreModel({
-                store: store,
-                query: {_top:'true'},
-                childrenAttrs: ["children"],
-                rootLabel : '${_("Location")}'
-            });
-
-            var tree = new dijit.Tree(
-                {model : model},
-                dojo.byId('oils-acq-funding_source-owner-tree')
-            );
-            dojo.connect(tree, 'onClick', function(item) {tree.selected = item.id[0]});
-            tree.startup()
-        }
-        req.send();
-    }
-
     function loadFSGrid() {
         openils.User.getBySession();
         loadCurrencyTypes();
-        loadPermOrgs();
 
+        openils.User.buildPermOrgSelector('ADMIN_FUNDING_SOURCE', fsOwnerSelect);
+
         function getOrgInfo(rowIndex) {
             data = fundingSourceListGrid.model.getRow(rowIndex);
             if(!data) return;



More information about the open-ils-commits mailing list