[open-ils-commits] r12557 - trunk/Open-ILS/web/js/dojo/openils/acq (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Mar 17 10:53:23 EDT 2009


Author: erickson
Date: 2009-03-17 10:53:21 -0400 (Tue, 17 Mar 2009)
New Revision: 12557

Modified:
   trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
Log:
added attr def fetching function

Modified: trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js	2009-03-17 14:17:55 UTC (rev 12556)
+++ trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js	2009-03-17 14:53:21 UTC (rev 12557)
@@ -24,6 +24,7 @@
 dojo.require('fieldmapper.dojoData');
 dojo.require('openils.User');
 dojo.require('openils.Event');
+dojo.require('openils.Util');
 
 /** Declare the Lineitem class with dojo */
 dojo.declare('openils.acq.Lineitem', null, {
@@ -102,6 +103,25 @@
     },
 });
 
+openils.acq.Lineitem.attrDefs = null;
+
+openils.acq.Lineitem.fetchAttrDefs = function(onload) {
+    if(openils.acq.Lineitem.attrDefs)
+        return onload(openils.acq.Lineitem.attrDefs);
+    fieldmapper.standardRequest(
+        ['open-ils.acq', 'open-ils.acq.lineitem_attr_definition.retrieve.all'],
+        {   async: true, 
+            params: [openils.User.authtoken],
+            oncomplete: function(r) {
+                openils.acq.Lineitem.attrDefs = 
+                    openils.Util.readResponse(r);
+                onload(openils.acq.Lineitem.attrDefs);
+            }
+        }
+    );
+}
+
+
 openils.acq.Lineitem.ModelCache = {};
 openils.acq.Lineitem.acqlidCache = {};
 



More information about the open-ils-commits mailing list