# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-use warnings;
+use Modern::Perl;
use CGI qw ( -utf8 );
use Koha::Patrons;
use Koha::ItemTypes;
+use Koha::Ratings;
my $query = new CGI;
my $marc_rec =
MARC::Record::new_from_xml( $marcxml, 'utf8',
C4::Context->preference('marcflavour') );
- $issue->{subtitle} =
- GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} );
+ $issue->{subtitle} = GetRecordValue( 'subtitle', $marc_rec );
$issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
}
# My Summary HTML
: $my_summary_html =~ s/{BIBLIONUMBER}//g;
$issue->{MySummaryHTML} = $my_summary_html;
}
+ # Star ratings
+ if ( C4::Context->preference('OpacStarRatings') eq 'all' ) {
+ my $ratings = Koha::Ratings->search({ biblionumber => $issue->{biblionumber} });
+ $issue->{ratings} = $ratings;
+ $issue->{my_rating} = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef;
+ }
}
if (C4::Context->preference('BakerTaylorEnabled')) {
}
}
-for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above
+for(qw(AmazonCoverImages GoogleJackets)) { # BakerTaylorEnabled handled above
C4::Context->preference($_) or next;
$template->param($_=>1);
$template->param(JacketImages=>1);