From dfdf183e68aaaa29f577dde20d41db5ea002637e Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 31 Aug 2017 17:22:36 -0400 Subject: [PATCH] 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 --- .../web/js/ui/default/cat/authority/list.js | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/js/ui/default/cat/authority/list.js b/Open-ILS/web/js/ui/default/cat/authority/list.js index 17b59a8f91..cdafb934f7 100644 --- a/Open-ILS/web/js/ui/default/cat/authority/list.js +++ b/Open-ILS/web/js/ui/default/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.43.2