From e94e4476f126e131bd343c0a3524f9a093784bc8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 12 Oct 2021 15:31:46 +0000 Subject: [PATCH] Bug 29200: Remove Adlibris cover service This patch removes integration of the Adlibris cover service which has been discontinued. To test, apply the patch and rebuild the OPAC and staff interface CSS: (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Run the database update. - Go to Administration -> System preferences -> Enhanced content. You should see no Adlibris-related preferences. - Perform a catalog search and confirm that the search result and detail pages look correct. - Enable one or more other cover image services and test that search results and detail page look correct. - Perform the same test in the OPAC including these pages: - Catalog search results - Bibliographic detail page - Lists - Comments - User summary - User reading history Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug-29200.pl | 14 ++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 -- .../prog/css/src/staff-global.scss | 8 -------- .../admin/preferences/enhanced_content.pref | 16 ---------------- .../prog/en/modules/catalogue/detail.tt | 17 ++--------------- .../prog/en/modules/catalogue/results.tt | 15 +++------------ koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 8 -------- .../bootstrap/en/modules/opac-detail.tt | 6 ------ .../bootstrap/en/modules/opac-opensearch.tt | 5 ----- .../bootstrap/en/modules/opac-readingrecord.tt | 12 ------------ .../bootstrap/en/modules/opac-results.tt | 8 -------- .../bootstrap/en/modules/opac-shelves.tt | 6 +----- .../en/modules/opac-showreviews-rss.tt | 5 ----- .../bootstrap/en/modules/opac-showreviews.tt | 5 ----- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 16 ++++------------ 15 files changed, 24 insertions(+), 119 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug-29200.pl diff --git a/installer/data/mysql/atomicupdate/bug-29200.pl b/installer/data/mysql/atomicupdate/bug-29200.pl new file mode 100755 index 0000000000..550aaec800 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-29200.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "29200", + description => "Remove Adlibris cover service integration", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{DELETE FROM systempreferences WHERE variable LIKE 'AdlibrisCovers%'}); + # Print useful stuff here + say $out "AdlibrisCoversEnabled and AdlibrisCoversURL preferences removed."; + }, +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 5339382c27..dd2f184931 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -13,8 +13,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'), ('AddressForFailedOverdueNotices', '', NULL, 'Destination email for failed overdue notices. If left empty then it will fallback to the first defined address in the following list: Library ReplyTo, Library Email, ReplytoDefault and KohaAdminEmailAddress', 'free'), ('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'), -('AdlibrisCoversEnabled','0',NULL,'Display cover images in OPAC results and detail listing from Swedish retailer Adlibris.','YesNo'), -('AdlibrisCoversURL','http://www.adlibris.com/se/organisationer/showimagesafe.aspx',NULL,'Base URL for Adlibris cover image web service.','Free'), ('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'), ('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option. Example: eng|fre|ita','Textarea'), ('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index ac1a68a940..b59fe6a067 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4326,14 +4326,6 @@ input.renew { } } -.adlibris-cover { - max-height: 120px; -} - -.adlibris-cover-big { - max-height: 200px; -} - #tools_holidays { .radio, .checkbox { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index d87f0487c9..33edeb64e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -1,20 +1,4 @@ Enhanced content: - Adlibris: - - - - NOTE: Using resources such as external images might leak sensitive data to third parties. - - - - pref: AdlibrisCoversEnabled - default: 0 - choices: - 0: "Don't show" - 1: "Show" - - cover images in OPAC results and detail listing from Swedish retailer Adlibris. - - - - "Use base URL: " - - pref: AdlibrisCoversURL - class: url - default: "http://www.adlibris.com/se/organisationer/showimagesafe.aspx" - - for the Adlibris cover service. All: - - NOTE: you can only choose one source of cover images from below, otherwise Koha will show the images from all sources selected. 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 7c2b961d6c..7aec8b8881 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -9,8 +9,6 @@ [% USE Price %] [% USE TablesSettings %] [% PROCESS 'i18n.inc' %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF Koha.Preference('AmazonAssocTag') %] [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] @@ -106,7 +104,7 @@ [% END %] - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
[% ELSE %]
@@ -194,7 +192,7 @@ [% END %] - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
@@ -211,15 +209,6 @@ [% END %] [% END %] - [% IF ( AdlibrisEnabled && normalized_isbn ) %] -
- - Adlibris cover image - -
Image from Adlibris
-
- [% END %] - [% IF ( AmazonCoverImages && normalized_isbn) %]
@@ -1078,8 +1067,6 @@ Note that permanent location is a code, and location may be an authval. } div.find(".hint").html(coce_description); lightbox_descriptions.push(coce_description); - } else if ( div.attr("id") == "adlibris-coverimg" ){ - lightbox_descriptions.push(_("Image from Adlibris (see the original image)").format($(img).data('link'))); } else if ( div.attr("class") == "cover-image local-coverimg" ) { lightbox_descriptions.push(_("Local cover image (edit)").format($(img).data('link'))); } else { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 0fbbc1b8fe..4115ddacf7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -7,8 +7,6 @@ [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% USE AuthorisedValues %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF BiblioDefaultViewmarc %] [% SET DetailPage="MARCdetail.pl" %] [% ELSIF BiblioDefaultViewlabeled_marc %] @@ -425,7 +423,7 @@ - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] [% END %] @@ -435,7 +433,7 @@ [% SET MaxSearchResultsItemsPerRecordStatusCheck = Koha.Preference('MaxSearchResultsItemsPerRecordStatusCheck') %] [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] -[% END # /IF( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce )%] +[% END # /IF( AmazonCoverImages || LocalCoverImages || IntranetCoce )%]
 Results
[% IF ( LocalCoverImages ) %][% SEARCH_RESULT.localimage | html %] @@ -447,13 +445,6 @@
[% END %] - [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %] -
- Adlibris cover image -
Adlibris cover image
-
- [% END %] - [% IF ( AmazonCoverImages && SEARCH_RESULT.normalized_isbn ) %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index e2f246f373..746674515b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2449,14 +2449,6 @@ nav { } } -.adlibris-cover { - max-height: 120px; -} - -.adlibris-cover-big { - max-height: 200px; -} - /* jQuery Bar Rating plugin for star ratings */ $star-default: #D2D2D2; 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 0d417a7771..05266aa1ae 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -13,8 +13,6 @@ [% ELSE %] [% AmazonAssocTag = '' %] [% END %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% ShowCourseReservesHeader = 0 %] [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %] @@ -69,10 +67,6 @@
[% END %] - [% IF ( AdlibrisEnabled && normalized_isbn ) %] - Cover image - [% END %] - [% IF ( OPACAmazonCoverImages ) %] [% IF ( OPACURLOpenInNewWindow ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt index 6d65b32a28..3d3ac81ed5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -1,8 +1,6 @@ [%- USE raw -%] [%- USE Koha -%] -[%- SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') -%] -[%- SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') -%] [% IF ( opensearchdescription ) %] @@ -52,9 +50,6 @@ [% OPACBaseURL | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %] [% END %] -[% END %] [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %] 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 fdbaf8285d..7c39e5cb93 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -11,8 +11,6 @@ [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %] [% INCLUDE 'masthead.inc' %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF Koha.Preference('AmazonAssocTag') %] [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] @@ -108,16 +106,6 @@ [% issuetype | html %]
- [% IF ( AdlibrisEnabled && issue.normalized_isbn ) %] - [% IF issue.BiblioDefaultViewmarc %] - - [% ELSIF issue.BiblioDefaultViewisbd %] - - [% ELSE %] - - [% END %] - Adlibris cover image - [% END %] [% IF OPACAmazonCoverImages %] [% IF issue.normalized_isbn %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 3a9be017dc..5e19a66947 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -3,8 +3,6 @@ [% USE Koha %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF firstPage %] [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] @@ -362,12 +360,6 @@ [% END %] - [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %] - - Adlibris thumbnail for ISBN: [% SEARCH_RESULT.normalized_isbn | html %] - - [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( SEARCH_RESULT.normalized_isbn ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index e1191095d7..4c19a94e4f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -5,8 +5,6 @@ [% SET PUBLIC = 2 %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% BLOCK delete_shelf %]
@@ -401,9 +399,7 @@ [% IF ( OPACLocalCoverImages ) %] [% END %] - [% IF ( AdlibrisEnabled && itemsloo.normalized_isbn ) %] - Adlibris cover image - [% END %] + [% IF ( OPACAmazonCoverImages ) %] [% IF ( itemsloo.normalized_isbn ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt index 6fc5a12973..e615310834 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt @@ -6,16 +6,11 @@ [% timestamp | html %] - [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] - [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% FOREACH review IN reviews %] New comment on [% INCLUDE 'biblio-title-head.inc' biblio=review %] [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber | html %]#comments -[% END %] [% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt index 4ce6b3093a..f1059b6e81 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt @@ -38,8 +38,6 @@

Recent comments

- [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] - [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% FOREACH review IN reviews %] - [% IF ( JacketImages || AdlibrisEnabled ) %][% END %] + [% IF ( JacketImages ) %][% END %] @@ -282,10 +280,7 @@ [% FOREACH ISSUE IN ISSUES %] [% IF ( ISSUE.overdue ) %][% ELSE %][% END %] - [% IF ( JacketImages || AdlibrisEnabled ) %] - [% IF ( JacketImages || AdlibrisEnabled ) %][% END %] + [% IF ( JacketImages ) %][% END %] [% UNLESS ( item_level_itypes ) %] [% END %] [% IF ( show_barcode ) %][% END %] @@ -659,11 +654,8 @@ [% FOREACH OVERDUE IN OVERDUES %] - [% IF ( JacketImages || AdlibrisEnabled ) %] + [% IF ( JacketImages ) %]
Comments
@@ -127,9 +125,6 @@ [% END %] [% END %] - [% IF ( AdlibrisEnabled && review.normalized_isbn ) %] - Adlibris cover image - [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( review.normalized_isbn ) %] 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 545a64d50d..3aa40ab079 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -6,8 +6,6 @@ [% USE ItemTypes %] [% USE Price %] [% USE AuthorisedValues %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments(1) %] [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1,1) %] @@ -253,7 +251,7 @@
[% issues_count | html %] Item(s) checked out
  Title Author Due
- [% IF ( AdlibrisEnabled && ISSUE.normalized_isbn ) %] - Adlibris cover image - [% END %] + [% IF ( JacketImages ) %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( ISSUE.normalized_isbn ) %] View on Amazon.com @@ -642,7 +637,7 @@
  TitleItem typeBarcode
- [% IF ( AdlibrisEnabled && OVERDUE.normalized_isbn ) %] - Adlibris cover image - [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( OVERDUE.normalized_isbn ) %] View on Amazon.com -- 2.39.5