Acq: two bug fixes
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 May 2010 15:02:58 +0000 (15:02 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 May 2010 15:02:58 +0000 (15:02 +0000)
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
Open-ILS/web/opac/locale/en-US/lang.dtd

index c65834c..e319504 100644 (file)
@@ -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");
index 0093f55..745c4b5 100644 (file)
 <!ENTITY staff.main.menu.acq.provider.label "Providers">
 <!ENTITY staff.main.menu.acq.provider.accesskey "V">
 <!ENTITY staff.main.menu.acq.edi_account.label "EDI Accounts">
-<!ENTITY staff.main.menu.acq.edi_account.accesskey "A">
+<!ENTITY staff.main.menu.acq.edi_account.accesskey "U">
 <!ENTITY staff.main.menu.acq.distrib_formula.label "Distribution Formulas">
 <!ENTITY staff.main.menu.acq.distrib_formula.accesskey "D">
 <!ENTITY staff.main.menu.acq.currency_type.label "Currency Types">