From ddb9b7d3af1759b03075c1a1ab08873a4b55cc64 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 20 May 2010 15:47:55 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16464 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/search/unified.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/acq/search/unified.js b/Open-ILS/web/js/ui/default/acq/search/unified.js index f5769392ea..d62ea44ffb 100644 --- a/Open-ILS/web/js/ui/default/acq/search/unified.js +++ b/Open-ILS/web/js/ui/default/acq/search/unified.js @@ -148,8 +148,12 @@ function TermSelectorFactory(terms) { }).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 @@ function TermManager() { 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 @@ function TermManager() { 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(" || "); -- 2.43.2