From: dbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 27 Aug 2010 01:19:26 +0000 (+0000)
Subject: Restrict authority record fields to 1xx and 5xx when offering a match
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d3175905413d8c4da1a7bb1b8f932c2f9dc0a60;p=evergreen%2Fmasslnc.git

Restrict authority record fields to 1xx and 5xx when offering a match

When you right-click on a subfield eligible for authority control and display
the list of authority records that match the left-truncated subfield, we should
not display every field in the matching authority records; the 1xx and 5xx seem
like the obvious options to which the selection should be limited.


git-svn-id: svn://svn.open-ils.org/ILS/trunk@17358 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js
index 90435c9e7d..edfe1fff61 100644
--- a/Open-ILS/xul/staff_client/server/cat/marcedit.js
+++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js
@@ -1865,11 +1865,19 @@ function getAuthorityContextMenu (target, sf) {
         var fields = xml.datafield;
         for (var j in fields) {
 
+            /* Restrict options to Heading Information fields (1xx)
+             * and See Also From fields (5xx) rather than displaying
+             * every field in the authority record */
+            var tag = fields[j].@tag;
+            if (tag.substr(0,1) != 1 && tag.substr(0,1) != 5) {
+                continue;
+            }
+
             var row = createRow(
                 {},
-                createLabel( { value : fields[j].@tag } ),
-                createLabel( { value : fields[j].@ind1 } ),
-                createLabel( { value : fields[j].@ind2 } )
+                createLabel( { "value" : tag } ),
+                createLabel( { "value" : fields[j].@ind1 } ),
+                createLabel( { "value" : fields[j].@ind2 } )
             );
 
             var sf_box = createHbox();
@@ -1878,10 +1886,10 @@ function getAuthorityContextMenu (target, sf) {
             for (var k in subfields) {
                 sf_box.appendChild(
                     createCheckbox(
-                        { label    : '\u2021' + subfields[k].@code + ' ' + subfields[k],
-                          subfield : subfields[k].@code,
-                          tag      : subfields[k].parent().@tag,
-                          value    : subfields[k]
+                        { "label"    : '\u2021' + subfields[k].@code + ' ' + subfields[k],
+                          "subfield" : subfields[k].@code,
+                          "tag"      : subfields[k].parent().@tag,
+                          "value"    : subfields[k]
                         }
                     )
                 );