[Koha-patches] [PATCH 26/78] new order management

paul.poulain at biblibre.com paul.poulain at biblibre.com
Thu May 28 18:32:36 CEST 2009


From: Paul Poulain <paul.poulain at biblibre.com>

* 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 824b664..30f6150 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 c600b8c..6fa0229 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 @@
 
 
 <!-- TMPL_IF NAME="total" -->
-<b><!-- TMPL_VAR NAME="total" --> results found</b>
+<b><!-- TMPL_VAR NAME="total" -->results found,  FIXME:: pagenum count is wrong!!!  </b> 
 <!-- TMPL_VAR name='pagination_bar'-->
 <!-- TMPL_ELSE -->
 <h3> No results found</h3>
-- 
1.6.0.4




More information about the Koha-patches mailing list