Bugzilla – Attachment 182226 Details for
Bug 39864
Cannot save automatic item modifications by age rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39864: Move save button back into form
Bug-39864-Move-save-button-back-into-form.patch (text/plain), 5.38 KB, created by
Owen Leonard
on 2025-05-09 18:10:52 UTC
(
hide
)
Description:
Bug 39864: Move save button back into form
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-05-09 18:10:52 UTC
Size:
5.38 KB
patch
obsolete
>From 9dc560d128ce17ec6053acd35de50bca9e86c556 Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >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 <oleonard@myacpl.org> >--- > .../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' ) %] >- <h1>Rules for automatic item modifications by age</h1> >- <div id="toolbar" class="btn-toolbar sticky"> >- <div class="btn-group"> >- <button class="btn btn-default add_rule"><i class="fa fa-plus"></i> Add rule</button> >- </div> >- <div class="btn-group"> >- <button type="submit" id="save_rules" class="btn btn-default"><i class="fa fa-save"></i> Save</button> >- </div> >- <div class="btn-group"> >- <a class="btn btn-default" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"><i class="fa fa-times"></i> Cancel</a> >- </div> >- </div> >- [% ELSE %] >- <h1>Automatic item modifications by age</h1> >- [% IF ( rules ) %] >- <div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit rules</a> >- </div> >- [% ELSE %] >- <div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa fa-plus"></i> Add rules</a> >- </div> >- [% END %] >- [% END %] >- > [% FOR message IN messages %] > [% SET message_class = "alert-info" %] > [% IF message.type == "error" %] >@@ -86,6 +60,18 @@ > [% IF op == 'edit_form' %] > <form method="post" id="rules_form" action="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"> > [% INCLUDE 'csrf-token.inc' %] >+ <h1>Rules for automatic item modifications by age</h1> >+ <div id="toolbar" class="btn-toolbar sticky"> >+ <div class="btn-group"> >+ <button class="btn btn-default add_rule"><i class="fa fa-plus"></i> Add rule</button> >+ </div> >+ <div class="btn-group"> >+ <button type="submit" id="save_rules" class="btn btn-default"><i class="fa fa-save"></i> Save</button> >+ </div> >+ <div class="btn-group"> >+ <a class="btn btn-default" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"><i class="fa fa-times"></i> Cancel</a> >+ </div> >+ </div> > <div id="edit_rules"> > <div id="rules"> > [% FOR rule IN rules %] >@@ -218,6 +204,10 @@ > </div> > </fieldset> > [% ELSIF rules %] >+ <h1>Automatic item modifications by age</h1> >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit rules</a> >+ </div> > <div> > <h4>List of rules</h4> > >@@ -271,6 +261,10 @@ > <!-- /.page-section --> > </div> > [% ELSE %] >+ <h1>Automatic item modifications by age</h1> >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa fa-plus"></i> Add rules</a> >+ </div> > <div class="alert alert-info"> There are no rules defined. </div> > [% END %] > [% END %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39864
:
182172
| 182226