From 9dc560d128ce17ec6053acd35de50bca9e86c556 Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Fri, 9 May 2025 09:09:29 -0400 Subject: [PATCH] Bug 39864: Move save button back into form The save button for automatic item modification rules got moved outside of the form during the refactor for bug 38714. This happened because the form was spread between two separate IF blocks that checked the same condition, which is no longer allowed as of 38714. This patch consolidates the conditional blocks and moves the submit button back inside its form. To test: 1. Go to Cataloguing > Item modifications by age 2. Click Add Rules, and then Add Rule to create a new rule 3. Fill in some reasonable values, for example: Age in days: 365 Age field: items.itemlost_on Substitutions: items.withdrawn = 1 4. Click save --> Nothing happens! 5. Apply patch, refresh, the page, and fill values in again if needed 6. Click save again --> The rule is saved! 7. Confirm the Edit rules, Add rule, and Cancel buttons still work i. Click Edit rules --> The rule you just created should now be editable ii. Click Add rule --> A new form for a second rule should be added to the page iii. Click Cancel --> The change is cancelled and the page returns to "List of rules" view Signed-off-by: Owen Leonard --- .../automatic_item_modification_by_age.tt | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt index 63b59377159..07c1d71ced0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt @@ -45,32 +45,6 @@ [% WRAPPER 'main-container.inc' aside='cat-menu' %] - [% IF ( op == 'edit_form' ) %] -

Rules for automatic item modifications by age

-
-
- -
-
- -
-
- Cancel -
-
- [% ELSE %] -

Automatic item modifications by age

- [% IF ( rules ) %] - - [% ELSE %] - - [% END %] - [% END %] - [% FOR message IN messages %] [% SET message_class = "alert-info" %] [% IF message.type == "error" %] @@ -86,6 +60,18 @@ [% IF op == 'edit_form' %]
[% INCLUDE 'csrf-token.inc' %] +

Rules for automatic item modifications by age

+
+
+ +
+
+ +
+
+ Cancel +
+
[% FOR rule IN rules %] @@ -218,6 +204,10 @@
[% ELSIF rules %] +

Automatic item modifications by age

+

List of rules

@@ -271,6 +261,10 @@
[% ELSE %] +

Automatic item modifications by age

+
There are no rules defined.
[% END %] [% END %] -- 2.39.5