From 0f2d80328d74c661ecd318f603a18743e3c699bb Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 24 Aug 2018 11:05:04 +0300 Subject: [PATCH] Bug 20785: Advanced Editor does not honor MarcFieldDocURL The advanced MARC editor, Rancor, doesn't obey MarcFieldDocURL. Make it do so. Test plan: 1) Enable EnableAdvancedCatalogingEditor 2) Set MarcFieldDocURL to eg. http://{MARC}.example.com/{LANG}/{FIELD} 3) Go to Cataloging -> Advanced editor 4) Go to any field and press Ctrl-H 5) Marc field documentation on www.loc.gov or ifla.org should open 6) Apply patch 7) Repeat 3 and 4. The Marc field docs should open on the URL you set Signed-off-by: Pasi Kallinen Signed-off-by: Michal Denar Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit ca839922fd4bf3c455454f6dd9182203b1481831) Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/includes/cateditor-ui.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index d052fd9b1d..d44e883a62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -1,3 +1,4 @@ +[% USE Koha %] [% Asset.js("lib/codemirror/codemirror-compressed.js") %] [% Asset.js("lib/filesaver.js") %] [% Asset.js("lib/koha/cateditor/marc-mode.js") %] @@ -177,7 +178,13 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr } function getFieldHelpURL( tag ) { - [% IF ( marcflavour == 'MARC21' ) %] + [% IF Koha.Preference('marcfielddocurl') %] + var docurl = "[% Koha.Preference('marcfielddocurl').replace('"','"') | html %]"; + docurl = docurl.replace("{MARC}", "[% marcflavour | html %]"); + docurl = docurl.replace("{FIELD}", ""+tag); + docurl = docurl.replace("{LANG}", "[% lang | html %]"); + return docurl; + [% ELSIF ( marcflavour == 'MARC21' ) %] if ( tag == '000' ) { return "http://www.loc.gov/marc/bibliographic/bdleader.html"; } else if ( tag >= '090' && tag < '100' ) { -- 2.39.5