From: senator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 24 Mar 2010 21:17:58 +0000 (+0000)
Subject: Acq: limit "Fund" dropdowns in LID table to active funds
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a200391dc1d51005786e02d45e3417ba3f6b18a;p=evergreen%2Fpines.git

Acq: limit "Fund" dropdowns in LID table to active funds

A dropdown will still include one inactive fund if the dropdown belongs to a
copy row whose fund has become inactive (but presumably wasn't originally
inactive).


git-svn-id: svn://svn.open-ils.org/ILS/trunk@15964 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 6a3ee6d996..25c9919605 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
@@ -443,7 +443,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
                 self._widgetLoaded();
             };
 
-            if(this.cache[self.auth].list[linkClass]) {
+            if(!this.noCache && this.cache[self.auth].list[linkClass]) {
                 oncomplete();
 
             } else {
diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js
index 31bdd7306c..4ce142fb05 100644
--- a/Open-ILS/web/js/ui/default/acq/common/li_table.js
+++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js
@@ -1128,6 +1128,7 @@ function AcqLiTable() {
                         fmClass : 'acqlid',
                         labelFormat : (field == 'fund') ? fundLabelFormat : null,
                         searchFormat : (field == 'fund') ? fundSearchFormat : null,
+                        searchFilter : (field == 'fund') ? {"active": "t"} : null,
                         parentNode : dojo.query('[name='+field+']', row)[0],
                         orgLimitPerms : ['CREATE_PICKLIST'],
                         dijitArgs : {required:false},
@@ -1225,6 +1226,9 @@ function AcqLiTable() {
                     fmField : field,
                     labelFormat : (field == 'fund') ? fundLabelFormat : null,
                     searchFormat : (field == 'fund') ? fundSearchFormat : null,
+                    searchFilter : (field == "fund" && copy.fund()) ?
+                        {"-or": {"active": "t", "id": copy.fund()}} : null,
+                    noCache: true,
                     fmClass : 'acqlid',
                     parentNode : dojo.query('[name='+field+']', row)[0],
                     orgLimitPerms : ['CREATE_PICKLIST', 'CREATE_PURCHASE_ORDER'],