fixed variable masking warnings found by perl -w
[koha_gimpoz] / cataloguing / z3950_search.pl
index f990dcc..063cf4a 100755 (executable)
@@ -39,6 +39,7 @@ my $title         = $input->param('title');
 my $author        = $input->param('author');
 my $isbn          = $input->param('isbn');
 my $issn          = $input->param('issn');
+my $lccn          = $input->param('lccn');
 my $random        = $input->param('random');
 my $op            = $input->param('op');
 my $noconnection;
@@ -56,13 +57,12 @@ my $count;
 my $toggle;
 my $record;
 my $oldbiblio;
-my $dbh = C4::Context->dbh;
 my $errmsg;
 my @serverloop = ();
 my @serverhost;
 my @breeding_loop = ();
 
-my $DEBUG = 1;    # if set to 1, many debug message are send on syslog.
+my $DEBUG = 0;    # if set to 1, many debug message are send on syslog.
 
 unless ($random)
 {    # this var is not useful anymore just kept to keep rel2_2 compatibility
@@ -89,6 +89,7 @@ if ( $op ne "do_search" ) {
     $template->param(
         isbn         => $isbn,
         issn         => $issn,
+        lccn         => $lccn,
         title        => $title,
         author       => $author,
         serverloop   => $serverloop,
@@ -108,6 +109,10 @@ else {
         $term = $isbn if ($isbn);
         $term = $issn if ($issn);
     }
+    elsif ($lccn) {
+        $attr = '1=9';
+        $term = $lccn;
+    }
     elsif ($title) {
         $attr = '1=4 ';
         utf8::decode($title);
@@ -136,11 +141,11 @@ else {
             $option1->option( 'preferredRecordSyntax', $server->{syntax} );
             $oConnection[$s] = create ZOOM::Connection($option1)
               || $DEBUG
-              && warn( "something went wrong: " . $oConnection[$s]->errmsg() );
+              && warn( "" . $oConnection[$s]->errmsg() );
             warn( "server data", $server->{name}, $server->{port} ) if $DEBUG;
             $oConnection[$s]->connect( $server->{host}, $server->{port} )
               || $DEBUG
-              && warn( "something went wrong: " . $oConnection[$s]->errmsg() );
+              && warn( "" . $oConnection[$s]->errmsg() );
             $serverhost[$s] = $server->{host};
             $encoding[$s]   = $server->{syntax};
             $s++;
@@ -205,21 +210,18 @@ else {
                         $notmarcrecord, $alreadyindb, $alreadyinfarm,
                         $imported,      $breedingid
                       )
-                      = ImportBreeding( $marcdata, 1, $serverhost[$k],
-                        $encoding[$k], $random );
-                        
-                        $encoding[$k], $random ));
-                        
+                      = ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' );
                     my %row_data;
                     if ( $i % 2 ) {
-                        $toggle = "#ffffcc";
+                        $toggle = 1;
                     }
                     else {
-                        $toggle = "white";
+                        $toggle = 0;
                     }
                     $row_data{toggle}       = $toggle;
                     $row_data{server}       = $serverhost[$k];
                     $row_data{isbn}         = $oldbiblio->{isbn};
+                    $row_data{lccn}         = $oldbiblio->{lccn};
                     $row_data{title}        = $oldbiblio->{title};
                     $row_data{author}       = $oldbiblio->{author};
                     $row_data{breedingid}   = $breedingid;