From b2f77bd7bb796152ff0a301aa8f7282a4b601747 Mon Sep 17 00:00:00 2001 From: Kevin Carnes Date: Thu, 13 Apr 2023 15:20:02 +0200 Subject: [PATCH] Bug 31694: (follow-up) Use values for operations to avoid translation issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To test: * Try adding a preset rule that has an operation with different translations for the column and the pull down (e.g. Outrepasser for fr-CA) * Without the patch it appears as Custom (e.g. Personnalisé) * With the patch it appears correctly (e.g. Outrepasser) Signed-off-by: David Nind Signed-off-by: Jan Kissig Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer (cherry picked from commit e9c7f84896fe158894c86a682ef110723e5a4a44) Signed-off-by: Fridolin Somers (cherry picked from commit a0db31d75f873f849898a15359af534fceb31a2c) Signed-off-by: Lucas Gass --- .../en/modules/admin/marc-overlay-rules.tt | 19 ++++++------------- 1 file changed, 6 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 a2d3a4fc07..b0bffa86b8 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 @@ -258,10 +258,10 @@ [% rule.tag | html %] - [% IF rule.add %]Add[% ELSE %]Skip[% END %] - [% IF rule.append %]Append[% ELSE %]Skip[% END %] - [% IF rule.remove %]Remove[% ELSE %]Skip[% END %] - [% IF rule.delete %]Delete[% ELSE %]Skip[% END %] + [% IF rule.add %]Add[% ELSE %]Skip[% END %] + [% IF rule.append %]Append[% ELSE %]Skip[% END %] + [% IF rule.remove %]Remove[% ELSE %]Skip[% END %] + [% IF rule.delete %]Delete[% ELSE %]Skip[% END %] Delete Edit @@ -425,13 +425,6 @@ 'delete': 0 }; - 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; - function hash_config(config) { return JSON.stringify(config, Object.keys(config).sort()); } @@ -451,10 +444,10 @@ var operations_config = {}; $('.rule-operation-action', $this).each(function() { var $operation = $(this); - operations_config[$operation.data('operation')] = overlay_rules_label_to_value[$operation.text()]; + operations_config[$operation.data('operation')] = $operation.data('value'); }); $('.rule-preset', $this).text( - $('option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text() || _("Custom") + $('select[name="preset"] option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text() ); }); -- 2.39.5