From e3ca9bf25ef9f5d19322affec7a3e115c0779d44 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Apr 2015 11:46:29 +0200 Subject: [PATCH] Bug 10913: The delete basket confirmation page is never displayed This condition is never reached, the confirmation to delete a basket is done with a popup in the template. Test plan: Confirm you don't find any regression when creation/editing and deleting a basket. Signed-off-by: Mark Tompsett NOTE: I didn't create or edit. However, the only perl script that uses the template is acqui/basket.pl and the only place delete_confirm is set in acqui/basket.pl is in that code which is only called if del_basket actually existed anywhere else, which it doesn't. I did have two baskets, one with two transfers from the first, so I transferred one back, and then proceeded to test the two delete buttons in the modal. No issues. Cancel (to close the modal) works too. --- acqui/basket.pl | 41 ---------------------- .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 23 +++--------- 2 files changed, 4 insertions(+), 60 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 04ab8bc..cfa803b 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -150,47 +150,6 @@ if ( $op eq 'delete_confirm' ) { $template->param( delete_confirmed => 1 ); } elsif ( !$bookseller ) { $template->param( NO_BOOKSELLER => 1 ); -} elsif ( $op eq 'del_basket') { - $template->param( delete_confirm => 1 ); - if ( C4::Context->preference("IndependentBranches") ) { - my $userenv = C4::Context->userenv; - unless ( C4::Context->IsSuperLibrarian() ) { - my $validtest = ( $basket->{creationdate} eq '' ) - || ( $userenv->{branch} eq $basket->{branch} ) - || ( $userenv->{branch} eq '' ) - || ( $basket->{branch} eq '' ); - unless ($validtest) { - print $query->redirect("../mainpage.pl"); - exit 1; - } - } - } - $basket->{creationdate} = "" unless ( $basket->{creationdate} ); - $basket->{authorisedby} = $loggedinuser unless ( $basket->{authorisedby} ); - my $contract = GetContract({ - contractnumber => $basket->{contractnumber} - }); - $template->param( - basketno => $basketno, - basketname => $basket->{'basketname'}, - basketnote => $basket->{note}, - basketbooksellernote => $basket->{booksellernote}, - basketcontractno => $basket->{contractnumber}, - basketcontractname => $contract->{contractname}, - creationdate => $basket->{creationdate}, - authorisedby => $basket->{authorisedby}, - authorisedbyname => $basket->{authorisedbyname}, - closedate => $basket->{closedate}, - deliveryplace => $basket->{deliveryplace}, - billingplace => $basket->{billingplace}, - active => $bookseller->{'active'}, - booksellerid => $bookseller->{'id'}, - name => $bookseller->{'name'}, - address1 => $bookseller->{'address1'}, - address2 => $bookseller->{'address2'}, - address3 => $bookseller->{'address3'}, - address4 => $bookseller->{'address4'}, - ); } elsif ($op eq 'export') { print $query->header( -type => 'text/csv', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 22d6631..82ffde4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -3,7 +3,7 @@ [% USE AuthorisedValues %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Acquisitions › [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %] +Koha › Acquisitions › [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -145,7 +145,7 @@ [% INCLUDE 'acquisitions-search.inc' %] - +
@@ -163,6 +163,7 @@
+ [%# FIXME This action should not be available for everyone %] [% IF ( unclosable ) %] [% ELSIF ( uncertainprices ) %] @@ -241,21 +242,7 @@ [% END %] [% ELSE %] -

[% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]

- [% IF ( delete_confirm ) %] -

- - - Yes, delete this basket! - - - - - Cancel - - -

- [% END %] +

[% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]

[% IF ( basketno ) %]
@@ -377,7 +364,6 @@
[% END %] - [% UNLESS ( delete_confirm ) %]
[% IF ( books_loop ) %]

Orders

@@ -639,7 +625,6 @@ [% INCLUDE 'acquisitions-add-to-basket.inc' %] [% END %] - [% END %] [% END %] [% END %] [% ELSE %] [% END %] -- 2.1.4