From 463c5a0f25a1e2dfc3331319bd86f17b4114821e Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 21 Jun 2016 14:49:32 -0400 Subject: [PATCH] Bug 4460: Amazon's AssociateID tag not used in links so referred revenue lost MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reworking based on output of: git grep "gp\/reader" Additionally, some changes might be in order though gp/reader works. https://affiliate-program.amazon.com/help/topic/t64/a1 suggests using dp A dp was discovered, so that part of the URL was left unchanged. The "/ref..." part was changed to just an Amazon tag ("?tag={AAT}") if defined. TEST PLAN --------- 1) Added: "100 years of Canadian foreign policy / edited by Robert Bothwell and Jean Daudelin." 2) Added a second book with the word foreign in the title. 3) Waited for reindex 4) Checked out the Canadian foreign policy book. 5) Applied patch 6) Made sure that: - AmazonAssocTag was set to TEST (easy to notice) - AmazonCoverImages was set to 'Show' - OPACAmazonCoverImages was set to 'Show' 7) Searched intranet for 'foreign' to find the detail page -- hovering over picture shows URL with ?tag=TEST in it. 8) Went to the OPAC Detail page 9) Toggling OPACURLOpenInNewWindow, confirmed that URL for the picture contained ?tag=TEST in it. 10) Logged into the OPAC 11) Confirmed the URL in the checked out list on your summary page contained ?tag=TEST in it. 12) Confirmed the URL in the checked out list on your reading history page contained ?tag=TEST in it. 13) Confirmed links worked (went to expected page) 14) run koha qa test tools Followed test plan. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- .../prog/en/modules/catalogue/detail.tt | 12 +++++++++--- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 9 +++++++-- .../bootstrap/en/modules/opac-readingrecord.tt | 8 +++++++- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 10 ++++++++-- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 31f772321c..e59fbaeb18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -4,6 +4,12 @@ [% USE Branches %] [% USE Biblio %] +[% IF Koha.Preference('AmazonAssocTag') %] + [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] +[% ELSE %] + [% AmazonAssocTag = '' %] +[% END %] + [% ShowCourseReserves = 0 %] [% IF UseCourseReserves %] [% FOREACH item IN itemloop %] @@ -434,7 +440,7 @@ function verify_images() { [% END %] [% IF ( AmazonCoverImages ) %] [% END %] @@ -508,7 +514,7 @@ function verify_images() { [% END %] [% IF ( AmazonCoverImages ) %] @@ -1045,7 +1051,7 @@ function verify_images() { [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]

Editions

-[% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] +[% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] [% UNLESS ( item_level_itypes ) %][% END %]
[% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %][% XISBN.description %][% END %][% XISBN.title |html %] by [% XISBN.author | html %] ©[% XISBN.copyrightdate %] [% IF ( XISBN.publishercode ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 1e621577b4..8aea0f3166 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -5,6 +5,11 @@ [% USE AuthorisedValues %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %] +[% IF Koha.Preference('AmazonAssocTag') %] + [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] +[% ELSE %] + [% AmazonAssocTag = '' %] +[% END %] [% ShowCourseReservesHeader = 0 %] [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %] @@ -55,9 +60,9 @@ [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( OPACURLOpenInNewWindow ) %] - + [% ELSE %] - + [% END %] Cover image [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt index 86b0923378..4647001f7b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -10,6 +10,12 @@ [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %] [% INCLUDE 'masthead.inc' %] +[% IF Koha.Preference('AmazonAssocTag') %] + [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] +[% ELSE %] + [% AmazonAssocTag = '' %] +[% END %] +
[% IF OPACAmazonCoverImages %] [% IF issue.normalized_isbn %] - + [% ELSE %] No cover image available [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index d8539d4cea..3f541367e1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -15,6 +15,12 @@ [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %] [% INCLUDE 'masthead.inc' %] +[% IF Koha.Preference('AmazonAssocTag') %] + [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] +[% ELSE %] + [% AmazonAssocTag = '' %] +[% END %] +
[% IF ( OPACAmazonCoverImages ) %] [% IF ( OVERDUE.normalized_isbn ) %] - View on Amazon.com + View on Amazon.com [% ELSE %] No cover image available [% END %] -- 2.39.5