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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
ba3feb54ee
commit
5937dd436c
|
|
@ -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 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue