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

(-)a/C4/UsageStats.pm (-1 lines)
Lines 275-281 sub _shared_preferences { Link Here
275
        COinSinOPACResults
275
        COinSinOPACResults
276
        DisplayOPACiconsXSLT
276
        DisplayOPACiconsXSLT
277
        hidelostitems
277
        hidelostitems
278
        HighlightOwnItemsOnOPAC
279
        OpacAddMastheadLibraryPulldown
278
        OpacAddMastheadLibraryPulldown
280
        OPACDisplay856uAsImage
279
        OPACDisplay856uAsImage
281
        OpacHighlightedWords
280
        OpacHighlightedWords
(-)a/installer/data/mysql/atomicupdate/bug_12561.perl (+7 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do( q{ DELETE FROM systempreferences WHERE variable IN ('HighlightOwnItemsOnOPAC', 'HighlightOwnItemsOnOPACWhich')} );
5
6
    NewVersion( $DBversion, 12561, "Remove system preferences HighlightOwnItemsOnOPAC and HighlightOwnItemsOnOPACWhich");
7
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-2 lines)
Lines 234-241 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
234
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
234
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
235
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
235
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
236
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
236
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
237
('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from their home library will be emphasized and shown first in search results and item details.','YesNo'),
238
('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch\'s items to emphasize. If PatronBranch, emphasize the logged in user\'s library\'s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha\'s Apache configuration file.','Choice'),
239
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
237
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
240
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
238
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
241
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
239
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-11 lines)
Lines 42-58 OPAC: Link Here
42
                  0: Disable
42
                  0: Disable
43
            - "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
43
            - "Koha OPAC as public. Private OPAC requires authentication before accessing the OPAC. "
44
            - 'Note: This does not affect the public API, see the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RESTPublicAnonymousRequests">RESTPublicAnonymousRequests</a> to control the API.'
44
            - 'Note: This does not affect the public API, see the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RESTPublicAnonymousRequests">RESTPublicAnonymousRequests</a> to control the API.'
45
        -
46
            - pref: HighlightOwnItemsOnOPAC
47
              choices:
48
                  1: Emphasize
49
                  0: "Don't emphasize"
50
            - "results from the "
51
            - pref: HighlightOwnItemsOnOPACWhich
52
              choices:
53
                  PatronBranch: "patron's home library"
54
                  OpacURLBranch: "OPAC's library via the URL"
55
            - " by moving the results to the front and increasing the size or highlighting the rows for those results (non-XSLT only)."
56
        -
45
        -
57
            - "Show star-ratings on"
46
            - "Show star-ratings on"
58
            - pref: OpacStarRatings
47
            - pref: OpacStarRatings
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-5 / +1 lines)
Lines 107-117 Link Here
107
    [% END %]
107
    [% END %]
