misc subdir - Dates.pm integration and warnings fixes.
authorJoe Atzberger <joe.atzberger@liblime.com>
Tue, 4 Dec 2007 23:40:56 +0000 (17:40 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 5 Dec 2007 00:21:13 +0000 (18:21 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/cronjobs/notifyMailsOp.pl
misc/cronjobs/overduenotices-30.pl
misc/cronjobs/overduenotices.pl
misc/cronjobs/smsoverdues.pl
misc/marcimport_to_biblioitems.pl
misc/merge_authority.pl

index e2a086f..92ad027 100755 (executable)
@@ -1,6 +1,6 @@
 use strict;
 use C4::Context;
-use C4::Date;
+use C4::Dates;
 use Mail::Sendmail;  # comment out if not doing e-mail notices
 use Getopt::Long;
 use C4::Circulation;
index 40e9922..4d6b3fa 100755 (executable)
@@ -31,7 +31,7 @@
 
 use strict;
 use C4::Context;
-use C4::Date;
+use C4::Dates;
 use Mail::Sendmail;  # comment out if not doing e-mail notices
 use Getopt::Long;
 
index 349f4d3..0366cfa 100644 (file)
@@ -36,7 +36,7 @@
 
 use strict;
 use C4::Context;
-use C4::Date;
+use C4::Dates;
 use Mail::Sendmail;  # comment out if not doing e-mail notices
 use Getopt::Long;
 
index 5f93062..e43bc75 100755 (executable)
@@ -32,7 +32,7 @@ use C4::Search;
 use C4::Circulation;
 use C4::Circulation::Fines;
 use C4::Members;
-use C4::Date;
+use C4::Dates;
 use HTML::Template::Pro;
 use Mail::Sendmail;
 use Mail::RFC822::Address;
index cc80d5e..f56f72d 100644 (file)
@@ -31,56 +31,56 @@ SAMPLE :
 \t\$ perl misc/marcimport_to_biblioitems.pl  -file /home/jmf/koha.mrc 
 EOF
 ;#'
-die;
+       die;
 }
 my $starttime = gettimeofday;
 my $timeneeded;
 my $dbh = C4::Context->dbh;
 
 my $sth2=$dbh->prepare("update biblioitems  set marc=? where biblionumber=?");
-my $i=0;
-
 my $batch = MARC::Batch->new( 'USMARC', $input_marc_file );
 $batch->warnings_off();
 $batch->strict_off();
-my $i=0;
 my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumber","");
 
+my $i=0;
 while ( my $record = $batch->next() ) {
-my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield);
-$i++;
-$sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber;
-print "$biblionumber \n";
+       my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield);
+       $i++;
+       $sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber;
+       print "$biblionumber \n";
 }
 
 $timeneeded = gettimeofday - $starttime ;
-       print "$i records in $timeneeded s\n" ;
+print "$i records in $timeneeded s\n" ;
 
 END;
-sub search{
-my ($query)=@_;
-my $nquery="\ \@attr 1=1007  ".$query;
-my $oAuth=C4::Context->Zconn("biblioserver");
-if ($oAuth eq "error"){
-warn "Error/CONNECTING \n";
- return("error",undef);
-}
-my $oAResult;
-my $Anewq= new ZOOM::Query::PQF($nquery);
-eval {
-$oAResult= $oAuth->search_pqf($nquery) ; 
-};
-if($@){
-warn " /Cannot search:", $@->code()," /MSG:",$@->message(),"\n";
-  return("error",undef);
-}
-my $authrecord;
-my $nbresults="0";
- $nbresults=$oAResult->size();
-if ($nbresults eq "1" ){
-my $rec=$oAResult->record(0);
-my $marcdata=$rec->raw();
- $authrecord = MARC::File::USMARC::decode($marcdata);
+# IS THIS SUPPOSED TO BE __END__ ??  If not, then what is it?  --JBA
+
+sub search {
+       my ($query)=@_;
+       my $nquery="\ \@attr 1=1007  ".$query;
+       my $oAuth=C4::Context->Zconn("biblioserver");
+       if ($oAuth eq "error"){
+               warn "Error/CONNECTING \n";
+               return("error",undef);
+       }
+       my $oAResult;
+       my $Anewq= new ZOOM::Query::PQF($nquery);
+       eval {
+       $oAResult= $oAuth->search_pqf($nquery) ; 
+       };
+       if($@){
+               warn " /Cannot search:", $@->code()," /MSG:",$@->message(),"\n";
+               return("error",undef);
+       }
+       my $authrecord;
+       my $nbresults="0";
+       $nbresults=$oAResult->size();
+       if ($nbresults eq "1" ){
+               my $rec=$oAResult->record(0);
+               my $marcdata=$rec->raw();
+               $authrecord = MARC::File::USMARC::decode($marcdata);
+       }
+       return ($authrecord,$nbresults);
 }
-return ($authrecord,$nbresults);
-}
\ No newline at end of file
index 0e9d7db..5f6a7ae 100755 (executable)
@@ -106,11 +106,11 @@ while (my ($bibid,$tag,$tag_indicator,$tagorder,$subfieldcode,$subfieldorder) =
         &MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,$subfield->[0],$subfieldorder,$subfield->[1]);
     }
     &MARCaddsubfield($bibid,$tag,$tag_indicator,$tagorder,'9',$subfieldorder,$mergeto);
-    my $biblio = GetMarcBiblio($bibid);
+    $biblio = GetMarcBiblio($bibid);
     print "AFTER : ".$biblio->as_formatted."\n" if $verbose;
     $nbdone++;
 #     &MARCdelsubfield($dbh,$bibid,$tag,$tagorder,$subfieldcode,$subfieldorder);
     
 }
 my $timeneeded = gettimeofday - $starttime;
-print "$nbdone authorities done in $timeneeded seconds" unless $noconfirm;
\ No newline at end of file
+print "$nbdone authorities done in $timeneeded seconds" unless $noconfirm;