Acq: Fixed fund dropdowns for new copies and copies without funds.
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 13:31:27 +0000 (13:31 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 13:31:27 +0000 (13:31 +0000)
Now these dropdowns, too, exclude inactive funds.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15973 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/li_table.js

index 4ce142f..7f49c95 100644 (file)
@@ -1221,13 +1221,20 @@ function AcqLiTable() {
 
         dojo.forEach(liDetailFields,
             function(field) {
+                var searchFilter;
+                if (field == "fund") {
+                    searchFilter = (copy.fund() ?
+                        {"-or": {"active": "t", "id": copy.fund()}} :
+                        {"active" : "t"});
+                } else {
+                    searchFilter = null;
+                }
                 var widget = new openils.widget.AutoFieldWidget({
                     fmObject : copy,
                     fmField : field,
                     labelFormat : (field == 'fund') ? fundLabelFormat : null,
                     searchFormat : (field == 'fund') ? fundSearchFormat : null,
-                    searchFilter : (field == "fund" && copy.fund()) ?
-                        {"-or": {"active": "t", "id": copy.fund()}} : null,
+                    searchFilter : searchFilter,
                     noCache: true,
                     fmClass : 'acqlid',
                     parentNode : dojo.query('[name='+field+']', row)[0],