Bug 37797: Change cancel button to a link styled as a button

On the confirmation page for deleting a budget, change "Do not delete"
from a form submission to a link (styled to look like a button) in order
to avoid errors from POSTing with no op.

To test:
1. Go to Acquisitions > Budgets
2. Create a test budget
3. Attempt to delete the test budget
4. On the confirmation page, click "No, don't delete"
--> An error appears saying that the form was POSTed with no op!
5. Apply patch
6. Repeat steps 3-4
--> You are linked back to the Budgets page. The budget was not deleted.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Emily Lamancusa 2024-08-30 16:50:36 -04:00 committed by Katrin Fischer
parent 982ba9e8a1
commit 1f4be98d7f
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -324,10 +324,7 @@
<input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
</form>
<form action="[% script_name | html %]" method="post">
[% INCLUDE 'csrf-token.inc' %]
<button type="submit" class="btn btn-default deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
</form>
<a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="btn btn-default deny"><i class="fa fa-fw fa-times"></i> No, do not delete</a>
[% END %]
</div>