X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-sendbasket.pl;h=9efa237c17d63f75144e81f509dc360bc6e9714a;hb=9389c0beccf52550c58dd461d1725e709a508784;hp=f959fbf3488c8e08fd474653cae39e0d862b1f69;hpb=8e41022b0d488dad005bf5d0f4388f1a74fb0df6;p=koha.git diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index f959fbf348..9efa237c17 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -16,8 +16,11 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; -require Exporter; +use warnings; + use CGI; +use Encode qw(encode); + use Mail::Sendmail; use MIME::QuotedPrint; use MIME::Base64; @@ -78,9 +81,16 @@ if ( $email_add ) { my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my $hasauthors = 0; + if($dat->{'author'} || @$marcauthorsarray) { + $hasauthors = 1; + } + + $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; $dat->{MARCAUTHORS} = $marcauthorsarray; + $dat->{HASAUTHORS} = $hasauthors; $dat->{'biblionumber'} = $biblionumber; $dat->{ITEM_RESULTS} = \@items; @@ -116,7 +126,7 @@ if ( $email_add ) { $email_file = $1; } - if ( $template_res =~ /\n(.*)\n/s ) { $body = $1; } + if ( $template_res =~ /\n(.*)\n/s ) { $body = encode_qp($1); } my $boundary = "====" . time() . "===="; @@ -129,13 +139,14 @@ if ( $email_add ) { # # Writing mail # $mail{body} = $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\""; - my $isofile = encode_base64($iso2709); + my $isofile = encode_base64(encode("UTF-8", $iso2709)); $boundary = '--' . $boundary; $mail{body} = <