# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
-# $Id$
use strict;
-require Exporter;
+use CGI;
+use Mail::Sendmail;
+
use C4::Context;
use C4::Output;
-use C4::Date;
-use Mail::Sendmail;
+use C4::Dates qw(format_date);
use vars qw($VERSION @ISA @EXPORT);
-# set the version for version checking
-$VERSION = do { my @v = '$Revision$' =~ /\d+/g;
- shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
+BEGIN {
+ # set the version for version checking
+ $VERSION = 3.01;
+ require Exporter;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(
+ &NewSuggestion
+ &SearchSuggestion
+ &GetSuggestion
+ &GetSuggestionByStatus
+ &DelSuggestion
+ &CountSuggestion
+ &ModStatus
+ &ConnectSuggestionAndBiblio
+ &GetSuggestionFromBiblionumber
+ );
+}
=head1 NAME
=head1 FUNCTIONS
-=cut
-
-@ISA = qw(Exporter);
-@EXPORT = qw(
- &NewSuggestion
- &SearchSuggestion
- &GetSuggestion
- &GetSuggestionByStatus
- &DelSuggestion
- &CountSuggestion
- &ModStatus
- &ConnectSuggestionAndBiblio
- &GetSuggestionFromBiblionumber
- );
-
=head2 SearchSuggestion
(\@array) = &SearchSuggestion($user,$author,$title,$publishercode,$status,$suggestedbyme)
else {
my $query = qq |
SELECT count(*)
- FROM suggestions,borrowers
+ FROM suggestions LEFT JOIN borrowers ON borrowers.borrowernumber=suggestions.suggestedby
WHERE status=?
- AND borrowers.borrowernumber=suggestions.suggestedby
AND (borrowers.branchcode='' OR borrowers.branchcode =?)
|;
$sth = $dbh->prepare($query);
$sth = $dbh->prepare($queryMail);
$sth->execute($suggestionid);
my $emailinfo = $sth->fetchrow_hashref;
- my $template = gettemplate("suggestion/mail_suggestion_$status.tmpl","intranet");
+ my $template = gettemplate("suggestion/mail_suggestion_$status.tmpl", "intranet", CGI->new());
$template->param(
byemail => $emailinfo->{byemail},