From 468f09675363ccdcf20fb82ddfc54c7626d68294 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 13 May 2010 15:02:58 +0000 Subject: [PATCH] Acq: two bug fixes 1) a bug recently introduced in unified search would try to build the catalog search query more often than needed (and fail at it) 2) there was a colliding accesskey in staff client acquisitions menu git-svn-id: svn://svn.open-ils.org/ILS/trunk@16426 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/acq/search/unified.js | 22 ++++++++++++---------- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 +- 2 files changed, 13 insertions(+), 11 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 c65834cd83..e319504d09 100644 --- a/Open-ILS/web/js/ui/default/acq/search/unified.js +++ b/Open-ILS/web/js/ui/default/acq/search/unified.js @@ -546,10 +546,14 @@ function TermManager() { var widget = this.widgets[id]; if (!sso[attr]) sso[attr] = []; + var value = ( + typeof(widget.attr) == "function" ? + widget.attr("value") : widget.value + ); + if (typeof(value) != "string") + value = value.join(" || "); sso[attr].push( - (match_how.indexOf("__not") == -1 ? "" : "-") + - (typeof(widget.attr) == "function" ? - widget.attr("value").join(" || ") : widget.value) + (match_how.indexOf("__not") == -1 ? "" : "-") + value ); } var ssa = []; @@ -681,16 +685,16 @@ function ResultManager(liTable, poGrid, plGrid, invGrid) { "&c=" + dojo.byId("acq-unified-conjunction").getValue(); }; - this.search = function(search_object, bib_search_string) { + this.search = function(search_object, termManager) { var count_results = 0; - var bibs_too = false; + var bib_search_string = null; var result_type = dojo.byId("acq-unified-result-type").getValue(); var conjunction = dojo.byId("acq-unified-conjunction").getValue(); /* lineitem_and_bib: a special case */ if (result_type == "lineitem_and_bib") { result_type = "lineitem"; - bibs_too = true; + bib_search_string = termManager.buildBibSearchString(); } function result_completion() { @@ -723,7 +727,7 @@ function ResultManager(liTable, poGrid, plGrid, invGrid) { } }, "oncomplete": function() { - if (bibs_too) { + if (bib_search_string) { fieldmapper.standardRequest( ["open-ils.acq", "open-ils.acq.biblio.wrapped_search"], { @@ -788,9 +792,7 @@ openils.Util.addOnLoad( hideForm(); openils.Util.show("acq-unified-body"); termManager.reflect(uriManager.search_object); - resultManager.search( - uriManager.search_object, termManager.buildBibSearchString() - ); + resultManager.search(uriManager.search_object, termManager); } else { termManager.addRow(); openils.Util.show("acq-unified-body"); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 0093f5535a..745c4b5283 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -822,7 +822,7 @@ - + -- 2.11.0