[open-ils-commits] r12045 - trunk/Open-ILS/web/js/dojo/openils/acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 3 12:33:54 EST 2009
Author: erickson
Date: 2009-02-03 12:33:51 -0500 (Tue, 03 Feb 2009)
New Revision: 12045
Modified:
trunk/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js
Log:
fixed streaming vs. non-streaming logic error in currency_type retrieve. took opportunity to port to pcrud
Modified: trunk/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js 2009-02-03 16:42:14 UTC (rev 12044)
+++ trunk/Open-ILS/web/js/dojo/openils/acq/CurrencyType.js 2009-02-03 17:33:51 UTC (rev 12045)
@@ -19,6 +19,8 @@
dojo._hasResource["openils.acq.CurrencyType"] = true;
dojo.provide("openils.acq.CurrencyType");
dojo.require('openils.User');
+ dojo.require('openils.Util');
+ dojo.require('openils.PermaCrud');
dojo.declare('openils.acq.CurrencyType', null, {
});
@@ -29,19 +31,19 @@
* 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', openils.User.authtoken);
+ var list = [];
+ var pcrud = new openils.PermaCrud();
+ pcrud.retrieveAll('acqct', {
+ async : true,
+ oncomplete : function(r) {
+ var types = openils.Util.readResponse(r);
+ for(var idx in types)
+ openils.acq.CurrencyType.cache[types[idx].code()] = types[idx];
+ onComplete(types);
+ }
+ });
+ };
- 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();
- }
-
openils.acq.CurrencyType.loadSelectWidget = function(selector) {
openils.acq.CurrencyType.fetchAll(
function(ctypes) {
@@ -50,6 +52,6 @@
selector.setValue(ctypes[0].code()); /* XXX get from setting */
}
);
- }
+ };
}
More information about the open-ils-commits
mailing list