Acq: limit "Fund" dropdowns in LID table to active funds
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 24 Mar 2010 21:17:58 +0000 (21:17 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 24 Mar 2010 21:17:58 +0000 (21:17 +0000)
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

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 6a3ee6d..25c9919 100644 (file)
@@ -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 {
index 31bdd73..4ce142f 100644 (file)
@@ -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'],