#now script to do searching for acquisitions
# Copyright 2000-2002 Katipo Communications
+# Copyright 2008-2009 BibLibre SARL
#
# This file is part of Koha.
#
=cut
use strict;
+
use C4::Search;
use CGI;
use C4::Bookseller;
use C4::Biblio;
-
use C4::Auth;
use C4::Output;
use C4::Koha;
my $page = $params->{'page'} || 1;
my $query = $params->{'q'};
my $results_per_page = $params->{'num'} || 20;
-
-my $booksellerid = $params->{'booksellerid'};
-my $basketno = $params->{'basketno'};
-my $sub = $params->{'sub'};
-my $bookseller = GetBookSellerFromId($booksellerid);
+my $booksellerid = $params->{'booksellerid'};
+my $basketno = $params->{'basketno'};
+my $sub = $params->{'sub'};
# getting the template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { acquisition => 1 },
+ flagsrequired => { acquisition => 'order_manage' },
}
);
my @results;
-foreach my $i ( 0 .. scalar @$marcresults ) {
- my %resultsloop;
- my $marcrecord = MARC::File::USMARC::decode($marcresults->[$i]);
- my $biblio = TransformMarcToKoha(C4::Context->dbh,$marcrecord,'');
-
- #build the hash for the template.
- %resultsloop=%$biblio;
- $resultsloop{highlight} = ($i % 2)?(1):(0);
- $resultsloop{booksellerid} = $booksellerid;
- push @results, \%resultsloop;
+if ($marcresults) {
+ foreach my $i ( 0 .. scalar @$marcresults ) {
+ my %resultsloop;
+ my $marcrecord = MARC::File::USMARC::decode( $marcresults->[$i] );
+ my $biblio = TransformMarcToKoha( C4::Context->dbh, $marcrecord, '' );
+
+ #build the hash for the template.
+ %resultsloop = %$biblio;
+ $resultsloop{highlight} = ( $i % 2 ) ? (1) : (0);
+ $resultsloop{booksellerid} = $booksellerid;
+ push @results, \%resultsloop;
+ }
}
$template->param(