Bugzilla – Attachment 184018 Details for
Bug 32432
Show Syndetics Unbound on the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32432: Add SyndeticsAuthorNotes to staff interface
Bug-32432-Add-SyndeticsAuthorNotes-to-staff-interf.patch (text/plain), 5.82 KB, created by
Lucas Gass (lukeg)
on 2025-07-11 18:25:26 UTC
(
hide
)
Description:
Bug 32432: Add SyndeticsAuthorNotes to staff interface
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-07-11 18:25:26 UTC
Size:
5.82 KB
patch
obsolete
>From 35b804b18de7614c7d79eef0383f56583e5751a7 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 11 Jul 2025 18:21:12 +0000 >Subject: [PATCH] Bug 32432: Add SyndeticsAuthorNotes to staff interface > >--- > catalogue/detail.pl | 33 +++++++++++++++++++ > .../admin/preferences/enhanced_content.pref | 8 ++--- > .../prog/en/modules/catalogue/detail.tt | 20 +++++++++++ > opac/opac-detail.pl | 2 +- > 4 files changed, 58 insertions(+), 5 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index c6445d4a201..48bd77ec9da 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -60,6 +60,14 @@ use Koha::Reviews; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Serial::Items; >+use C4::External::Syndetics qw( >+ get_syndetics_anotes >+ get_syndetics_excerpt >+ get_syndetics_index >+ get_syndetics_reviews >+ get_syndetics_summary >+ get_syndetics_toc >+); > > my $query = CGI->new(); > >@@ -427,6 +435,31 @@ if ( C4::Context->preference('OPACComments') ) { > > } > >+my $syndetics_elements; >+ >+if ( C4::Context->preference("SyndeticsEnabled") ) { >+ $template->param( "SyndeticsEnabled" => 1 ); >+ $template->param( "SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode") ); >+ eval { >+ $syndetics_elements = &get_syndetics_index( $isbn, $upc, $oclc ); >+ for my $element ( values %$syndetics_elements ) { >+ $template->param( "Syndetics$element" . "Exists" => 1 ); >+ } >+ }; >+ warn $@ if $@; >+} >+ >+if ( C4::Context->preference("SyndeticsEnabled") >+ && C4::Context->preference("SyndeticsAuthorNotes") >+ && exists( $syndetics_elements->{'ANOTES'} ) ) >+{ >+ eval { >+ my $syndetics_anotes = &get_syndetics_anotes( $isbn, $upc, $oclc ); >+ $template->param( SYNDETICS_ANOTES => $syndetics_anotes ); >+ }; >+ warn $@ if $@; >+} >+ > my @results = ( $dat, ); > foreach ( keys %{$dat} ) { > $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' ); >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 1f088136f49..e165d917c0f 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 >@@ -195,11 +195,11 @@ Enhanced content: > LC: large > - size. > - >+ - Show notes about the author of a title from Syndetics on item detail pages on the > - pref: SyndeticsAuthorNotes >- choices: >- 1: Show >- 0: "Don't show" >- - notes about the author of a title from Syndetics on item detail pages on the OPAC. >+ multiple: >+ opac: OPAC >+ staff: Staff interface > - > - pref: SyndeticsAwards > choices: >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 0fc818512a5..c4655549980 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -90,6 +90,7 @@ > [% CoceProviders = Koha.Preference('CoceProviders') %] > [% CoceHost = Koha.Preference('CoceHost') %] > [% SyndeticsCovers = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsCoverImages') %] >+ [% SyndeticsAuthorNotes = Koha.Preference('SyndeticsEnabled') && Koha.Preference('SyndeticsAuthorNotes').split(',').grep('staff').size %] > > [% INCLUDE 'cat-toolbar.inc' %] > [% IF ( ocoins ) %] >@@ -410,6 +411,12 @@ > [% END %] > [% END %] > >+ [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %] >+ [% WRAPPER tab_item tabname= "anotes" %] >+ <span>About the author</span> >+ [% END %] >+ [% END %] >+ > [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %] > [% WRAPPER tab_item tabname= "${ plugins_intranet_catalog_biblio_tab.id }" %] > <span>[% plugins_intranet_catalog_biblio_tab.title | html %]</span> >@@ -961,6 +968,19 @@ > [% END # /tab_panel %] > [% END %] > >+ [% IF ( SyndeticsAuthorNotes && SYNDETICS_ANOTES ) %] >+ [% WRAPPER tab_panel tabname="anotes" %] >+ <div class="content_set"> >+ <h2>Author notes provided by Syndetics</h2> >+ [% FOREACH SYNDETICS_ANOTE IN SYNDETICS_ANOTES %] >+ [% IF ( SYNDETICS_ANOTE.content ) %] >+ [% SYNDETICS_ANOTE.content | $raw %] >+ [% END %] >+ [% END %] >+ </div> >+ [% END # /tab_panel#anotes %] >+ [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] >+ > [% FOREACH plugins_intranet_catalog_biblio_tab IN plugins_intranet_catalog_biblio_tabs %] > [% WRAPPER tab_panel tabname="${ plugins_intranet_catalog_biblio_tab.id }" %] > [% plugins_intranet_catalog_biblio_tab.content | $raw %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 9cd2364f849..8e3e4523cd1 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1095,7 +1095,7 @@ if ( C4::Context->preference("SyndeticsEnabled") > } > > if ( C4::Context->preference("SyndeticsEnabled") >- && C4::Context->preference("SyndeticsAuthorNotes") >+ && C4::Context->preference("SyndeticsAuthorNotes") =~ /opac/ > && exists( $syndetics_elements->{'ANOTES'} ) ) > { > eval { >-- >2.39.5
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 32432
:
184018
|
184019
|
184020
|
184022
|
184023
|
184024
|
184177
|
184178