[open-ils-commits] r18799 - in branches/rel_2_0/Open-ILS/web/js: dojo/openils/widget ui/default/acq/invoice ui/default/acq/po (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 18 15:32:37 EST 2010


Author: gmc
Date: 2010-11-18 15:32:32 -0500 (Thu, 18 Nov 2010)
New Revision: 18799

Modified:
   branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
   branches/rel_2_0/Open-ILS/web/js/ui/default/acq/invoice/common.js
   branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/create.js
Log:
only allow choice from active providers when creating POs and invoices

Also removed cusotm defaultLinkedDataLoader for the provider selection widget;
no longer necessary since pcrud handles filter by OUs

Signed-off-by: Galen Charlton <gmc at esilibrary.com>

Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 20:31:39 UTC (rev 18798)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 20:32:32 UTC (rev 18799)
@@ -671,28 +671,5 @@
     openils.widget.AutoFieldWidget.cache = {};
     openils.widget.AutoFieldWidget.defaultLinkedDataLoader = {};
 
-    /* Custom provider-as-link-class fetcher.  Fitler is ignored.  
-     * All viewable providers are retrieved.
-     */
-    openils.widget.AutoFieldWidget.defaultLinkedDataLoader.acqpro = 
-            function(linkClass, fitler, oncomplete) { 
-
-        fieldmapper.standardRequest(
-            ['open-ils.acq', 'open-ils.acq.provider.org.retrieve'],
-            {
-                async : true,
-                params : [openils.User.authtoken],
-                oncomplete : function(r) {
-                    var resp;
-                    var list = [];
-                    while(resp = r.recv()) {
-                        var pro = resp.content();
-                        if(pro) list.push(pro);
-                    }
-                    oncomplete(list);
-                }
-            }
-        );
-    }
 }
 

Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/acq/invoice/common.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/acq/invoice/common.js	2010-11-18 20:31:39 UTC (rev 18798)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/acq/invoice/common.js	2010-11-18 20:32:32 UTC (rev 18799)
@@ -5,7 +5,7 @@
 function drawInvoicePane(parentNode, inv, args) {
     args = args || {};
 
-    var override;
+    var override = {};
     if(!inv) {
         override = {
             recv_date : {widgetValue : dojo.date.stamp.toISOString(new Date())},
@@ -14,6 +14,11 @@
         };
     }
 
+    dojo.mixin(override, {
+        provider : { dijitArgs : { store_options : { base_filter : { active :"t" } } } },
+        shipper  : { dijitArgs : { store_options : { base_filter : { active :"t" } } } }
+    });
+
     for(var field in args) {
         override[field] = {widgetValue : args[field]};
     }

Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/create.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/create.js	2010-11-18 20:31:39 UTC (rev 18798)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/acq/po/create.js	2010-11-18 20:32:32 UTC (rev 18799)
@@ -26,6 +26,9 @@
                 ],
                 "fieldOrder": ["ordering_agency", "provider"],
                 "mode": "create",
+                overrideWidgetArgs : {
+                    provider : { dijitArgs : { store_options : { base_filter : { active :"t" } } } }
+                },
                 "onSubmit": function(po) {
                     fieldmapper.standardRequest(
                         ["open-ils.acq", "open-ils.acq.purchase_order.create"],{



More information about the open-ils-commits mailing list