From bdbc60a3ba3d0b82d83a7a1bae143bae8c28b0b4 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Tue, 28 Apr 2009 22:14:24 +0200 Subject: [PATCH] new order management * manage granular permissions * deal with z3950 import --- acqui/neworderbiblio.pl | 35 ++++++++++--------- .../prog/en/modules/acqui/neworderbiblio.tmpl | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/acqui/neworderbiblio.pl b/acqui/neworderbiblio.pl index 824b664b2d..30f615046a 100755 --- a/acqui/neworderbiblio.pl +++ b/acqui/neworderbiblio.pl @@ -4,6 +4,7 @@ #now script to do searching for acquisitions # Copyright 2000-2002 Katipo Communications +# Copyright 2008-2009 BibLibre SARL # # This file is part of Koha. # @@ -55,11 +56,11 @@ the basket number to know on which basket this script have to add a new order. =cut use strict; + use C4::Search; use CGI; use C4::Bookseller; use C4::Biblio; - use C4::Auth; use C4::Output; use C4::Koha; @@ -72,11 +73,9 @@ my $params = $input->Vars; 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( @@ -85,7 +84,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { acquisition => 1 }, + flagsrequired => { acquisition => 'order_manage' }, } ); @@ -106,16 +105,18 @@ if (defined $error) { 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( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl index c600b8cd9c..6fa0229140 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tmpl @@ -19,7 +19,7 @@ - results found +results found, FIXME:: pagenum count is wrong!!!

No results found

-- 2.20.1