diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 6bcde5f99d..2dffe78cf9 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -15,8 +15,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use Encode qw(encode); @@ -28,7 +27,7 @@ use C4::Biblio; use C4::Items; use C4::Auth; use C4::Output; -use C4::Biblio; +use C4::Templates (); use Koha::Email; my $query = new CGI; @@ -56,15 +55,13 @@ if ( $email_add ) { my $email = Koha::Email->new(); my %mail = $email->create_message_headers({ to => $email_add }); my $comment = $query->param('comment'); - my ( $template2, $borrowernumber, $cookie ) = get_template_and_user( - { - template_name => "basket/sendbasket.tt", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => { catalogue => 1 }, - } + + # Since we are already logged in, no need to check credentials again + # We only need to add OPACBaseURL + my $template2 = C4::Templates::gettemplate( + 'basket/sendbasket.tt', 'intranet', $query, ); + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); my @bibs = split( /\//, $bib_list ); my @results; diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index bf4f1a1c0a..4d4bd4f7ca 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -17,8 +17,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use Encode qw(encode); @@ -30,8 +29,8 @@ use C4::Biblio; use C4::Items; use C4::Auth; use C4::Output; -use C4::Biblio; use C4::Members; +use C4::Templates (); use Koha::Email; my $query = new CGI; @@ -70,14 +69,12 @@ if ( $email_add ) { }); $mail{'X-Abuse-Report'} = C4::Context->preference('KohaAdminEmailAddress'); - my ( $template2, $borrowernumber, $cookie ) = get_template_and_user( - { - template_name => "opac-sendbasket.tt", - query => $query, - type => "opac", - authnotrequired => 0, - } + # Since we are already logged in, no need to check credentials again + # We only need to add OPACBaseURL + my $template2 = C4::Templates::gettemplate( + 'opac-sendbasket.tt', 'opac', $query, ); + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); my @bibs = split( /\//, $bib_list ); my @results;