X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=acqui%2Fbasketheader.pl;h=18090c449f7adbffc0402129337495135627f1e8;hb=5a9b8d9359424a3f0316f89348038fbb290e722b;hp=93bd7f8ebff77345c9995cf9e3a96ae3f9e0e87f;hpb=840a907b86c054aa1c216a8cf353b1a9ef3c44fa;p=koha.git diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 93bd7f8ebf..18090c449f 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -7,18 +7,18 @@ # # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . =head1 NAME @@ -47,19 +47,20 @@ If it exists, C<$basketno> is the basket we edit use strict; use warnings; -use CGI; +use CGI qw ( -utf8 ); use C4::Context; use C4::Auth; use C4::Branch; use C4::Output; -use C4::Acquisition qw/GetBasket NewBasket GetContracts ModBasketHeader/; -use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/; +use C4::Acquisition qw/GetBasket NewBasket ModBasketHeader/; +use C4::Contract qw/GetContracts/; +use Koha::Acquisition::Bookseller; my $input = new CGI; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "acqui/basketheader.tmpl", + template_name => "acqui/basketheader.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -84,7 +85,12 @@ if ( $op eq 'add_form' ) { if (! $booksellerid) { $booksellerid=$basket->{'booksellerid'}; } - @contractloop = &GetContracts($booksellerid, 1); + my $contracts = GetContracts({ + booksellerid => $booksellerid, + activeonly => 1, + }); + + @contractloop = @$contracts; for (@contractloop) { if ( $basket->{'contractnumber'} eq $_->{'contractnumber'} ) { $_->{'selected'} = 1; @@ -94,15 +100,19 @@ if ( $op eq 'add_form' ) { } else { #new basket my $basket; - push(@contractloop, &GetContracts($booksellerid, 1)); + my $contracts = GetContracts({ + booksellerid => $booksellerid, + activeonly => 1, + }); + push(@contractloop, @$contracts); } - my $bookseller = GetBookSellerFromId($booksellerid); + my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); my $count = scalar @contractloop; if ( $count > 0) { $template->param(contractloop => \@contractloop, basketcontractnumber => $basket->{'contractnumber'}); } - my @booksellers = C4::Bookseller::GetBookSeller(); + my @booksellers = Koha::Acquisition::Bookseller->search; $template->param( add_form => 1, basketname => $basket->{'basketname'}, basketnote => $basket->{'note'},