From 540fb8a42e3862a2755c0cbfea9ecbbfb66fc849 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 17 Dec 2018 14:40:53 -0500 Subject: [PATCH] JBAS-2162 Manage Authority 3.2 updates Cross-porting dfdf183 from origin's copy of list.js: --- LP#1638299: adjust staff-side authority browse Now that the primary key of the authority.thesarus table has changed from the single-character code to the LC-assigned authority code, a bit of additional translation is required. Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/kcls/cat/authority/list.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/ui/kcls/cat/authority/list.js b/Open-ILS/web/js/ui/kcls/cat/authority/list.js index 58556aa38f..c40dcc8794 100644 --- a/Open-ILS/web/js/ui/kcls/cat/authority/list.js +++ b/Open-ILS/web/js/ui/kcls/cat/authority/list.js @@ -23,24 +23,37 @@ var auth_strings = dojo.i18n.getLocalization("openils.authority", "authority"); var cgi = new openils.CGI(); var pcrud = new openils.PermaCrud(); +var _thes_short_code_map = { + "a" : "lcsh", + "b" : "lcshac", + "c" : "mesh", + "d" : "nal", + "k" : "cash", + "r" : 'aat', + "s" : "sears", + "v" : "rvm" +} var _acs_cache_by_at = {}; function fetch_control_set(thesaurus) { - if (!_acs_cache_by_at[thesaurus]) { + var thes_code = (thesaurus in _thes_short_code_map) ? + _thes_short_code_map[thesaurus] : + thesaurus; + if (!_acs_cache_by_at[thes_code]) { var at = pcrud.retrieve( - "at", thesaurus, + "at", thes_code, {"flesh": 1, "flesh_fields": {"at": ["control_set"]}} ); var cs; - if (at.control_set()) { + if (at && at.control_set()) { cs = at.control_set(); } else { cs = new fieldmapper.acs(); cs.name("None"); // XXX i18n } - _acs_cache_by_at[thesaurus] = cs; + _acs_cache_by_at[thes_code] = cs; } - return _acs_cache_by_at[thesaurus]; + return _acs_cache_by_at[thes_code]; } /* -- 2.11.0