Bugzilla – Attachment 149888 Details for
Bug 32680
Add hooks to allow cover images to be provided by plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32680: Add classes to template files
Bug-32680-Add-classes-to-template-files.patch (text/plain), 10.95 KB, created by
Nick Clemens (kidclamp)
on 2023-04-19 13:08:57 UTC
(
hide
)
Description:
Bug 32680: Add classes to template files
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-04-19 13:08:57 UTC
Size:
10.95 KB
patch
obsolete
>From 28d977499e7b980504729c73b40e6925e2e8aa10 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Wed, 19 Apr 2023 11:23:23 +0000 >Subject: [PATCH] Bug 32680: Add classes to template files > >This patch adds the classes to the template files so that the plugin hook can identify that cover images are required and where to inject them > >Test plan as per first commit > >Sponsored-by: PTFS Europe >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../prog/en/modules/catalogue/detail.tt | 11 ++++++---- > .../prog/en/modules/catalogue/results.tt | 10 +++++++--- > .../bootstrap/en/modules/opac-detail.tt | 8 +++++++- > .../bootstrap/en/modules/opac-results.tt | 20 ++++++++++++------- > 4 files changed, 34 insertions(+), 15 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 1fdb6fe7eb..3ace22d877 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -9,6 +9,7 @@ > [% USE Price %] > [% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > > [% IF Koha.Preference('AmazonAssocTag') %] > [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] >@@ -105,7 +106,7 @@ > <span class="Z3988" title="[% ocoins | html %]"></span> > [% END %] > >- [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >+ [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] > <div id="catalogue_detail_biblio" class="col-xs-9"> > [% ELSE %] > <div id="catalogue_detail_biblio" class="col-xs-12"> >@@ -199,10 +200,10 @@ > [% END %] > </div> [%# .page-section %] > >- [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >+ [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] > </div> > <div class="col-xs-3 bookcoverimg"> >- <div id="biblio-cover-slider" class="cover-slider"> >+ <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]"> > [% IF ( LocalCoverImages ) %] > [% IF localimages.count %] > [% FOREACH image IN localimages %] >@@ -2454,6 +2455,8 @@ Note that permanent location is a code, and location may be an authval. > }); > [% END %] > </script> >- >+ [% IF ( CoverImagePlugins ) %] >+ [% KohaPlugins.get_plugins_intranet_cover_images | $raw %] >+ [% END %] > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >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 b6e4380640..3c4c68853c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -4,8 +4,11 @@ > [% USE Koha %] > [% USE Biblio %] > [% USE KohaDates %] >+[% USE KohaPlugins %] >+[% USE To %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > [% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > >@@ -449,7 +452,7 @@ > <table> > <thead> > <tr> >- [% IF ( AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >+ [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] > <th> </th> > [% END %] > <th colspan="2">Results</th> >@@ -461,9 +464,9 @@ > <tbody> > [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] > <tr id="row[% SEARCH_RESULT.biblionumber | html %]"> >- [% IF ( AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] >+ [% IF ( CoverImagePlugins || AmazonCoverImages || LocalCoverImages || IntranetCoce || ( SyndeticsCovers ) || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] > <td class="bookcoverimg"> >- <div id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" class="cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]"> >+ <div id="cover-slides-[% SEARCH_RESULT.biblionumber | html %]" class="cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-processedbiblio="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber | $raw %]"> > [% IF ( LocalCoverImages ) %][% SEARCH_RESULT.localimage | html %] > <div id="local-coverimg-[% SEARCH_RESULT.biblionumber | html %]" class="cover-image local-coverimg"> > <a href="[% PROCESS biblio_a_href biblionumber => SEARCH_RESULT.biblionumber %]"> >@@ -914,6 +917,7 @@ > [% END %] > </script> > [% Asset.js("js/pages/results.js") | $raw %] >+ [% KohaPlugins.get_plugins_intranet_cover_images | $raw %] > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >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 ab2f28e615..1d24d44ae0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -6,8 +6,10 @@ > [% USE Branches %] > [% USE TablesSettings %] > [% USE AuthorisedValues %] >+[% USE KohaPlugins %] > [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %] > [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > [% IF Koha.Preference('AmazonAssocTag') %] > [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] > [% ELSE %] >@@ -59,7 +61,7 @@ > > <div class="bookcover"> > >- <div id="biblio-cover-slider" class="cover-slider"> >+ <div id="biblio-cover-slider" class="cover-slider" data-isbn="[% normalized_isbn | html %]"> > [% IF ( OPACLocalCoverImages ) %] > [% IF localimages.count %] > [% FOREACH image IN localimages %] >@@ -1454,6 +1456,10 @@ > [% Asset.js("js/ratings.js") | $raw %] > [% END %] > >+ [% IF ( CoverImagePlugins ) %] >+ [% KohaPlugins.get_plugins_opac_cover_images | $raw %] >+ [% END %] >+ > [% IF ( OpacHighlightedWords ) %][% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %][% END %] > [% IF ( Koha.Preference('OPACDetailQRCode') ) %] > [% Asset.js("lib/kjua/kjua.min.js") | $raw %] >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 95fa8d6304..d2754ec452 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -1,8 +1,11 @@ > [% USE raw %] > [% USE Asset %] > [% USE Koha %] >+[% USE KohaPlugins %] >+[% USE To %] > [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] > [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > > [% IF firstPage %] > [% SET OverDriveEnabled = Koha.Preference('OverDriveLibraryID') && Koha.Preference('OverDriveClientKey') && Koha.Preference('OverDriveClientSecret') %] >@@ -341,13 +344,14 @@ > > [% # Cell 4: Search result details and controls %] > <td class="bibliocol"> >- <div class="coverimages itemtype_[% SEARCH_RESULT.itemtype | html %]"> >+ [% IF ( SEARCH_RESULT.title ) %] >+ [% img_title = SEARCH_RESULT.title %] >+ [% ELSE %] >+ [% img_title = SEARCH_RESULT.biblionumber %] >+ [% END %] >+ <div class="coverimages cover-slides itemtype_[% SEARCH_RESULT.itemtype | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-imgtitle="[% img_title | html %]"> > <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]"> >- [% IF ( SEARCH_RESULT.title ) %] >- [% img_title = SEARCH_RESULT.title %] >- [% ELSE %] >- [% img_title = SEARCH_RESULT.biblionumber %] >- [% END %] >+ > [% IF ( OPACLocalCoverImages ) %] > <span title="[% img_title | html %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span> > [% END %] >@@ -587,7 +591,9 @@ > [% IF OpenLibraryCovers || OpenLibrarySearch %] > [% Asset.js("js/openlibrary.js") | $raw %] > [% END %] >- >+ [% IF ( CoverImagePlugins ) %] >+ [% KohaPlugins.get_plugins_opac_cover_images | $raw %] >+ [% END %] > <script> > [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %] > function holdMultiple() { >-- >2.30.2
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 32680
:
145457
|
145458
|
145459
|
145474
|
145475
|
145898
|
145899
|
146695
|
147992
|
147993
|
147996
|
147997
|
148129
|
148158
|
148159
|
149868
|
149869
|
149886
|
149887
|
149888
|
149889
|
151191
|
151192
|
151193