Search clicked /and/ preceding sf values
authorMike Rylander <mrylander@gmail.com>
Tue, 30 Apr 2013 20:45:55 +0000 (16:45 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 12 Jun 2013 21:52:54 +0000 (17:52 -0400)
When looking for authority records to control a bib field, we currently
search using exactly, and only, the subfield that was clicked.  This
commit changes that so that the full field up to and including the clicked
subfield is used in the simple authority heading search we perform to find
the best-match (pivot) authority record.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/marcedit.js

index adc4cf1..f62d939 100644 (file)
@@ -1758,10 +1758,17 @@ function browseAuthority (sf_popup, menu_id, target, sf, limit, page) {
         page = 0;
     }
 
+    var sf_string = '';
+    var sf_list = sf.parent().subfield;
+    for ( var i in sf_list) {
+        sf_string += sf_list[i].toString() + ' ';
+        if (sf_list[i] === sf) break;
+    }
+
     var url = '/opac/extras/browse/marcxml/'
         + type + '.refs'
         + '/1' // OU - currently unscoped
-        + '/' + sf.toString()
+        + '/' + sf_string
         + '/' + page
         + '/' + limit
     ;