From 7d3175905413d8c4da1a7bb1b8f932c2f9dc0a60 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 27 Aug 2010 01:19:26 +0000 Subject: [PATCH] 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 --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) 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] } ) ); -- 2.11.0