Bugzilla – Attachment 133359 Details for
Bug 30554
Use XSLT in authority search cataloguing plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30554: Wrong display of authorities records in the Authority search plugin
MT-36361-Wrong-display-of-authorities-records-in-t.patch (text/plain), 3.26 KB, created by
Jérémy Breuillard
on 2022-04-15 15:34:03 UTC
(
hide
)
Description:
Bug 30554: Wrong display of authorities records in the Authority search plugin
Filename:
MIME Type:
Creator:
Jérémy Breuillard
Created:
2022-04-15 15:34:03 UTC
Size:
3.26 KB
patch
obsolete
>From 657c54d8c38ce1b52d8ae95320d1f537db6d9d98 Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Fri, 15 Apr 2022 16:51:14 +0200 >Subject: [PATCH] MT 36361: Wrong display of authorities records in the > Authority search plugin > >With this patch the display of the authorities records is available at XSLT format > >Test plan: >1)Make sure to have at least one Authority Type defined >2)Home > Cataloging > New record > tab.7 Field 700$a >3)Click on the Tag editor button >4)Click on Search button and notice the displaying of the results >5)Apply patch and repeat 3) and 4) >6)The results are now displayed at XSLT format > >https://bugs.koha-community.org/show_bug.cgi?id=30554 >--- > authorities/auth_finder.pl | 23 +++++++++++++++++++ > .../authorities/searchresultlist-auth.tt | 8 ++++++- > 2 files changed, 30 insertions(+), 1 deletion(-) > >diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl >index ed6774f599..9630026651 100755 >--- a/authorities/auth_finder.pl >+++ b/authorities/auth_finder.pl >@@ -135,6 +135,29 @@ if ( $op eq "do_search" ) { > $to = ( ( $startfrom + 1 ) * $resultsperpage ); > } > >+ my $AuthorityXSLTResultsDisplay = C4::Context->preference('AuthorityXSLTResultsDisplay'); >+ if ($results && $AuthorityXSLTResultsDisplay) { >+ my $lang = C4::Languages::getlanguage(); >+ foreach my $result (@$results) { >+ my $authority = Koha::Authorities->find($result->{authid}); >+ next unless $authority; >+ >+ my $authtypecode = $authority->authtypecode; >+ my $xsl = $AuthorityXSLTResultsDisplay; >+ $xsl =~ s/\{langcode\}/$lang/g; >+ $xsl =~ s/\{authtypecode\}/$authtypecode/g; >+ >+ my $xslt_engine = Koha::XSLT::Base->new; >+ my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl }); >+ if ($xslt_engine->err) { >+ warn "XSL transformation failed ($xsl): " . $xslt_engine->err; >+ next; >+ } >+ >+ $result->{html} = $output; >+ } >+ } >+ > $template->param( result => $results ) if $results; > $template->param( > orderby => $orderby, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >index 94db09dfec..1f92e4f201 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >@@ -50,7 +50,13 @@ > </tr> > [% FOREACH resul IN result %] > <tr> >- <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td> >+ <td> >+ [% IF resul.html %] >+ [% resul.html | $raw %] >+ [% ELSE %] >+ [% PROCESS authresult summary=resul.summary authid=resul.authid %] >+ [% END %] >+ </td> > <td>[% resul.summary.label | html %]</td> > <td>[% resul.used | html %] times</td> > <td> >-- >2.17.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 30554
:
133359
|
156824
|
156825
|
156826
|
157293
|
157294
|
157295
|
161517
|
161518
|
161545