X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=acqui%2Fbasketgroup.pl;h=ac0672c69f5abcad7e322b646086f29b05676e4b;hb=e9dc807b320356df4f5bc9f477b0181340278497;hp=d2e185624e34411eb8c5b54c40a794ba823db37c;hpb=f21577986f8ff5da5fde88deaae2302a8b40dbe7;p=koha_fer diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index d2e185624e..ac0672c69f 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -53,14 +53,14 @@ use C4::Output; use CGI; use C4::Bookseller qw/GetBookSellerFromId/; -use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket/; +use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/; use C4::Bookseller qw/GetBookSellerFromId/; use C4::Branch qw/GetBranches/; use C4::Members qw/GetMember/; -my $input=new CGI; +our $input=new CGI; -my ($template, $loggedinuser, $cookie) +our ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "acqui/basketgroup.tmpl", query => $input, type => "intranet", @@ -277,7 +277,7 @@ sub printbasketgrouppdf{ } -my $op = $input->param('op'); +my $op = $input->param('op') || 'display'; my $booksellerid = $input->param('booksellerid'); $template->param(booksellerid => $booksellerid); @@ -417,6 +417,14 @@ if ( $op eq "add" ) { printbasketgrouppdf($basketgroupid); exit; +}elsif ( $op eq "export" ) { + my $basketgroupid = $input->param('basketgroupid'); + print $input->header( + -type => 'text/csv', + -attachment => 'basketgroup' . $basketgroupid . '.csv', + ); + print GetBasketGroupAsCSV( $basketgroupid, $input ); + exit; }elsif( $op eq "delete"){ my $basketgroupid = $input->param('basketgroupid'); DelBasketgroup($basketgroupid);