X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-tags.pl;h=267c3c024993cab98d5ac6e39d42af671a35edd1;hb=0bd485947f7554657e61f050cd5204ebb40d04c0;hp=e7f892c3ec8b90d6db0a303e9c2fa34948192421;hpb=298733cb1e528f117984077442c867c3d2035ee0;p=koha.git diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index e7f892c3ec..267c3c0249 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -30,8 +30,8 @@ C4::Scrubber is used to remove all markup content from the sumitted text. =cut -use strict; -use warnings; +use Modern::Perl; + use CGI qw ( -utf8 ); use CGI::Cookie; # need to check cookies before having CGI parse the POST request @@ -46,6 +46,8 @@ use C4::XSLT; use Data::Dumper; +use Koha::Biblios; + my %newtags = (); my @deltags = (); my %counts = (); @@ -229,14 +231,23 @@ if ($loggedinuser) { $my_tags = get_tag_rows({borrowernumber=>$loggedinuser}); my $my_approved_tags = get_approval_rows({ approved => 1 }); foreach my $tag (@$my_tags) { - my $biblio = GetBiblioData($tag->{biblionumber}); - my $record = &GetMarcBiblio( $tag->{biblionumber} ); + my $biblio = Koha::Biblios->find( $tag->{biblionumber} ); + my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} }); $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) ); - $tag->{title} = $biblio->{title}; - $tag->{author} = $biblio->{author}; - if (C4::Context->preference("OPACXSLTResultsDisplay")) { - $tag->{XSLTBloc} = XSLTParse4Display($tag->{biblionumber}, $record, "OPACXSLTResultsDisplay"); + $tag->{title} = $biblio->title; + $tag->{author} = $biblio->author; + + my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); + my $lang = $xslfile ? C4::Languages::getlanguage() : undef; + my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + + if ( $xslfile ) { + $tag->{XSLTBloc} = XSLTParse4Display( + $tag->{ biblionumber }, $record, "OPACXSLTResultsDisplay", + 1, undef, $sysxml, $xslfile, $lang + ); } + my $date = $tag->{date_created} || ''; $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; $tag->{time_created_display} = $1;