From 5297dfd36113ad34424a6cf9edb6b344a0da0ec3 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 24 Oct 2022 22:40:28 +0000 Subject: [PATCH] Bug 31694: (follow-up) Further improve translatability To test: * Add rules fo different modules and with different settings * Verify the saved module description for a saved rule matches the pull down * Verify the saved filter matches the pull downs (especially for source and patron category) Also: * Renames 'User category' to 'Patron category' * Remove some values from translations, that shouldn't be translated, like value attributs for options. Signed-off-by: David Nind Signed-off-by: Jan Kissig Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer (cherry picked from commit b1cd199aaa37e5c055f772b10b6015c6c3374fed) Signed-off-by: Fridolin Somers (cherry picked from commit 4595fdf0defb4ceacb9339573d4cc15b25c131c3) Signed-off-by: Lucas Gass --- .../en/modules/admin/marc-overlay-rules.tt | 54 ++++++++++++++----- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt index d54fd91d28..bd02fc4cf1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt @@ -4,6 +4,7 @@ [% SET footerjs = 1 %] [% USE Koha %] [% USE KohaSpan %] +[% USE Categories %] [% PROCESS 'i18n.inc' %] [% INCLUDE 'doc-head-open.inc' %] MARC overlay rules › Koha › Administration @@ -94,7 +95,7 @@ @@ -226,8 +227,35 @@ [% ELSE %] [% rule.id | html %] - [% rule.module | html %] - [% rule.filter | html %] + + [% SWITCH rule.module %] + [% CASE 'source' %]Source + [% CASE 'categorycode' %]Patron category + [% CASE 'userid' %]Username + [% CASE %][% rule.module | html %] + [% END %] + + + [% IF rule.module == "source" %] + [% SWITCH rule.filter %] + [% CASE 'batchmod' %]Batch record modification + [% CASE 'intranet' %]Staff interface MARC editor + [% CASE 'batchimport' %]Staged MARC import + [% CASE 'z3950' %]Z39.50 + [% CASE 'bulkmarkimport' %]bulkmarkimport.pl + [% CASE 'import_lexile' %]import_lexile.pl + [% CASE %][% rule.filter | html %] + [% END %] + [% ELSIF rule.module == "categorycode" %] + [% IF rule.filter != "*" %] + [% Categories.GetName( rule.filter ) | html %] + [% ELSE %] + [% rule.filter %] + [% END %] + [% ELSE %] + [% rule.filter | html %] + [% END %] + [% rule.tag | html %] [% IF rule.add %]Add[% ELSE %]Skip[% END %] @@ -366,31 +394,31 @@ })); var overlay_rules_presets = {}; - overlay_rules_presets[_("protect")] = { + overlay_rules_presets["protect"] = { 'add': 0, 'append': 0, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("overwrite")] = { + overlay_rules_presets["overwrite"] = { 'add': 1, 'append': 1, 'remove': 1, 'delete': 1 }; - overlay_rules_presets[_("add")] = { + overlay_rules_presets["add"] = { 'add': 1, 'append': 0, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("addappend")] = { + overlay_rules_presets["addappend"] = { 'add': 1, 'append': 1, 'remove': 0, 'delete': 0 }; - overlay_rules_presets[_("protectfromdeletion")] = { + overlay_rules_presets["protectfromdeletion"] = { 'add': 1, 'append': 1, 'remove': 1, @@ -398,11 +426,11 @@ }; var overlay_rules_label_to_value = {}; - overlay_rules_label_to_value[_("Add")] = 1; - overlay_rules_label_to_value[_("Append")] = 1; - overlay_rules_label_to_value[_("Remove")] = 1; - overlay_rules_label_to_value[_("Delete")] = 1; - overlay_rules_label_to_value[_("Skip")] = 0; + overlay_rules_label_to_value["add"] = 1; + overlay_rules_label_to_value["append"] = 1; + overlay_rules_label_to_value["remove"] = 1; + overlay_rules_label_to_value["delete"] = 1; + overlay_rules_label_to_value["skip"] = 0; function hash_config(config) { return JSON.stringify(config, Object.keys(config).sort()); -- 2.39.5