Acq: fix widget choice for user-linked fields in Acquisitions Search
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 20 Jun 2012 15:13:11 +0000 (11:13 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 26 Jun 2012 17:23:26 +0000 (13:23 -0400)
The Acquisitions Search interface (which also sits underneath the
Purchase Orders inteface, My Selection Lists, and one or two others)
stopped presenting the correct widget for search terms linked to
actor.usr.  This was brought on when PCRUD control was added to
actor.usr, so that means the bug affects only master, not rel_2_2 or
earlier.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/web/js/ui/default/acq/search/unified.js

index 02e1d68..68fb3bb 100644 (file)
@@ -128,6 +128,8 @@ function TermSelectorFactory(terms) {
         ) {
             var term = this.getTerm();
             var widgetKey = this.uniq;
+            var target = termManager.getLinkTarget(term);
+
             if (matchHow.getValue() == "__in") {
                 new openils.widget.XULTermLoader({
                     "parentNode": parentNode
@@ -147,7 +149,9 @@ function TermSelectorFactory(terms) {
                     }
                 );
             } else if (term.hint == "acqlia" ||
-                (term.hint == "jub" && term.field == "eg_bib_id")) {
+                (term.hint == "jub" && term.field == "eg_bib_id") ||
+                term.datatype == "org_unit" ||
+                (term.datatype == "link" && target == "au")) {
                 /* The test for jub.eg_bib_id is a special case to prevent
                  * AutoFieldWidget from trying to render a ridiculous dropdown
                  * of every bib record ID in the system. */