From c1ef62d0c3542d0f5907bd016e2fd1861ac84bf4 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 30 Aug 2011 15:37:19 -0400 Subject: [PATCH] Use bib tag instead to find the correct ACS, instead of the static field map Signed-off-by: Mike Rylander --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; } -- 2.11.0