--- /dev/null
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008 Georgia Public Library Service
+ * Bill Erickson <erickson@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();
+ }
+}
+
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008 Georgia Public Library Service
+ * Bill Erickson <erickson@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');
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008 Georgia Public Library Service
+ * Bill Erickson <erickson@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');
+/* ---------------------------------------------------------------------------
+ * Copyright (C) 2008 Georgia Public Library Service
+ * Bill Erickson <erickson@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');
<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>
dojo.require("dojox.grid.Grid");
dojo.require("dojox.grid._data.model");
dojo.require("fieldmapper.dojoData");
+ dojo.require("fieldmapper.OrgUtils");
</script>
</%def>
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(
<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>
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) {
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();
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) {