Bug 34478: Convert item search field delete to POST form

This patch converts the delete link on the item search field page to a
form with a POST operation.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Owen Leonard 2024-02-16 13:21:38 +00:00 committed by Jonathan Druart
parent 0af9d12027
commit cf0581283d
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
1 changed files with 6 additions and 1 deletions

View File

@ -91,7 +91,12 @@
<td>[% field.authorised_values_category | html %]</td>
<td>
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/items_search_field.pl?name=[% field.name | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
<a class="field-delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/items_search_fields.pl?op=del&name=[% field.name | html %]"><i class="fa fa-trash-can"></i> Delete</a>
<form action="/cgi-bin/koha/admin/items_search_fields.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-del" />
<input type="hidden" name="name" value="[% field.name | html %]" />
<button class="field-delete btn btn-default btn-xs"><i class="fa fa-trash-can"></i> Delete</a>
</form>
</td>
</tr>
[% END %]