Lines 53-58
use C4::HTML5Media;
Link Here
|
53 |
use C4::CourseReserves qw(GetItemCourseReservesInfo); |
53 |
use C4::CourseReserves qw(GetItemCourseReservesInfo); |
54 |
|
54 |
|
55 |
use Koha::Virtualshelves; |
55 |
use Koha::Virtualshelves; |
|
|
56 |
use Koha::Reviews; |
56 |
|
57 |
|
57 |
BEGIN { |
58 |
BEGIN { |
58 |
if (C4::Context->preference('BakerTaylorEnabled')) { |
59 |
if (C4::Context->preference('BakerTaylorEnabled')) { |
Lines 793-834
$template->param(
Link Here
|
793 |
ocoins => GetCOinSBiblio($record), |
794 |
ocoins => GetCOinSBiblio($record), |
794 |
); |
795 |
); |
795 |
|
796 |
|
796 |
my $libravatar_enabled = 0; |
797 |
my ( $loggedincommenter, $reviews ); |
797 |
if ( C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) { |
798 |
if ( C4::Context->preference('reviewson') ) { |
798 |
eval { |
799 |
$reviews = Koha::Reviews->search( |
799 |
require Libravatar::URL; |
800 |
{ |
800 |
Libravatar::URL->import(); |
801 |
biblionumber => $biblionumber, |
801 |
}; |
802 |
-or => { approved => 1, borrowernumber => $borrowernumber } |
802 |
if (!$@ ) { |
803 |
}, |
803 |
$libravatar_enabled = 1; |
804 |
{ |
|
|
805 |
order_by => { -desc => 'datereviewed' } |
806 |
} |
807 |
)->unblessed; |
808 |
my $libravatar_enabled = 0; |
809 |
if ( C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto') ) { |
810 |
eval { |
811 |
require Libravatar::URL; |
812 |
Libravatar::URL->import(); |
813 |
}; |
814 |
if ( !$@ ) { |
815 |
$libravatar_enabled = 1; |
816 |
} |
804 |
} |
817 |
} |
805 |
} |
818 |
for my $review (@$reviews) { |
806 |
|
819 |
my $borrowerData = GetMember( 'borrowernumber' => $review->{borrowernumber} ); |
807 |
my $reviews = getreviews( $biblionumber, 1 ); |
820 |
|
808 |
my $loggedincommenter; |
821 |
# setting some borrower info into this hash |
809 |
|
822 |
$review->{title} = $borrowerData->{'title'}; |
810 |
|
823 |
$review->{surname} = $borrowerData->{'surname'}; |
811 |
|
824 |
$review->{firstname} = $borrowerData->{'firstname'}; |
|
|
825 |
if ( $libravatar_enabled and $borrowerData->{'email'} ) { |
826 |
$review->{avatarurl} = libravatar_url( email => $borrowerData->{'email'}, https => $ENV{HTTPS} ); |
827 |
} |
828 |
$review->{userid} = $borrowerData->{'userid'}; |
829 |
$review->{cardnumber} = $borrowerData->{'cardnumber'}; |
812 |
|
830 |
|
813 |
foreach ( @$reviews ) { |
831 |
if ( $borrowerData->{'borrowernumber'} eq $borrowernumber ) { |
814 |
my $borrowerData = GetMember('borrowernumber' => $_->{borrowernumber}); |
832 |
$review->{your_comment} = 1; |
815 |
# setting some borrower info into this hash |
833 |
$loggedincommenter = 1; |
816 |
$_->{title} = $borrowerData->{'title'}; |
834 |
} |
817 |
$_->{surname} = $borrowerData->{'surname'}; |
|
|
818 |
$_->{firstname} = $borrowerData->{'firstname'}; |
819 |
if ($libravatar_enabled and $borrowerData->{'email'}) { |
820 |
$_->{avatarurl} = libravatar_url(email => $borrowerData->{'email'}, https => $ENV{HTTPS}); |
821 |
} |
835 |
} |
822 |
$_->{userid} = $borrowerData->{'userid'}; |
|
|
823 |
$_->{cardnumber} = $borrowerData->{'cardnumber'}; |
824 |
|
825 |
if ($borrowerData->{'borrowernumber'} eq $borrowernumber) { |
826 |
$_->{your_comment} = 1; |
827 |
$loggedincommenter = 1; |
828 |
} |
829 |
} |
836 |
} |
830 |
|
837 |
|
831 |
|
|
|
832 |
if(C4::Context->preference("ISBD")) { |
838 |
if(C4::Context->preference("ISBD")) { |
833 |
$template->param(ISBD => 1); |
839 |
$template->param(ISBD => 1); |
834 |
} |
840 |
} |
835 |
- |
|
|