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

(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 421-423 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
421
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UseKohaPlugins','1','Enable or disable the ability to use Koha Plugins.','','YesNo');
422
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice');
422
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('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')
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 6700-6705 if ( CheckVersion($DBversion) ) { Link Here
6700
    SetVersion ($DBversion);
6700
    SetVersion ($DBversion);
6701
}
6701
}
6702
6702
6703
$DBversion = "3.11.00.XXX";
6704
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6705
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo')");
6706
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('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')");
6707
    print "Upgrade to $DBversion done (Bug 7740: Add syspref HighlightOwnItemsOnOPAC)\n";
6708
    SetVersion ($DBversion);
6709
}
6710
6703
=head1 FUNCTIONS
6711
=head1 FUNCTIONS
6704
6712
6705
=head2 TableExists($table)
6713
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+11 lines)
Lines 22-27 OPAC: Link Here
22
                  no: Disable
22
                  no: Disable
23
            - "Koha OPAC as public. Private OPAC requires authentification before accessing the OPAC."
23
            - "Koha OPAC as public. Private OPAC requires authentification before accessing the OPAC."
24
        -
24
        -
25
            - pref: HighlightOwnItemsOnOPAC
26
              choices:
27
                  yes: Emphasize
28
                  no: "Don't emphasize"
29
            - "results from the "
30
            - pref: HighlightOwnItemsOnOPACWhich
31
              choices:
32
                  PatronBranch: "patron's home branch"
33
                  OpacURLBranch: "OPAC's branch via the URL"
34
            - " by moving the results to the front and increasing the size or highlighting the rows for those results."
35
        -
25
            - "Show star-ratings on"
36
            - "Show star-ratings on"
26
            - pref: OpacStarRatings
37
            - pref: OpacStarRatings
27
              choices:
38
              choices:
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+8 lines)
Lines 2920-2922 a.reviewlink,a.reviewlink:visited { Link Here
2920
.idbresult img {
2920
.idbresult img {
2921
    padding-right: 6px;
2921
    padding-right: 6px;
2922
}
2922
}
2923
2924
.highlight-row-results {
2925
    font-size: 120%;
2926
}
2927
2928
.highlight-row-detail {
2929
    font-weight: bold;
2930
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +2 lines)
Lines 1471-1477 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1471
        [% END %]
1471
        [% END %]
1472
        </tr></thead>
1472
        </tr></thead>
1473
	    <tbody>[% FOREACH ITEM_RESULT IN items %]
1473
	    <tbody>[% FOREACH ITEM_RESULT IN items %]
1474
      <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
1474
      [% IF ITEM_RESULT.this_branch %]<tr class="highlight-row-detail">[% ELSE %]<tr>[% END %]
1475
      [% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
1475
             <td class="location">
1476
             <td class="location">
1476
    [% UNLESS ( singleBranchMode ) %]
1477
    [% UNLESS ( singleBranchMode ) %]
1477
        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
1478
        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (+2 lines)
Lines 532-537 $(document).ready(function(){ Link Here
532
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
532
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
533
                    <span class="available"><strong>Copies available:</strong>
533
                    <span class="available"><strong>Copies available:</strong>
534
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
534
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
535
                    [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
535
                    [% IF ( singleBranchMode ) %]
536
                    [% IF ( singleBranchMode ) %]
536
                        [% available_items_loo.location %]
537
                        [% available_items_loo.location %]
537
                    [% ELSE %]
538
                    [% ELSE %]
Lines 543-548 $(document).ready(function(){ Link Here
543
                        [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
544
                        [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
544
                    [% END %]
545
                    [% END %]
545
                    ([% available_items_loo.count %]),
546
                    ([% available_items_loo.count %]),
547
                    </span>
546
                    [% END %]
548
                    [% END %]
547
                    </span>
549
                    </span>
548
                    [% ELSE %]
550
                    [% ELSE %]
(-)a/opac/opac-detail.pl (+32 lines)
Lines 441-446 if ($hideitems) { Link Here
441
    @items = @all_items;
441
    @items = @all_items;
442
}
442
}
443
443
444
my $branches = GetBranches();
445
my $branch = C4::Context->userenv->{branch};
446
if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
447
    if (
448
        ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
449
        ||
450
        C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
451
    ) {
452
        my $branchname;
453
        if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
454
            $branchname = $branches->{$branch}->{'branchname'};
455
        }
456
        elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
457
            $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
458
        }
459
460
        my @our_items;
461
        my @other_items;
462
463
        foreach my $item ( @items ) {
464
           if ( $item->{'branchname'} eq $branchname ) {
465
               $item->{'this_branch'} = 1;
466
               push( @our_items, $item );
467
           } else {
468
               push( @other_items, $item );
469
           }
470
        }
471
472
        @items = ( @our_items, @other_items );
473
    }
474
}
475
444
my $dat = &GetBiblioData($biblionumber);
476
my $dat = &GetBiblioData($biblionumber);
445
477
446
my $itemtypes = GetItemTypes();
478
my $itemtypes = GetItemTypes();
(-)a/opac/opac-search.pl (-1 / +34 lines)
Lines 699-704 for (my $i=0;$i<@servers;$i++) { Link Here
699
            $template->param(results_per_page =>  $results_per_page);
699
            $template->param(results_per_page =>  $results_per_page);
700
            my $hide = C4::Context->preference('OpacHiddenItems');
700
            my $hide = C4::Context->preference('OpacHiddenItems');
701
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
701
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
702
703
            my $branch = C4::Context->userenv->{branch};
704
            if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
705
                if (
706
                    ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
707
                    ||
708
                    C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
709
                ) {
710
                    my $branchname;
711
                    if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
712
                        $branchname = $branches->{$branch}->{'branchname'};
713
                    }
714
                    elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
715
                        $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
716
                    }
717
718
                    foreach my $res ( @newresults ) {
719
                        my @new_loop;
720
                        my @top_loop;
721
                        my @old_loop = @{$res->{'available_items_loop'}};
722
                        foreach my $item ( @old_loop ) {
723
                            if ( $item->{'branchname'} eq $branchname ) {
724
                                $item->{'this_branch'} = 1;
725
                                push( @top_loop, $item );
726
                            } else {
727
                                push( @new_loop, $item );
728
                            }
729
                        }
730
                        my @complete_loop = ( @top_loop, @new_loop );
731
                        $res->{'available_items_loop'} = \@complete_loop;
732
                    }
733
                }
734
            }
735
702
            $template->param(
736
            $template->param(
703
                SEARCH_RESULTS => \@newresults,
737
                SEARCH_RESULTS => \@newresults,
704
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
738
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
705
- 

Return to bug 7740