From 84c254f1600b50cd21f2d6d165e241d0c8d33281 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Wed, 3 Jul 2024 14:48:17 +0200 Subject: [PATCH] Bug 37209: improve Record overlay rules validation and styling This patch adds jquery form validation to the input named tag. It also changes the behavior for save and edit actions which now both can be triggered by pressing enter. Batch deletion will be only possible if no edit is taking place. Test plan: 1) a) open http://localhost:8081/cgi-bin/koha/admin/marc-overlay-rules.pl b) just click + Add rule c) the input 'tag' gets highlighted and the form won't submit 2) a) edit an existing rule b) empty input value for tag c) notice the checkboxes for batch deletion on other rules if existing d) click Save and check the input 'tag' gets highlighted and the form won't submit apply patch 1) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. 2) redo steps and check that form does not get submitted and the input is marked as required via a label that says This field is required. Also checkboxes for batchremove actions are gone. Signed-off-by: Olivier Vezina Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit a7fb0c431e281ce0075ce051c144bf29a5fd043c) Signed-off-by: Lucas Gass --- .../en/modules/admin/marc-overlay-rules.tt | 78 ++++++++----------- 1 file changed, 34 insertions(+), 44 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 b36b90cdc2..268c8c0bd9 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 @@ -16,8 +16,9 @@ [% INCLUDE 'doc-head-close.inc' %] @@ -97,7 +98,7 @@ - + - - + + [% END %] @@ -162,8 +163,8 @@ - - + + - + - + Cancel @@ -260,11 +261,13 @@ [% IF rule.remove %]Remove[% ELSE %]Skip[% END %] [% IF rule.delete %]Delete[% ELSE %]Skip[% END %] - Delete + Edit + [% UNLESS edit %] + [% END %] [% END %] @@ -291,7 +294,13 @@