From: Mike Rylander Date: Tue, 30 Aug 2011 19:37:19 +0000 (-0400) Subject: Use bib tag instead to find the correct ACS, instead of the static field map X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c1ef62d0c3542d0f5907bd016e2fd1861ac84bf4;p=working%2FEvergreen.git Use bib tag instead to find the correct ACS, instead of the static field map Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 7ea4e041e7..6a8680beeb 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -1928,11 +1928,23 @@ function summarizeField(sf) { source_f.ind1 = sf.parent().@ind1.toString(); source_f.ind1 = sf.parent().@ind2.toString(); + var found_acs = []; + dojo.forEach( acs.controlSetList(), function (acs_id) { + if (acs.controlSet(acs_id).control_map[sf.parent().@tag]) found_acs.push(acs_id); + }); + + var cmap; + if (!found_acs.length) { + return false; + } else { + cmap = acs.controlSet(found_acs[0]).control_map; + } + for (var i = 0; i < sf.parent().subfield.length(); i++) { var sf_iter = sf.parent().subfield[i]; /* Filter out subfields that are not controlled for this tag */ - if (!control_map[source_f.tag][sf_iter.@code.toString()]) { + if (!cmap[source_f.tag][sf_iter.@code.toString()]) { continue; }