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, |