From d57194e24dc99ac62ef15327b5af6a3c4e0fae87 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Aug 2012 13:37:31 +0200 Subject: [PATCH] Bug 7358: reaffect a closed basket to a closed basketgroup The list of basketgroups when looking at a closed basket show all the basketgroups. It should not be possible to affect a basket to a closed basketgroup, since this basketgroup should have been sent to a supplier. Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain Signed-off-by: Jared Camins-Esakov --- acqui/basket.pl | 4 +- .../prog/en/modules/acqui/basket.tt | 48 ++++++++++++------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 7163bf49f2..f203af2517 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -206,13 +206,14 @@ if ( $op eq 'delete_confirm' ) { } } #if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups - my $basketgroups; + my ($basketgroup, $basketgroups); my $member = GetMember(borrowernumber => $loggedinuser); if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) { $basketgroups = GetBasketgroups($basket->{booksellerid}); for my $bg ( @{$basketgroups} ) { if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){ $bg->{default} = 1; + $basketgroup = $bg; } } my %emptygroup = ( id => undef, @@ -339,6 +340,7 @@ if ( $op eq 'delete_confirm' ) { currency => $cur->{'currency'}, listincgst => $bookseller->{listincgst}, basketgroups => $basketgroups, + basketgroup => $basketgroup, grouped => $basket->{basketgroupid}, unclosable => @orders ? 0 : 1, has_budgets => $has_budgets, 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 f271823c34..3524ecd0d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -232,24 +232,38 @@ [% IF ( closedate ) %]
+

+ + [% IF basketgroup.closed %] + [% basketgroup.name %] (closed) + [% ELSE %] +

+

+ + [% END %] +

-

-

- -

- - -

- + [% UNLESS basketgroup.closed %] +

+ + + + +

+ [% END %]
[% IF ( basketgroupdeliveryplace ) %]

Basket group delivery place: [% basketgroupdeliveryplace %]

[% END %] [% IF ( basketgroupbillingplace ) %]

Basket group billing place: [% basketgroupbillingplace %]

[% END %]