Bugzilla – Attachment 168158 Details for
Bug 36154
Add the ability for some pages to be able to use images coming from plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36154: Display images coming from plugin
Bug-36154-Display-images-coming-from-plugin.patch (text/plain), 11.83 KB, created by
Hammat wele
on 2024-06-26 15:07:05 UTC
(
hide
)
Description:
Bug 36154: Display images coming from plugin
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2024-06-26 15:07:05 UTC
Size:
11.83 KB
patch
obsolete
>From 31fcd9aa68aeee84e20225012d78458f9163f8c6 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 26 Jun 2024 15:03:30 +0000 >Subject: [PATCH] Bug 36154: Display images coming from plugin > >this patch makes the summary page(opac-user), the list pages (opac-shelves.pl, shelves.pl), the Checkout history page (opac-readingrecord.pl) and shelfbrowser to be able to display images coming from plugin. >--- > .../bootstrap/en/includes/shelfbrowser.inc | 6 ++++-- > .../bootstrap/en/modules/opac-readingrecord.tt | 5 ++++- > .../bootstrap/en/modules/opac-shelves.tt | 5 ++++- > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 15 +++++++++------ > 4 files changed, 21 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >index 78c6139142..63964192d5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >@@ -28,10 +28,12 @@ > [% img_title = item.biblionumber %] > [% END %] > >- [% IF ( OPACLocalCoverImages || OPACAmazonCoverImages || ( SyndeticsEnabled && SyndeticsCoverImages ) || GoogleJackets || BakerTaylorEnabled || ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) || ( Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') ) ) %] >+ [% IF ( OPACLocalCoverImages || OPACAmazonCoverImages || ( SyndeticsEnabled && SyndeticsCoverImages ) || GoogleJackets || BakerTaylorEnabled || ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) || ( Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') ) || CoverImagePlugins ) %] > <a class="shelfbrowser_cover" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% item.biblionumber | uri %]&shelfbrowse_itemnumber=[% item.itemnumber | uri %]#shelfbrowser"> > [% IF ( OPACLocalCoverImages ) %] >- <div title="[% img_title | html %]" class="[% item.biblionumber | html %] thumbnail-shelfbrowser" id="local-thumbnail-shelf-[% item.biblionumber | html %]"></div> >+ <div title="[% img_title | html %]" class="[% item.biblionumber | html %] thumbnail-shelfbrowser" id="local-thumbnail-shelf-[% item.biblionumber | html %]"> >+ <img src="/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=[% item.biblionumber | uri %]" alt="Local cover image" /> >+ </div> > [% END %] > [% IF ( OPACAmazonCoverImages ) %] > [% IF ( item.browser_normalized_isbn ) %] >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 63d678209f..9ae87e57e0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >@@ -5,8 +5,10 @@ > [% USE AdditionalContents %] > [% USE Asset %] > [% USE Price %] >+[% USE KohaPlugins %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Your checkout history › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -139,7 +141,7 @@ > [% END %] > [% issuetype | html %] > </td> >- <td> >+ <td data-biblionumber="[% biblio.biblionumber | html %]"> > [% SET normalized_isbn = biblio.normalized_isbn %] > [% IF OPACAmazonCoverImages %] > [% IF normalized_isbn %] >@@ -227,6 +229,7 @@ > [% BLOCK jsinclude %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] >+[% CoverImagePlugins | $raw %] > <script> > $(document).ready(function(){ > [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] >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 0686b5d506..d0586e5887 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -3,10 +3,12 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE AdditionalContents %] >+[% USE KohaPlugins %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %] > [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %] > > [% BLOCK delete_shelf %] > <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="deleteshelf[% shelf.shelfnumber | html %]" class="d-inline"> >@@ -423,7 +425,7 @@ > [% img_title = itemsloo.biblionumber %] > [% END %] > >- [% IF ( OPACLocalCoverImages ) %] >+ [% IF ( OPACLocalCoverImages && itemsloo.biblio_object.cover_images.count > 0 ) %] > <span title="[% img_title | html %]" class="[% itemsloo.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span> > [% END %] > >@@ -836,6 +838,7 @@ > [% IF OpenLibraryCovers || OpenLibrarySearch %] > [% Asset.js("js/openlibrary.js") | $raw %] > [% END %] >+[% CoverImagePlugins | $raw %] > <script> > > [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) ) %] >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 ae3d38e045..ffd1978e96 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -7,9 +7,11 @@ > [% USE Price %] > [% USE AuthorisedValues %] > [% USE AdditionalContents %] >+[% USE KohaPlugins %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %] > > [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %] > [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC --> >@@ -331,7 +333,7 @@ > <caption>[% issues_count | html %] Item(s) checked out</caption> > <thead> > <tr> >- [% IF ( JacketImages ) %]<th class="nosort"> </th>[% END %] >+ [% IF ( JacketImages || CoverImagePlugins ) %]<th class="nosort"> </th>[% END %] > <th class="all anti-the">Title</th> > <th>Author</th> > <th class="psort">Due</th> >@@ -361,8 +363,8 @@ > <tbody> > [% FOREACH ISSUE IN ISSUES %] > [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %] >- [% IF ( JacketImages ) %] >- <td class="jacketcell"> >+ [% IF ( JacketImages || CoverImagePlugins ) %] >+ <td class="jacketcell" data-biblionumber="[% ISSUE.biblionumber | html %]"> > [% IF ( OPACAmazonCoverImages ) %] > [% IF ( ISSUE.normalized_isbn ) %] > <a href="http://www.amazon.com/gp/reader/[% ISSUE.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% ISSUE.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail"/></a> >@@ -721,7 +723,7 @@ > <!-- OVERDUES TABLE ROWS --> > <thead> > <tr> >- [% IF ( JacketImages ) %]<th class="nosort"> </th>[% END %] >+ [% IF ( JacketImages || CoverImagePlugins ) %]<th class="nosort"> </th>[% END %] > <th class="all anti-the">Title</th> > [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %] > [% IF ( show_barcode ) %]<th>Barcode</th>[% END %] >@@ -739,8 +741,8 @@ > <tbody> > [% FOREACH OVERDUE IN OVERDUES %] > <tr> >- [% IF ( JacketImages ) %] >- <td class="jacketcell"> >+ [% IF ( JacketImages || CoverImagePlugins ) %] >+ <td class="jacketcell" data-biblionumber="[% OVERDUE.biblionumber | html %]"> > [% IF ( OPACAmazonCoverImages ) %] > [% IF ( OVERDUE.normalized_isbn ) %] > <a href="http://www.amazon.com/gp/reader/[% OVERDUE.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% OVERDUE.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail" /></a> >@@ -1087,6 +1089,7 @@ > [% BLOCK jsinclude %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% CoverImagePlugins | $raw %] > <script> > var AR_CAPTION_COUNT = _("(%s total)"); > >-- >2.34.1
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 36154
:
163744
|
168157
|
168158
|
168925
|
170295
|
170296
|
170297
|
173593
|
173594
|
173595
|
175490
|
175491
|
175492
|
179892
|
179893
|
179894
|
181290
|
181291
|
181292