see mail on koha-devel : code cleaning on Search.pm + normalizing API + use of biblio...
[koha_ffzg] / opac / opac-sendbasket.pl
index bb0f466..90835a9 100755 (executable)
@@ -6,7 +6,6 @@ use Mail::Sendmail;
 use MIME::QuotedPrint;
 use MIME::Base64;
 use C4::Context;
-use C4::Search;
 use C4::Biblio;
 use C4::Auth;
 use C4::Interface::CGI::Output;
@@ -52,7 +51,7 @@ if ($email_add) {
                $template2->param(biblionumber => $biblionumber);
 
                my $dat = &bibdata($biblionumber);
-               my ($authorcount, $addauthor) = &addauthor($biblionumber);
+               my ($authorcount, $addauthor) = &getaddauthor($biblionumber);
                my @items                     = &ItemInfo(undef, $biblionumber, 'opac');
 
                $dat->{'additional'}=$addauthor->[0]->{'author'};
@@ -70,10 +69,8 @@ if ($email_add) {
                push (@results, $dat);
        }
 
-    $email_header = encode_qp($email_header);
-
-    $boundary = "--" . $boundary;
-
+    # Getting template result                                                                                             
+    my $template_res = $template2->output();
        # Analysing information and getting mail properties
        if ($template_res =~ /<SUBJECT>\n(.*)\n<END_SUBJECT>/s) { $mail{'subject'} = $1; }
        else { $mail{'subject'} = "no subject"; }