View | Details | Raw Unified | Return to bug 30554
Collapse All | Expand All

(-)a/authorities/auth_finder.pl (+26 lines)
Lines 23-32 use CGI qw ( -utf8 ); Link Here
23
use C4::Output qw( output_html_with_http_headers );
23
use C4::Output qw( output_html_with_http_headers );
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::Context;
25
use C4::Context;
26
use C4::Languages;
26
use Koha::SearchEngine::Search;
27
use Koha::SearchEngine::Search;
27
use Koha::SearchEngine::QueryBuilder;
28
use Koha::SearchEngine::QueryBuilder;
28
29
29
use Koha::Authority::Types;
30
use Koha::Authority::Types;
31
use Koha::Authorities;
32
use Koha::XSLT::Base;
30
33
31
my $query        = CGI->new;
34
my $query        = CGI->new;
32
my $op           = $query->param('op') || '';
35
my $op           = $query->param('op') || '';
Lines 132-137 if ( $op eq "do_search" ) { Link Here
132
        $to = ( ( $startfrom + 1 ) * $resultsperpage );
135
        $to = ( ( $startfrom + 1 ) * $resultsperpage );
133
    }
136
    }
134
137
138
    my $AuthorityXSLTResultsDisplay = C4::Context->preference('AuthorityXSLTResultsDisplay');
139
    if ($results && $AuthorityXSLTResultsDisplay) {
140
        my $lang = C4::Languages::getlanguage();
141
        foreach my $result (@$results) {
142
            my $authority = Koha::Authorities->find($result->{authid});
143
            next unless $authority;
144
145
            my $authtypecode = $authority->authtypecode;
146
            my $xsl = $AuthorityXSLTResultsDisplay;
147
            $xsl =~ s/\{langcode\}/$lang/g;
148
            $xsl =~ s/\{authtypecode\}/$authtypecode/g;
149
150
            my $xslt_engine = Koha::XSLT::Base->new;
151
            my $output = $xslt_engine->transform({ xml => $authority->marcxml, file => $xsl });
152
            if ($xslt_engine->err) {
153
                warn "XSL transformation failed ($xsl): " . $xslt_engine->err;
154
                next;
155
            }
156
157
            $result->{html} = $output;
158
        }
159
    }
160
135
    $template->param( result => $results ) if $results;
161
    $template->param( result => $results ) if $results;
136
    $template->param(
162
    $template->param(
137
        orderby          => $orderby,
163
        orderby          => $orderby,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-2 / +7 lines)
Lines 76-82 Link Here
76
                </tr>
76
                </tr>
77
                [% FOREACH resul IN result %]
77
                [% FOREACH resul IN result %]
78
                    <tr>
78
                    <tr>
79
                        <td>[% PROCESS authresult summary=resul.summary authid=resul.authid auth_preview=1 %]</td>
79
                        <td>
80
                            [% IF resul.html %]
81
                                [% resul.html | $raw %]
82
                            [% ELSE %]
83
                                [% PROCESS authresult summary=resul.summary authid=resul.authid auth_preview=1 %]
84
                            [% END %]
85
                        </td>
80
                        <td>[% resul.summary.label | html %]</td>
86
                        <td>[% resul.summary.label | html %]</td>
81
                        <td>[% resul.used | html %] times</td>
87
                        <td>[% resul.used | html %] times</td>
82
                        [% IF Koha.Preference('ShowHeadingUse') %]
88
                        [% IF Koha.Preference('ShowHeadingUse') %]
83
- 

Return to bug 30554