|
Lines 135-140
if ( $op eq "do_search" ) {
Link Here
|
| 135 |
$to = ( ( $startfrom + 1 ) * $resultsperpage ); |
135 |
$to = ( ( $startfrom + 1 ) * $resultsperpage ); |
| 136 |
} |
136 |
} |
| 137 |
|
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 |
|
| 138 |
$template->param( result => $results ) if $results; |
161 |
$template->param( result => $results ) if $results; |
| 139 |
$template->param( |
162 |
$template->param( |
| 140 |
orderby => $orderby, |
163 |
orderby => $orderby, |