Bug 34478: Item removal deletion should be POSTed form
This patch updates the "Remove" button from items which are in a rotating collection (in the "Manage items" stage). A GET link is converted to a posted form. Unrelated: The JavaScript has also been modified so that it asks for confirmation. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
76aac9b301
commit
38b94cf964
|
|
@ -131,7 +131,16 @@
|
|||
<td>[% INCLUDE 'biblio-title.inc' biblio=collectionItemsLoo link = 1 %]</td>
|
||||
<td>[% collectionItemsLoo.itemcallnumber | html %]</td>
|
||||
<td>[% collectionItemsLoo.barcode | html %]</td>
|
||||
<td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% colId | uri %]&barcode=[% collectionItemsLoo.barcode | uri %]&removeItem=1&action=addItem">Remove</a></td>
|
||||
<td>
|
||||
<form action="/cgi-bin/koha/rotating_collections/addItems.pl" method="post">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-add" />
|
||||
<input type="hidden" name="colId" value="[% colId | html %]" />
|
||||
<input type="hidden" name="barcode" value="[% collectionItemsLoo.barcode | html %]" />
|
||||
<input type="hidden" name="removeItem" value="1" />
|
||||
<button type="submit" class="btn btn-default btn-xs removeitem"><i class="fa fa-trash"></i> Remove</a>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
[% END %]
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,12 @@ $(document).ready(function(){
|
|||
$("#barcode").focus();
|
||||
|
||||
$(".confirmdelete").click(function(){
|
||||
return confirm( __("Are you sure you want to delete this rotating collection?"));
|
||||
});
|
||||
|
||||
$(".removeitem").on("click", function(){
|
||||
$(this).parents('tr').addClass("warn");
|
||||
if(confirm(__("Are you sure you want to delete this rotating collection?"))){
|
||||
if(confirm(__("Are you sure you want to remove this item?"))){
|
||||
$(this).parents('form').submit();
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue