View | Details | Raw Unified | Return to bug 19808
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-9 / +11 lines)
Lines 905-911 Link Here
905
                            <div id="newcomment"></div>
905
                            <div id="newcomment"></div>
906
                                [% IF ( reviews ) %]
906
                                [% IF ( reviews ) %]
907
                                    [% FOREACH review IN reviews %]
907
                                    [% FOREACH review IN reviews %]
908
                                        [% IF review.borrowernumber == borrowernumber %]
908
                                        [% IF borrowernumber && review.borrowernumber == borrowernumber %]
909
                                            <div class="commentline yours" id="c[% review.reviewid %]">
909
                                            <div class="commentline yours" id="c[% review.reviewid %]">
910
                                                [% IF ( review.avatarurl ) %]
910
                                                [% IF ( review.avatarurl ) %]
911
                                                    <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
911
                                                    <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
Lines 925-950 Link Here
925
                                            </div>
925
                                            </div>
926
                                        [% ELSE %]
926
                                        [% ELSE %]
927
                                            <div class="commentline">
927
                                            <div class="commentline">
928
                                                [% IF ( ShowReviewer != "none" ) %]
928
                                                [% IF ( ShowReviewer != "none" && review.patron) %]
929
929
                                                    [% IF ( review.avatarurl ) %]
930
                                                    [% IF ( review.avatarurl ) %]
930
                                                        <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
931
                                                        <img class="avatar" src="[% review.avatarurl %]" height="80" width="80" alt="" />
931
                                                    [% END %]
932
                                                    [% END %]
932
                                                    [% SWITCH ShowReviewer %]
933
                                                    [% SWITCH ShowReviewer %]
933
                                                    [% CASE 'full' %]
934
                                                    [% CASE 'full' %]
934
                                                        <h5>Comment by [% review.title %] [% review.firstname %] [% review.surname %]</h5>
935
                                                        <h5>Comment by [% review.patron.title %] [% review.patron.firstname %] [% review.patron.surname %]</h5>
935
                                                    [% CASE 'first' %]
936
                                                    [% CASE 'first' %]
936
                                                        <h5>Comment by [% review.firstname %]</h5>
937
                                                        <h5>Comment by [% review.patron.firstname %]</h5>
937
                                                    [% CASE 'surname' %]
938
                                                    [% CASE 'surname' %]
938
                                                        <h5>Comment by [% review.surname %]</h5>
939
                                                        <h5>Comment by [% review.patron.surname %]</h5>
939
                                                    [% CASE 'firstandinitial' %]
940
                                                    [% CASE 'firstandinitial' %]
940
                                                        <h5>Comment by [% review.firstname %] [% review.surname|truncate(2,'.') %]</h5>
941
                                                        <h5>Comment by [% review.patron.firstname %] [% review.patron.surname|truncate(2,'.') %]</h5>
941
                                                    [% CASE 'username' %]
942
                                                    [% CASE 'username' %]
942
                                                        <h5>Comment by [% review.userid %]</h5>
943
                                                        <h5>Comment by [% review.patron.userid %]</h5>
943
                                                    [% END %]
944
                                                    [% END %]
945
944
                                                    <small>[% review.datereviewed | $KohaDates %]</small>
946
                                                    <small>[% review.datereviewed | $KohaDates %]</small>
945
                                                [% ELSIF ( ShowReviewer == "none") %]
947
                                                [% ELSE %]
946
                                                    <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
948
                                                    <h5>Patron comment on [% review.datereviewed | $KohaDates %]</h5>
947
                                                [% END # / IF ShowReviewer != "none"%]
949
                                                [% END # / IF ShowReviewer != "none" && review.patron %]
948
                                                <p>
950
                                                <p>
949
                                                  [% FILTER html_break %]
951
                                                  [% FILTER html_break %]
950
                                                  [% review.review |html %]
952
                                                  [% review.review |html %]
(-)a/opac/opac-detail.pl (-10 / +5 lines)
Lines 844-860 if ( C4::Context->preference('reviewson') ) { Link Here
844
        my $patron = Koha::Patrons->find( $review->{borrowernumber} );
844
        my $patron = Koha::Patrons->find( $review->{borrowernumber} );
845
845
846
        # setting some borrower info into this hash
846
        # setting some borrower info into this hash
847
        $review->{title}     = $patron->title;
847
        $review->{patron} = $patron;
848
        $review->{surname}   = $patron->surname;
848
        if ( $libravatar_enabled and $patron and $patron->email ) {
849
        $review->{firstname} = $patron->firstname;
850
        if ( $libravatar_enabled and $patron->email ) {
851
            $review->{avatarurl} = libravatar_url( email => $patron->email, https => $ENV{HTTPS} );
849
            $review->{avatarurl} = libravatar_url( email => $patron->email, https => $ENV{HTTPS} );
852
        }
850
        }
853
        $review->{userid}     = $patron->userid;
854
        $review->{cardnumber} = $patron->cardnumber;
855
851
856
        if ( $patron->borrowernumber eq $borrowernumber ) {
852
        if ( $patron and $patron->borrowernumber eq $borrowernumber ) {
857
            $review->{your_comment} = 1;
858
            $loggedincommenter = 1;
853
            $loggedincommenter = 1;
859
        }
854
        }
860
    }
855
    }
Lines 1102-1114 if (C4::Context->preference("OPACURLOpenInNewWindow")) { Link Here
1102
    $template->param(covernewwindow => 'false');
1097
    $template->param(covernewwindow => 'false');
1103
}
1098
}
1104
1099
1100
$template->param(borrowernumber => $borrowernumber);
1101
1105
if ( C4::Context->preference('OpacStarRatings') !~ /disable/ ) {
1102
if ( C4::Context->preference('OpacStarRatings') !~ /disable/ ) {
1106
    my $ratings = Koha::Ratings->search({ biblionumber => $biblionumber });
1103
    my $ratings = Koha::Ratings->search({ biblionumber => $biblionumber });
1107
    my $my_rating = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef;
1104
    my $my_rating = $borrowernumber ? $ratings->search({ borrowernumber => $borrowernumber })->next : undef;
1108
    $template->param(
1105
    $template->param(
1109
        ratings => $ratings,
1106
        ratings => $ratings,
1110
        my_rating => $my_rating,
1107
        my_rating => $my_rating,
1111
        borrowernumber => $borrowernumber
1112
    );
1108
    );
1113
}
1109
}
1114
1110
1115
- 

Return to bug 19808