[open-ils-commits] r10327 -
branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 11 09:21:28 EDT 2008
Author: erickson
Date: 2008-08-11 09:21:27 -0400 (Mon, 11 Aug 2008)
New Revision: 10327
Added:
branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/LineitemAttr.js
Log:
code for handling different types of lineitem attributes
Added: branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/LineitemAttr.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/LineitemAttr.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/acq/LineitemAttr.js 2008-08-11 13:21:27 UTC (rev 10327)
@@ -0,0 +1,55 @@
+/* ---------------------------------------------------------------------------
+ * 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.LineitemAttr']) {
+dojo._hasResource['openils.acq.LineitemAttr'] = true;
+dojo.provide('openils.acq.LineitemAttr');
+dojo.require('fieldmapper.dojoData');
+dojo.require('openils.User');
+dojo.require('openils.Event');
+
+/** Declare the LineitemAttr class with dojo */
+dojo.declare('openils.acq.LineitemAttr', null, {});
+
+/** Pile of static methods for handling the different types of
+ * lineitem attributes and definitions
+ */
+
+
+/**
+ * Creates a set of attr definition stores, one per definition type.
+ */
+openils.acq.LineitemAttr.createAttrDefStores = function(onload) {
+ function process(r) {
+ var res = r.recv().content();
+ openils.Event.parse_and_raise(res);
+ var stores = {};
+ stores.marc = acqlimad.toStoreData(res.marc);
+ stores.usr = acqliuad.toStoreData(res.usr);
+ stores.local = acqlilad.toStoreData(res.local);
+ stores.generated = acqligad.toStoreData(res.generated);
+ stores.provider = acqlipad.toStoreData(res.provider);
+ onload(stores);
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem_attr_definition.retrieve.all'],
+ { async: true,
+ params: [openils.User.authtoken],
+ oncomplete: process
+ }
+ );
+}
+}
More information about the open-ils-commits
mailing list