From 748b9db27649b86a2298aafc055edd2563e3ec06 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 30 Oct 2009 13:39:10 +0100 Subject: [PATCH] fixing "close basket and create basket group" feature the checkbox was not functional, now it is. --- acqui/basket.pl | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 914ca7ed9b..41402fd613 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -138,19 +138,29 @@ if ( $op eq 'delete_confirm' ) { } elsif ($op eq 'close') { my $confirm = $query->param('confirm'); if ($confirm) { - my $basketno = $query->param('basketno'); - my $booksellerid = $query->param('booksellerid'); - $basketno =~ /^\d+$/ and CloseBasket($basketno); - print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno='.$basketno.'&op=attachbasket&booksellerid=' . $booksellerid); - exit; - + my $basketno = $query->param('basketno'); + my $booksellerid = $query->param('booksellerid'); + $basketno =~ /^\d+$/ and CloseBasket($basketno); + # if requested, create basket group, close it and attach the basket + if ($query->param('createbasketgroup')) { + my $basketgroupid = NewBasketgroup( { name => $basket->{basketname}, + booksellerid => $booksellerid, + closed => 1, + }); + ModBasket( { basketno => $basketno, + basketgroupid => $basketgroupid } ); + print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?booksellerid='.$booksellerid); + } else { + print $query->redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno='.$basketno.'&op=attachbasket&booksellerid=' . $booksellerid); + } + exit; } else { - $template->param(confirm_close => "1", - booksellerid => $booksellerid, - basketno => $basket->{'basketno'}, - basketname => $basket->{'basketname'}, - basketgroupname => $basket->{'basketname'}); - + $template->param(confirm_close => "1", + booksellerid => $booksellerid, + basketno => $basket->{'basketno'}, + basketname => $basket->{'basketname'}, + basketgroupname => $basket->{'basketname'}); + } } elsif ($query->param('op') eq 'reopen') { my $basket; -- 2.39.5