cleanup of opac-search.pl, synch with search.pl, etc.
[koha_fer] / C4 / Letters.pm
index 97344cd..07520ed 100644 (file)
@@ -24,12 +24,18 @@ use Mail::Sendmail;
 # use C4::Suggestions;
 use C4::Members;
 use C4::Log;
-require Exporter;
 
-our ( $VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS );
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
-# set the version for version checking
-$VERSION = 3.00;
+BEGIN {
+       require Exporter;
+       # set the version for version checking
+       $VERSION = 3.01;
+       @ISA = qw(Exporter);
+       @EXPORT = qw(
+       &GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts
+       );
+}
 
 =head1 NAME
 
@@ -48,10 +54,6 @@ C4::Letters - Give functions for Letters management
 
 =cut
 
-@ISA = qw(Exporter);
-@EXPORT =
-  qw(&GetLetters &getletter &addalert &getalert &delalert &findrelatedto &SendAlerts);
-
 =head2 GetLetters
 
   $letters = &getletters($category);
@@ -192,8 +194,7 @@ sub getalert {
     while ( my $line = $sth->fetchrow_hashref ) {
         push @result, $line;
     }
-    return \@result if $#result >= 0;    # return only if there is one result.
-    return;
+    return \@result;
 }
 
 =head2 findrelatedto
@@ -371,7 +372,7 @@ sub SendAlerts {
         # prepare the letter...
         # search the biblionumber
         my $strsth =
-"select serial.*,subscription.*, biblio.title from serial LEFT JOIN subscription on serial.subscriptionid=subscription.subscriptionid LEFT JOIN biblio on serial.biblionumber=biblio.biblionumber where serial.serialid IN ("
+"select serial.*,subscription.*, biblio.* from serial LEFT JOIN subscription on serial.subscriptionid=subscription.subscriptionid LEFT JOIN biblio on serial.biblionumber=biblio.biblionumber where serial.serialid IN ("
           . join( ",", @$externalid ) . ")";
         my $sthorders = $dbh->prepare($strsth);
         $sthorders->execute;
@@ -486,4 +487,5 @@ sub parseletter {
     }
 }
 
-END { }    # module clean-up code here (global destructor)
+1;
+__END__