projects
/
koha_gimpoz
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for Bug 4886, missing 404 redirection on wrong biblionumber for MARC and ISBD...
[koha_gimpoz]
/
opac
/
opac-sendbasket.pl
diff --git
a/opac/opac-sendbasket.pl
b/opac/opac-sendbasket.pl
index
87e71b6
..
76400a5
100755
(executable)
--- a/
opac/opac-sendbasket.pl
+++ b/
opac/opac-sendbasket.pl
@@
-16,15
+16,20
@@
# Suite 330, Boston, MA 02111-1307 USA
use strict;
# Suite 330, Boston, MA 02111-1307 USA
use strict;
-require Exporter;
+use warnings;
+
use CGI;
use CGI;
+use Encode qw(encode);
+
use Mail::Sendmail;
use MIME::QuotedPrint;
use MIME::Base64;
use C4::Biblio;
use Mail::Sendmail;
use MIME::QuotedPrint;
use MIME::Base64;
use C4::Biblio;
+use C4::Items;
use C4::Auth;
use C4::Auth;
-use C4::
Interface::CGI::
Output;
+use C4::Output;
use C4::Biblio;
use C4::Biblio;
+use C4::Members;
my $query = new CGI;
my $query = new CGI;
@@
-33,7
+38,7
@@
my ( $template, $borrowernumber, $cookie ) = get_template_and_user (
template_name => "opac-sendbasketform.tmpl",
query => $query,
type => "opac",
template_name => "opac-sendbasketform.tmpl",
query => $query,
type => "opac",
- authnotrequired =>
1
,
+ authnotrequired =>
0
,
flagsrequired => { borrow => 1 },
}
);
flagsrequired => { borrow => 1 },
}
);
@@
-77,9
+82,16
@@
if ( $email_add ) {
my @items = &GetItemsInfo( $biblionumber, 'opac' );
my @items = &GetItemsInfo( $biblionumber, 'opac' );
+ my $hasauthors = 0;
+ if($dat->{'author'} || @$marcauthorsarray) {
+ $hasauthors = 1;
+ }
+
+
$dat->{MARCNOTES} = $marcnotesarray;
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
$dat->{MARCAUTHORS} = $marcauthorsarray;
$dat->{MARCNOTES} = $marcnotesarray;
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
$dat->{MARCAUTHORS} = $marcauthorsarray;
+ $dat->{HASAUTHORS} = $hasauthors;
$dat->{'biblionumber'} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;
$dat->{'biblionumber'} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;
@@
-89,10
+101,15
@@
if ( $email_add ) {
}
my $resultsarray = \@results;
}
my $resultsarray = \@results;
+
+ my $user = GetMember(borrowernumber => $borrowernumber);
+
$template2->param(
BIBLIO_RESULTS => $resultsarray,
email_sender => $email_sender,
$template2->param(
BIBLIO_RESULTS => $resultsarray,
email_sender => $email_sender,
- comment => $comment
+ comment => $comment,
+ firstname => $user->{firstname},
+ surname => $user->{surname},
);
# Getting template result
);
# Getting template result
@@
-115,7
+132,7
@@
if ( $email_add ) {
$email_file = $1;
}
$email_file = $1;
}
- if ( $template_res =~ /<MESSAGE>\n(.*)\n<END_MESSAGE>/s ) { $body =
$1
; }
+ if ( $template_res =~ /<MESSAGE>\n(.*)\n<END_MESSAGE>/s ) { $body =
encode_qp($1)
; }
my $boundary = "====" . time() . "====";
my $boundary = "====" . time() . "====";
@@
-128,13
+145,14
@@
if ( $email_add ) {
# # Writing mail
# $mail{body} =
$mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
# # 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} = <<END_OF_BODY;
$boundary
$boundary = '--' . $boundary;
$mail{body} = <<END_OF_BODY;
$boundary
-Content-Type: text/plain; charset="
iso-8859-1
"
+Content-Type: text/plain; charset="
utf-8
"
Content-Transfer-Encoding: quoted-printable
Content-Transfer-Encoding: quoted-printable
+$email_header
$body
$boundary
Content-Type: application/octet-stream; name="basket.iso2709"
$body
$boundary
Content-Type: application/octet-stream; name="basket.iso2709"