Bugzilla – Attachment 54472 Details for
Bug 17109
sendbasket: Remove second authentication, add CSRF token
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17109: Use Koha.Preference in sendbasket template
Bug-17109-Use-KohaPreference-in-sendbasket-templat.patch (text/plain), 3.66 KB, created by
Marc Véron
on 2016-08-15 13:07:15 UTC
(
hide
)
Description:
Bug 17109: Use Koha.Preference in sendbasket template
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-08-15 13:07:15 UTC
Size:
3.66 KB
patch
obsolete
>From 640a6d2cd491ebfc0b496963960b3d5d0f527ac6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 12 Aug 2016 08:29:42 +0200 >Subject: [PATCH] Bug 17109: Use Koha.Preference in sendbasket template >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >No need to send OPACBaseURL to the template, if you load the Koha TT >plugin inside the template. > >Test plan: >Send a few items in your cart from OPAC and intranet. > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > basket/sendbasket.pl | 3 +-- > koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt | 6 ++++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt | 6 ++++-- > opac/opac-sendbasket.pl | 3 +-- > 4 files changed, 10 insertions(+), 8 deletions(-) > >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 802ca33..f54caba 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -68,11 +68,10 @@ if( $csrf_err ) { > my $comment = $query->param('comment'); > > # Since we are already logged in, no need to check credentials again >- # We only need to add OPACBaseURL >+ # when loading a second template. > 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/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt >index adb47cd..68e735c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt >@@ -1,9 +1,10 @@ >+[% USE HtmlToText %] >+[% USE Koha %] >+ > <SUBJECT> > Your cart > <END_SUBJECT> > >-[% USE HtmlToText %] >- > <HEADER> > > [% FILTER html2text %] >@@ -130,6 +131,7 @@ Your cart > [% END %] > </p> > >+ [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] > [% IF ( OPACBaseURL ) %] > <p> > In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >index 7c7978f..47d03f1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >@@ -1,9 +1,10 @@ >+[% USE HtmlToText %] >+[% USE Koha %] >+ > <SUBJECT> > Your cart > <END_SUBJECT> > >-[% USE HtmlToText %] >- > <HEADER> > > [% FILTER html2text %] >@@ -130,6 +131,7 @@ Your cart > [% END %] > </p> > >+ [% SET OPACBaseURL = Koha.Preference('OPACBaseURL') %] > [% IF ( OPACBaseURL ) %] > <p> > In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] >diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index b1f6f3e..6b9ba43 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -81,11 +81,10 @@ if( $csrf_err ) { > $mail{'X-Abuse-Report'} = C4::Context->preference('KohaAdminEmailAddress'); > > # Since we are already logged in, no need to check credentials again >- # We only need to add OPACBaseURL >+ # when loading a second template. > my $template2 = C4::Templates::gettemplate( > 'opac-sendbasket.tt', 'opac', $query, > ); >- $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); > > my @bibs = split( /\//, $bib_list ); > my @results; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17109
:
54309
|
54310
|
54325
|
54470
|
54471
|
54472
|
54503
|
54705
|
54706
|
54707
|
54708