Restrict authority record fields to 1xx and 5xx when offering a match
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Aug 2010 01:19:26 +0000 (01:19 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Aug 2010 01:19:26 +0000 (01:19 +0000)
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

Open-ILS/xul/staff_client/server/cat/marcedit.js

index 90435c9..edfe1ff 100644 (file)
@@ -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]
                         }
                     )
                 );