Bug 37152: Aquisitions basket and OPAC suggestion deletion should use the op cud-delete
Both deleting a basket in Aquisitions and deleting a suggestion in the OPAC
take care of the confirmation in a javascript modal, rather than having a
whole separate page for confirmation, so they should be using the op
cud-delete rather than either cud-delete_confirm (which shouldn't ever be
used) or delete_confirm (which they aren't doing, they already confirmed).
Test plan:
1. There's no wrong behavior to see, so apply patch and restart_all
2. Aquisitions - Vendor search for My Vendor - Click My Basket
3. Click Delete basket, in the popup again Delete basket
4. Click Show baskets for vendor My Vendor and verify the basket is gone
5. OPAC - Your account - Purchase suggestions
6. Create a suggestion, then click the checkbox for it, Delete selected,
confirm
7. Verify the suggestion was deleted
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit fb9edbcf5c)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
70458e3de7
commit
31478431f5
|
|
@ -134,7 +134,7 @@ if ( $op eq 'cud-delete-order' ) {
|
|||
$order->delete if $order;
|
||||
$op = 'list';
|
||||
|
||||
} elsif ( $op eq 'cud-delete_confirm' ) {
|
||||
} elsif ( $op eq 'cud-delete' ) {
|
||||
|
||||
output_and_exit( $query, $cookie, $template, 'insufficient_permission' )
|
||||
unless $logged_in_patron->has_permission( { acquisition => 'delete_baskets' } );
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@
|
|||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
|
||||
<form action="/cgi-bin/koha/acqui/basket.pl" method="post">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-delete_confirm" />
|
||||
<input type="hidden" name="op" value="cud-delete" />
|
||||
<input type="hidden" name="basketno" value="[% basketno | html %]" />
|
||||
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
|
||||
<input type="hidden" name="delbiblio" value="0" />
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
|
||||
<form action="/cgi-bin/koha/acqui/basket.pl" method="post">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-delete_confirm" />
|
||||
<input type="hidden" name="op" value="cud-delete" />
|
||||
<input type="hidden" name="basketno" value="[% basketno | html %]" />
|
||||
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
|
||||
<input type="hidden" name="delbiblio" value="0" />
|
||||
|
|
@ -174,7 +174,7 @@
|
|||
|
||||
<form action="/cgi-bin/koha/acqui/basket.pl" method="post">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-delete_confirm" />
|
||||
<input type="hidden" name="op" value="cud-delete" />
|
||||
<input type="hidden" name="basketno" value="[% basketno | html %]" />
|
||||
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
|
||||
<input type="hidden" name="delbiblio" value="1" />
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@
|
|||
[% SET can_delete_suggestion = 0 %]
|
||||
<form action="/cgi-bin/koha/opac-suggestions.pl" method="post" id="delete_suggestions">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-delete_confirm" />
|
||||
<input type="hidden" name="op" value="cud-delete" />
|
||||
[% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %]
|
||||
<div id="toolbar" class="toolbar clearfix">
|
||||
[% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %]
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ my $suggestions = [ Koha::Suggestions->search_limited(
|
|||
}
|
||||
)->as_list ];
|
||||
|
||||
if ( $op eq "cud-delete_confirm" ) {
|
||||
if ( $op eq "cud-delete" ) {
|
||||
my @delete_field = $input->multi_param("delete_field");
|
||||
foreach my $delete_field (@delete_field) {
|
||||
&DelSuggestion( $borrowernumber, $delete_field );
|
||||
|
|
|
|||
Loading…
Reference in New Issue