[open-ils-commits] r16464 - trunk/Open-ILS/web/js/ui/default/acq/search (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu May 20 11:47:58 EDT 2010


Author: senator
Date: 2010-05-20 11:47:55 -0400 (Thu, 20 May 2010)
New Revision: 16464

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/search/unified.js
Log:
Acq: fix unified search for not-null boolean fields

The unified search UI produces a checkbox for these fields, but it did not
build a search query from checkboxes correctly.


Modified: trunk/Open-ILS/web/js/ui/default/acq/search/unified.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/search/unified.js	2010-05-20 14:10:47 UTC (rev 16463)
+++ trunk/Open-ILS/web/js/ui/default/acq/search/unified.js	2010-05-20 15:47:55 UTC (rev 16464)
@@ -148,8 +148,12 @@
                 }).build(
                     function(w) {
                         wStore[widgetKey] = w;
-                        if (typeof(value) != "undefined")
-                            w.attr("value", value);
+                        if (typeof(value) != "undefined") {
+                            if (w.declaredClass.match(/Check/))
+                                w.attr("checked", value == "t");
+                            else
+                                w.attr("value", value);
+                        }
                         if (!noFocus)
                             w.focus();
                         if (typeof(callback) == "function")
@@ -511,6 +515,8 @@
                             split("T")[0];
                 } else {
                     value = this.widgets[id].attr("value");
+                    if (this.widgets[id].declaredClass.match(/Check/))
+                        value = (value == "on") ? "t" : "f";
                 }
             } else {
                 value = this.widgets[id].value;
@@ -548,7 +554,7 @@
             if (!sso[attr]) sso[attr] = [];
             var  value = (
                 typeof(widget.attr) == "function" ?
-                    widget.attr("value") : widget.value
+                    widget.getFormattedValue() : widget.value
             );
             if (typeof(value) != "string")
                 value = value.join(" || ");



More information about the open-ils-commits mailing list