108
108
109
    [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
109
    [% IF ( AmazonCoverImages  || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %]
110
        [% IF ( XSLTDetailsDisplay ) %]
110
        <div id="catalogue_detail_biblio" class="col-xs-9">
111
            <div id="catalogue_detail_biblio" class="col-xs-9">
112
        [% ELSE %]
113
            <div id="catalogue_detail_biblio" class="col-xs-9">
114
        [% END %]
115
    [% ELSE %]
111
    [% ELSE %]
116
        <div id="catalogue_detail_biblio" class="col-xs-12">
112
        <div id="catalogue_detail_biblio" class="col-xs-12">
117
    [% END %]
113
    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-5 / +1 lines)
Lines 1269-1279 Link Here
1269
        </thead>
1269
        </thead>
1270
        <tbody>
1270
        <tbody>
1271
            [% FOREACH ITEM_RESULT IN items %]
1271
            [% FOREACH ITEM_RESULT IN items %]
1272
                [% IF ITEM_RESULT.this_branch %]
1272
                <tr vocab="http://schema.org/" typeof="Offer">
1273
                  <tr class="highlight-row-detail" vocab="http://schema.org/" typeof="Offer">
1274
                [% ELSE %]
1275
                  <tr vocab="http://schema.org/" typeof="Offer">
1276
                [% END %]
1277
1273
1278
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1274
                [% IF Koha.Preference('OPACLocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
1279
                    <td class="cover">
1275
                    <td class="cover">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-6 / +1 lines)
Lines 503-514 Link Here
503
                                                            [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
503
                                                            [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
504
                                                                <span class="available"><strong>Items available:</strong>
504
                                                                <span class="available"><strong>Items available:</strong>
505
                                                                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
505
                                                                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
506
                                                                        [% IF available_items_loo.this_branch %]
506
                                                                        <span>
507
                                                                            <span class="highlight-row-results">
508
                                                                        [% ELSE %]
509
                                                                            <span>
510
                                                                        [% END %]
511
512
                                                                        [% IF ( singleBranchMode ) %]
507
                                                                        [% IF ( singleBranchMode ) %]
513
                                                                            <span class="shelvingloc">[% available_items_loo.location | html %]</span>
508
                                                                            <span class="shelvingloc">[% available_items_loo.location | html %]</span>
514
                                                                        [% ELSE %]
509
                                                                        [% ELSE %]
(-)a/opac/opac-detail.pl (-34 lines)
Lines 578-617 if ($hideitems) { Link Here
578
    @items = @all_items;
578
    @items = @all_items;
579
}
579
}
580
580
581
my $branch = '';
582
if (C4::Context->userenv){
583
    $branch = C4::Context->userenv->{branch};
584
}
585
if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
586
    if (
587
        ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
588
        ||
589
        C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
590
    ) {
591
        my $branchcode;
592
        if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
593
            $branchcode = $branch;
594
        }
595
        elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
596
            $branchcode = $ENV{'BRANCHCODE'};
597
        }
598
599
        my @our_items;
600
        my @other_items;
601
602
        foreach my $item ( @items ) {
603
           if ( $item->{branchcode} eq $branchcode ) {
604
               $item->{'this_branch'} = 1;
605
               push( @our_items, $item );
606
           } else {
607
               push( @other_items, $item );
608
           }
609
        }
610
611
        @items = ( @our_items, @other_items );
612
    }
613
}
614
615
my $dat = &GetBiblioData($biblionumber);
581
my $dat = &GetBiblioData($biblionumber);
616
my $HideMARC = $record_processor->filters->[0]->should_hide_marc(
582
my $HideMARC = $record_processor->filters->[0]->should_hide_marc(
617
    {
583
    {
(-)a/opac/opac-search.pl (-36 lines)
Lines 833-873 for (my $i=0;$i<@servers;$i++) { Link Here
833
            }
833
            }
834
            $template->param(results_per_page =>  $results_per_page);
834
            $template->param(results_per_page =>  $results_per_page);
835
            my $hide = ($hidingrules) ? 1 : 0;
835
            my $hide = ($hidingrules) ? 1 : 0;
836
            my $branch = '';
837
            if (C4::Context->userenv){
838
                $branch = C4::Context->userenv->{branch};
839
            }
840
            if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
841
                if (
842
                    ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
843
                    ||
844
                    C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
845
                ) {
846
                    my $branchcode;
847
                    if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
848
                        $branchcode = $branch;
849
                    }
850
                    elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
851
                        $branchcode = $ENV{'BRANCHCODE'};
852
                    }
853
854
                    foreach my $res ( @newresults ) {
855
                        my @new_loop;
856
                        my @top_loop;
857
                        my @old_loop = @{$res->{'available_items_loop'}};
858
                        foreach my $item ( @old_loop ) {
859
                            if ( $item->{'branchcode'} eq $branchcode ) {
860
                                $item->{'this_branch'} = 1;
861
                                push( @top_loop, $item );
862
                            } else {
863
                                push( @new_loop, $item );
864
                            }
865
                        }
866
                        my @complete_loop = ( @top_loop, @new_loop );
867
                        $res->{'available_items_loop'} = \@complete_loop;
868
                    }
869
                }
870
            }
871
836
872
            $template->param(
837
            $template->param(
873
                SEARCH_RESULTS => \@newresults,
838
                SEARCH_RESULTS => \@newresults,
874
- 

Return to bug 12561