[open-ils-commits] r9324 - in branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb: public/oils/media/js/openils/acq templates/oils templates/oils/default/acq/financial

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Apr 13 10:01:44 EDT 2008


Author: erickson
Date: 2008-04-13 09:23:54 -0400 (Sun, 13 Apr 2008)
New Revision: 9324

Added:
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/CurrencyType.js
Modified:
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Fund.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Provider.js
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html
   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/view_funding_source.html
Log:
added some currency_type handling code.  added some copyright headers. moving away from legacy org_utils.js code

Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/CurrencyType.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/CurrencyType.js	                        (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/CurrencyType.js	2008-04-13 13:23:54 UTC (rev 9324)
@@ -0,0 +1,43 @@
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008  Georgia Public Library Service
+ * Bill Erickson <erickson at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ */
+
+if(!dojo._hasResource["openils.acq.CurrencyType"]) {
+
+    dojo._hasResource["openils.acq.CurrencyType"] = true;
+    dojo.provide("openils.acq.CurrencyType");
+    dojo.declare('openils.acq.CurrencyType', null, {
+    });
+
+    openils.acq.CurrencyType.cache = {};
+
+    /**
+     * Retrieves all of the currency types
+     */
+    openils.acq.CurrencyType.fetchAll = function(onComplete) {
+        var req = new OpenSRF.ClientSession('open-ils.acq').request(
+            'open-ils.acq.currency_type.all.retrieve', oilsAuthtoken);
+
+        req.oncomplete = function(r) {
+            var msg = r.recv();
+            var types = msg.content();
+            for(var i in types) 
+                openils.acq.CurrencyType.cache[types[i].code()] = types[i];
+            onComplete(types);
+        }
+        req.send();
+    }
+}
+

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Fund.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Fund.js	2008-04-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Fund.js	2008-04-13 13:23:54 UTC (rev 9324)
@@ -1,3 +1,19 @@
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008  Georgia Public Library Service
+ * Bill Erickson <erickson at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ */
+
 if(!dojo._hasResource['openils.acq.Fund']) {
 dojo._hasResource['openils.acq.Fund'] = true;
 dojo.provide('openils.acq.Fund');

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js	2008-04-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/FundingSource.js	2008-04-13 13:23:54 UTC (rev 9324)
@@ -1,3 +1,19 @@
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008  Georgia Public Library Service
+ * Bill Erickson <erickson at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ */
+
 if(!dojo._hasResource['openils.acq.FundingSource']) {
 dojo._hasResource['openils.acq.FundingSource'] = true;
 dojo.provide('openils.acq.FundingSource');

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Provider.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Provider.js	2008-04-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/js/openils/acq/Provider.js	2008-04-13 13:23:54 UTC (rev 9324)
@@ -1,3 +1,19 @@
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008  Georgia Public Library Service
+ * Bill Erickson <erickson at esilibrary.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ---------------------------------------------------------------------------
+ */
+
 if(!dojo._hasResource['openils.acq.Provider']) {
 dojo._hasResource['openils.acq.Provider'] = true;
 dojo.provide('openils.acq.Provider');

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html	2008-04-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/base.html	2008-04-13 13:23:54 UTC (rev 9324)
@@ -46,7 +46,6 @@
     <script src='${c.oils.core.media_prefix.value}/js/openils/fmall.js'> </script>
     <script src='${c.oils.core.media_prefix.value}/js/openils/fmgen.js'> </script>
     <script src='${c.oils.core.media_prefix.value}/js/openils/OrgTree.js'> </script>
-    <script src='${c.oils.core.media_prefix.value}/js/openils/org_utils.js'> </script>
 
     <script type="text/javascript" src="${c.oils.core.media_prefix.value}/js/dojo/dojo/dojo.js"
         djConfig="parseOnLoad: true"></script>
@@ -65,6 +64,7 @@
         dojo.require("dojox.grid.Grid");
         dojo.require("dojox.grid._data.model");
         dojo.require("fieldmapper.dojoData");
+        dojo.require("fieldmapper.OrgUtils");
     </script>
 </%def>
 

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-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html	2008-04-13 13:23:54 UTC (rev 9324)
@@ -12,6 +12,8 @@
     dojo.require("dijit.Dialog");
     dojo.require("dijit.form.FilteringSelect");
     dojo.require('openils.acq.FundingSource');
+    dojo.require('openils.Event');
+    dojo.require('openils.acq.CurrencyType');
     function createFS(fields) {
         /** Creates a new funding source */
         openils.acq.FundingSource.create(
@@ -36,7 +38,7 @@
                 <tr>
                     <td><label for="loc">${_('Owning Location:')} </label></td>
                     <td>
-                        <select name="owner" dojoType="dijit.form.FilteringSelect" autocomplete="false" >
+                        <select jsId='fsOwnerSelect' name="owner" dojoType="dijit.form.FilteringSelect" autocomplete="false" >
                             <!-- XXX get orgs from DB... -->
                             <option value='2'>SYS1</option>
                             <option value='3'>SYS2</option>
@@ -81,7 +83,7 @@
         function getOrgInfo(rowIndex) {
             data = fundingSourceListGrid.model.getRow(rowIndex);
             if(!data) return;
-            return findOrgUnit(data.owner).name(); /* XXX show shortname by default, but needs fetching */
+            return fieldmapper.aou.findOrgUnit(data.owner).shortname();
         }
 
         function getBalanceInfo(rowIndex) {
@@ -109,7 +111,8 @@
         openils.acq.FundingSource.createStore(
             function(storeData) {
                 var store = new dojo.data.ItemFileWriteStore({data:storeData});
-                var model = new dojox.grid.data.DojoData(null, store, {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
+                var model = new dojox.grid.data.DojoData(null, store, 
+                    {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
                 fundingSourceListGrid.setStructure(gridStructure);
                 fundingSourceListGrid.setModel(model);
                 fundingSourceListGrid.update();

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html	2008-04-13 13:07:53 UTC (rev 9323)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html	2008-04-13 13:23:54 UTC (rev 9324)
@@ -48,7 +48,7 @@
     function getOrgInfo(rowIndex) {
         data = fundingSourceGrid.model.getRow(rowIndex);
         if(!data) return;
-        return findOrgUnit(data.owner).name(); /* XXX show shortname by default, but needs fetching */
+        return fieldmapper.aou.findOrgUnit(data.owner).shortname();
     }
 
     function getSummaryInfo(rowIndex) {



More information about the open-ils-commits mailing list