Bug 21395: Fix QA errors
authorJulian Maurice <julian.maurice@biblibre.com>
Mon, 27 Apr 2020 08:31:19 +0000 (10:31 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Jun 2020 10:37:02 +0000 (12:37 +0200)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

docs/CAS/CASProxy/examples/proxy_cas_data.pl
misc/migration_tools/22_to_30/export_Authorities.pl
misc/migration_tools/22_to_30/export_Authorities_xml.pl
misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl
reports/reserves_stats.pl
rewrite-config.PL
t/db_dependent/Record/Record.t

index 70ea24c..4c72a63 100755 (executable)
@@ -23,7 +23,7 @@
 
 =head1 CGI PARAMETERS
 
-=item PGTIOU
+=head2 PGTIOU
 
 The Proxy Granting Ticket IOU the CAS Server returned to us when we gave him the Service Ticket
 This PGTIOU will allow us to retrive the matching PGTID
index 956805a..479981c 100755 (executable)
@@ -31,7 +31,9 @@ while (my ($authid,$authtypecode)=$rq->fetchrow){
   
   if (C4::Context->preference('marcflavour') eq "UNIMARC"){
        $record->leader('     nac  22     1u 4500');
-    my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef
+    my @time = localtime(time);
+    my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]);
+    my $string= ($time=~m/([0-9\-]+)/) ? $1 : undef;
     $string=~s/\-//g;
      $string = sprintf("%-*s",26, $string);
      substr($string,9,6,"frey50");
index c8a5aa9..6c91708 100755 (executable)
@@ -30,7 +30,9 @@ open my $fileoutput, '>:encoding(UTF-8)', "./$filename/$authid.xml" or die "unab
                        
 #  if (C4::Context->preference('marcflavour') eq "UNIMARC"){
        $record->leader('     nac  22     1u 4500');
-    my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef
+    my @time = localtime(time);
+    my $time = sprintf('%04d%02d%02d', $time[5] + 1900, $time[4] + 1, $time[3]);
+    my $string = ($time=~m/([0-9\-]+)/) ? $1 : undef;
     $string=~s/\-//g;
      $string = sprintf("%-*s",26, $string);
      substr($string,9,6,"frey50");
index 38ea289..386831e 100755 (executable)
@@ -26,7 +26,7 @@ $dbh->do('ALTER TABLE `biblioitems` CHANGE `marc` `marc` LONGBLOB NULL DEFAULT N
 # adding marc xml, just for convenience
 $dbh->do('ALTER TABLE `biblioitems` ADD `marcxml` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ');
 # moving data from marc_subfield_value to biblio
-$sth = $dbh->prepare('select bibid,biblionumber from marc_biblio');
+my $sth = $dbh->prepare('select bibid,biblionumber from marc_biblio');
 $sth->execute;
 my $sth_update = $dbh->prepare('update biblioitems set marc=?, marcxml=? where biblionumber=?');
 my $totaldone=0;
@@ -46,7 +46,7 @@ while (my ($bibid,$biblionumber) = $sth->fetchrow) {
     $sth_update->execute($record->as_usmarc(),$record->as_xml_record($marcflavour),$biblionumber);
     $totaldone++;
     print ".";
-    print "\r$totaldone / $totaltodo" unless ($totaldone % 100);
+    print "\r$totaldone" unless ($totaldone % 100);
 }
 print "\rdone\n";
 
@@ -149,7 +149,6 @@ sub LocalMARCgetbiblio {
     }
     if (C4::Context->preference('marcflavour')=~/unimarc/i){
       $record->leader('     nac  22     1u 4500');
-      $update=1;
       my $string;
       if ($record->field(100)) {
         $string = substr($record->subfield(100,"a")."                                   ",0,35);
index c034d46..1d22561 100755 (executable)
@@ -38,11 +38,11 @@ use YAML;
 
 =head1 NAME
 
-    reports/reserve_stats.pl
+reports/reserve_stats.pl
 
 =head1 DESCRIPTION
 
-    Plugin that shows reserve stats
+Plugin that shows reserve stats
 
 =cut
 
index 3047f8d..f907a03 100644 (file)
@@ -60,6 +60,8 @@ also need to override WEBSERVER_IP.
 
 =cut
 
+my $myhost;
+my $mydomain;
 if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) {
     ( $mydomain = $myhost ) =~ s/.*?\.//;
 } else {
@@ -67,6 +69,7 @@ if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) {
     $mydomain = 'localdomain';
 }
 
+my $myip;
 unless ( $myip = $ENV{WEBSERVER_IP} ) {
     my $byname = gethostbyname( $myhost )
        or die "Could not get the IP address of $myhost, DNS fault? ($!)";
@@ -75,12 +78,12 @@ unless ( $myip = $ENV{WEBSERVER_IP} ) {
 }
 
 
-$prefix = $ENV{'INSTALL_BASE'} || "/usr";
+my $prefix = $ENV{'INSTALL_BASE'} || "/usr";
 
 # These are our configuration guesses
 # Keys were extracted by
 # <grep -o '__.*__' etc/* | cut -f2 -d: | sort -u | sed -e 's/^/  "/;s/$/" => "",/'
-%configuration = (
+my %configuration = (
   "__KOHA_INSTALLED_VERSION__" => "no_version_found",
   "__LOG_DIR__" => "/var/log",
   "__PLUGINS_DIR__" => "/var/lib/koha/plugins",
@@ -172,8 +175,8 @@ if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') {
     $configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = '';
 }
 
-$fname = $ARGV[0];
-$file = &read_file($fname);
+my $fname = $ARGV[0];
+my $file = &read_file($fname);
 $file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg;
 
 # At this point, file is in 'blib' and by default
index 6fb335f..384588d 100755 (executable)
@@ -61,7 +61,7 @@ foreach my $line (<$MARC21UTF8>) {
 $marc21_utf8 =~ s/\n$//;
 close $MARC21UTF8;
 
-open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat" or die $!;
+open(my $MARC21MARC8COMBCHARS, '<', WHEREAMI."/marc21_marc8_combining_chars.dat") or die $!;
 my $marc21_marc8_combining_chars;
 foreach my $line(<$MARC21MARC8COMBCHARS>) {
        $marc21_marc8_combining_chars.=$line;