From: gmc Date: Thu, 18 Nov 2010 20:31:39 +0000 (+0000) Subject: only allow choice from active providers when creating POs and invoices X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0cca64451ee9650a2272271c87b341af19f8256;p=contrib%2FConifer.git 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@18798 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index eec578d989..e300fb1da5 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -671,28 +671,5 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { 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); - } - } - ); - } } diff --git a/Open-ILS/web/js/ui/default/acq/invoice/common.js b/Open-ILS/web/js/ui/default/acq/invoice/common.js index b52f38cf40..03fade4c8e 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/common.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/common.js @@ -5,7 +5,7 @@ dojo.require('openils.widget.EditPane'); 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 @@ function drawInvoicePane(parentNode, inv, args) { }; } + 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]}; } diff --git a/Open-ILS/web/js/ui/default/acq/po/create.js b/Open-ILS/web/js/ui/default/acq/po/create.js index 804ad0a241..2ce2ea21a7 100644 --- a/Open-ILS/web/js/ui/default/acq/po/create.js +++ b/Open-ILS/web/js/ui/default/acq/po/create.js @@ -26,6 +26,9 @@ openils.Util.addOnLoad( ], "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"],{