From 6eac593d2abbb661b58ed8b91c09f91cc58c03f3 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 20 Sep 2011 10:55:55 -0400 Subject: [PATCH] Do not overwrite controlmap entries, but extend them (Floating Subdivisions!) Signed-off-by: Mike Rylander --- Open-ILS/web/js/dojo/openils/AuthorityControlSet.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js b/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js index 36ac521eb3..c6c6c00445 100644 --- a/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js +++ b/Open-ILS/web/js/dojo/openils/AuthorityControlSet.js @@ -140,9 +140,15 @@ if(!dojo._hasResource["openils.AuthorityControlSet"]) { // build the authority_tag_map dojo.forEach( openils.AuthorityControlSet._controlsets[''+cs.id()].bib_fields, function (bf) { - openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {}; + + if (!openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()]) + openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {}; + dojo.forEach( bf.authority_field().sf_list().split(''), function (sf_code) { - openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {}; + + if (!openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code]) + openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {}; + openils.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code; }); }); -- 2.11.0