Bugzilla – Attachment 163744 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: Add the ability for some pages to be able to use images comming from plugin
Bug-36154-Add-the-ability-for-some-pages-to-be-abl.patch (text/plain), 17.35 KB, created by
Hammat wele
on 2024-03-22 21:50:16 UTC
(
hide
)
Description:
Bug 36154: Add the ability for some pages to be able to use images comming from plugin
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2024-03-22 21:50:16 UTC
Size:
17.35 KB
patch
obsolete
>From 10ff53662d38a01aa0fb35f04135b93330df5995 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Fri, 22 Mar 2024 21:47:18 +0000 >Subject: [PATCH] Bug 36154: Add the ability for some pages to be able to use > images comming from plugin >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The patch adds images in the list page in staff interface and make the summary page(opac-user), the list pages (opac-shelves.pl, shelves.pl) and the Checkout history page (opac-readingrecord.pl) to be able to display images comming from plugin. > >To test > >1. Log in to the staff interface >2. Make sure the system preference LocalCoverImages has «Show» value >3. Create a nwalist > 4.1. Click on «More» menu then click on «List» and click on «New List» >4. Search for a record and add a local image to it >5. Add the record to the list created on step 4.1 >6. Check the list > ----> The image is not displayed >7. Apply the patch >8. Check the list again > ----> the image is now display in a new column named «Cover» >--- > .../prog/en/modules/virtualshelves/shelves.tt | 22 +++++++++++++++++++ > .../bootstrap/en/includes/shelfbrowser.inc | 18 +++++++-------- > .../en/modules/opac-readingrecord.tt | 5 ++++- > .../bootstrap/en/modules/opac-shelves.tt | 3 +++ > .../bootstrap/en/modules/opac-user.tt | 15 ++++++++----- > virtualshelves/shelves.pl | 1 + > 6 files changed, 47 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index e82cf2f618..67e44fdca0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -5,8 +5,10 @@ > [% USE KohaDates %] > [% USE AuthorisedValues %] > [% USE Branches %] >+[% USE KohaPlugins %] > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] >+[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > [% INCLUDE 'doc-head-open.inc' %] > <title>[% FILTER collapse %] > [% IF op == 'view' %] >@@ -287,6 +289,9 @@ > [% UNLESS ( item_level_itypes ) %] > <th>Item type</th> > [% END %] >+ [% IF ( CoverImagePlugins || LocalCoverImages || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL'))) %] >+ <th>Cover</th> >+ [% END %] > [% IF sortfield == 'title' %] > <th class="sorting_[% direction | html %]"> > [% ELSE %] >@@ -332,6 +337,22 @@ > <span class="itypetext">[% itemsloo.description | html %]</span> > </td> > [% END %] >+ [% IF LocalCoverImages %] >+ <td> >+ <span title="[% img_title | html %]" class="[% itemsloo.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span> >+ <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=[% itemsloo.biblionumber | uri %]" alt="Local cover image" /> >+ </td> >+ [% ELSIF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') && (custom_cover_image_url = itemsloo.biblio_object.custom_cover_image_url) %] >+ <td> >+ [% IF custom_cover_image_url %] >+ <a class="custom_cover_image" href="[% PROCESS biblio_a_href biblionumber => itemsloo.biblionumber %]"> >+ <img alt="Custom cover image" src="[% custom_cover_image_url | url %]" /></a> >+ [% END %] >+ </td> >+ [% ELSE %] >+ <td> >+ </td> >+ [% END %] > <td> > [% IF ( itemsloo.XSLTBloc ) %] > [% itemsloo.XSLTBloc | $raw %] >@@ -614,6 +635,7 @@ > [% IF op == 'view' %] > [% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %] > [% END %] >+ [% CoverImagePlugins | $raw %] > <script> > var MSG_NO_ITEM_SELECTED = _("Nothing is selected."); > var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?"); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >index 78c6139142..0c6abe0614 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >@@ -28,11 +28,17 @@ > [% 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> >- [% END %] >+ [% ELSIF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') AND (custom_cover_image_url = item.biblio_object.custom_cover_image_url) %] >+ [% IF custom_cover_image_url %] >+ <span class="custom_cover_image"> >+ <img alt="Cover image" src="[% custom_cover_image_url | url %]" /> >+ </span> >+ [% END %] >+ [% ELSE %] > [% IF ( OPACAmazonCoverImages ) %] > [% IF ( item.browser_normalized_isbn ) %] > <img src="https://images-na.ssl-images-amazon.com/images/P/[% item.browser_normalized_isbn | html %].01._AA75_PU_PU-5_.jpg" alt="" /> >@@ -70,15 +76,7 @@ > <span class="no-image">No cover image available</span> > [% END %] > [% END %] >- [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %] >- [% SET custom_cover_image_url = item.biblio_object.custom_cover_image_url %] >- [% IF custom_cover_image_url %] >- <span class="custom_cover_image"> >- <img alt="Cover image" src="[% custom_cover_image_url | url %]" /> >- </span> >- [% END %] > [% END %] >- > </a> > [% END %] > </td> >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..15eeaf09a5 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="[% issue.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 aab73c6d4c..ace0e5b716 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"> >@@ -836,6 +838,7 @@ > [% IF OpenLibraryCovers || OpenLibrarySearch %] > [% Asset.js("js/openlibrary.js") | $raw %] > [% END %] >+[% CoverImagePlugins | $raw %] > <script> > var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?"); > var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?"); >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 f521bedf47..10d0b47290 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 --> >@@ -323,7 +325,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> >@@ -353,8 +355,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> >@@ -713,7 +715,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 %] >@@ -731,8 +733,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> >@@ -1079,6 +1081,7 @@ > [% BLOCK jsinclude %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+ [% CoverImagePlugins | $raw %] > <script> > var AR_CAPTION_COUNT = _("(%s total)"); > >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index ecf08fa9c7..df00e92639 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -335,6 +335,7 @@ if ( $op eq 'view' ) { > # Getting items infos for location display > my $items = $biblio->items; > $this_item->{'ITEM_RESULTS'} = $items; >+ $this_item->{biblio_object} = $biblio; > $this_item->{biblionumber} = $biblionumber; > push @items, $this_item; > } >-- >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