From 5b41ce41f96fc5b98c39974d9ca36d8ccb5b92e9 Mon Sep 17 00:00:00 2001 From: Maxime Pelletier Date: Thu, 14 Nov 2013 13:46:44 -0500 Subject: [PATCH] Bug #5010 Fix use of OPACBaseURL on send list(shelf) and send basket of OPAC and staff client. To test, try sending a list and a basket in both opac and staff pages. All links should contains http:// followed by OPACBaseURL. If OPACBaseURL isn't set in the preferences, no links should be in the email. --- basket/sendbasket.pl | 4 ++++ koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt | 2 +- .../intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt | 2 ++ koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt | 2 +- virtualshelves/sendshelf.pl | 4 ++-- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 3f57de2..5333fa2 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -100,6 +100,10 @@ if ( $email_add ) { push( @results, $dat ); } + if (C4::Context->preference('OPACBaseURL')){ + $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); + } + my $resultsarray = \@results; $template2->param( BIBLIO_RESULTS => $resultsarray, 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 09ce7dd..9e798c4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt @@ -134,7 +134,7 @@ Your cart [% IF ( OPACBaseURL ) %]

- In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] + In online catalog: http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]

[% END %] [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt index 12e53ee..3c854e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ -34,8 +34,10 @@ Dewey: [% BIBLIO_RESULT.dewey %][% END %][% IF ( BIBLIO_RESULT.classification ) Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT.lccn ) %] LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %] URL : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %] +[% IF ( OPACBaseURL ) %] In the online catalog: http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] +[% END %] Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt index dc6929d..20e04ad 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt @@ -134,7 +134,7 @@ Your cart [% IF ( OPACBaseURL ) %]

- In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] + In online catalog: http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]

[% END %] [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt index c13a659..31ae702 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt @@ -142,7 +142,7 @@ Your list : [% shelfname %] [% IF ( OPACBaseURL ) %]

- In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %] + In online catalog: http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]

[% END %] [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 37a98ec..fb19c33 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -100,9 +100,9 @@ if ( $email ) { push( @results, $dat ); } - if (C4::Context->preference('OPACBaseURL')){ + if (C4::Context->preference('OPACBaseURL')){ $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') ); - } + } $template2->param( BIBLIO_RESULTS => \@results, -- 1.7.10.4