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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 46-52 OPAC: Link Here
46
            - "Show star-ratings on"
46
            - "Show star-ratings on"
47
            - pref: OpacStarRatings
47
            - pref: OpacStarRatings
48
              choices:
48
              choices:
49
                  all: "results, details, and patron"
49
                  all: "results, details, lists, and patron"
50
                  disable: "no"
50
                  disable: "no"
51
                  details: "only details"
51
                  details: "only details"
52
            - "pages."
52
            - "pages."
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+26 lines)
Lines 477-482 Link Here
477
477
478
                                                        [% itemsloo.XSLTBloc | $raw %]
478
                                                        [% itemsloo.XSLTBloc | $raw %]
479
479
480
                                                        [% IF ( OpacStarRatings == 'all' ) %]
481
                                                            <div class="results_summary ratings">
482
                                                                [% SET rating_avg = itemsloo.ratings.get_avg_rating() %]
483
                                                                [% rating_avg_int = BLOCK %][% rating_avg | format("%.0f") %][% END %]
484
                                                                <div class="br-wrapper br-theme-fontawesome-stars">
485
                                                                    <div class="br-widget br-readonly">
486
                                                                        [% FOREACH i IN [ 1 2 3 4 5  ] %]
487
                                                                            [% IF rating_avg_int == i %]
488
                                                                                <a href="#" class="br-selected br-current"></a>
489
                                                                            [% ELSIF rating_avg_int > i %]
490
                                                                                <a href="#" class="br-selected"></a>
491
                                                                            [% ELSE %]
492
                                                                                <a href="#"></a>
493
                                                                            [% END %]
494
                                                                        [% END %]
495
                                                                    </div>
496
                                                                </div>
497
498
                                                                [% IF itemsloo.ratings.count > 0  %]
499
                                                                    <span id="rating_total_[% itemsloo.biblionumber | html %]">&nbsp;&nbsp;([% itemsloo.ratings.count | html %] votes)</span>
500
                                                                [% ELSE %]
501
                                                                    <br />
502
                                                                [% END %]
503
                                                            </div> <!-- / .results_summary -->
504
                                                        [% END # / IF OpacStarRatings %]
505
480
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
506
                                                        [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
481
                                                            <div class="results_summary tags">
507
                                                            <div class="results_summary tags">
482
                                                                <span class="label">Tags:</span>
508
                                                                <span class="label">Tags:</span>
(-)a/opac/opac-shelves.pl (-1 / +11 lines)
Lines 43-48 use Koha::ItemTypes; Link Here
43
use Koha::Patrons;
43
use Koha::Patrons;
44
use Koha::Virtualshelves;
44
use Koha::Virtualshelves;
45
use Koha::RecordProcessor;
45
use Koha::RecordProcessor;
46
use Koha::Ratings;
46
47
47
use constant ANYONE => 2;
48
use constant ANYONE => 2;
48
49
Lines 75-80 if( $op eq 'view' || $op eq 'list' ){ Link Here
75
        });
76
        });
76
}
77
}
77
78
79
$template->param(
80
    OpacStarRatings => C4::Context->preference("OpacStarRatings")
81
);
82
78
if (C4::Context->preference("BakerTaylorEnabled")) {
83
if (C4::Context->preference("BakerTaylorEnabled")) {
79
    $template->param(
84
    $template->param(
80
        BakerTaylorImageURL => &image_url(),
85
        BakerTaylorImageURL => &image_url(),
Lines 352-357 if ( $op eq 'view' ) { Link Here
352
                    });
357
                    });
353
                }
358
                }
354
359
360
                if ( C4::Context->preference('OpacStarRatings') eq 'all' ) {
361
                    my $ratings = Koha::Ratings->search({ biblionumber => $this_item->{biblionumber} });
362
                    $this_item->{ratings} = $ratings;
363
                    $this_item->{my_rating} = $loggedinuser ? $ratings->search({ borrowernumber => $loggedinuser })->next : undef;
364
                }
365
355
                my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
366
                my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron });
356
                my $allow_onshelf_holds;
367
                my $allow_onshelf_holds;
357
                while ( my $item = $items->next ) {
368
                while ( my $item = $items->next ) {
358
- 

Return to bug 29280