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

(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 418-420 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
418
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo');
418
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo');
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');
419
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');
420
INSERT INTO systempreferences (variable,value,explanation,options,type)  VALUES('TrackClicks','0','Track links clicked',NULL,'Integer');
420
INSERT INTO systempreferences (variable,value,explanation,options,type)  VALUES('TrackClicks','0','Track links clicked',NULL,'Integer');
421
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');
422
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 (+7 lines)
Lines 6476-6481 if ( CheckVersion($DBversion) ) { Link Here
6476
    SetVersion($DBversion);
6476
    SetVersion($DBversion);
6477
}
6477
}
6478
6478
6479
$DBversion = "3.11.00.XXX";
6480
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6481
    $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')");
6482
    $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')");
6483
    print "Upgrade to $DBversion done (Add syspref HighlightOwnItemsOnOPAC)\n";
6484
    SetVersion ($DBversion);
6485
}
6479
6486
6480
=head1 FUNCTIONS
6487
=head1 FUNCTIONS
6481
6488
(-)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 528-533 $(document).ready(function(){ Link Here
528
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
528
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
529
                    <span class="available"><strong>Copies available:</strong>
529
                    <span class="available"><strong>Copies available:</strong>
530
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
530
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
531
                    [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
531
                    [% IF ( singleBranchMode ) %]
532
                    [% IF ( singleBranchMode ) %]
532
                        [% available_items_loo.location %]
533
                        [% available_items_loo.location %]
533
                    [% ELSE %]
534
                    [% ELSE %]
Lines 539-544 $(document).ready(function(){ Link Here
539
                        [% 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 %]
540
                        [% 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 %]
540
                    [% END %]
541
                    [% END %]
541
                    ([% available_items_loo.count %]),
542
                    ([% available_items_loo.count %]),
543
                    </span>
542
                    [% END %]
544
                    [% END %]
543
                    </span>
545
                    </span>
544
                    [% ELSE %]
546
                    [% 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 698-703 for (my $i=0;$i<@servers;$i++) { Link Here
698
            $template->param(results_per_page =>  $results_per_page);
698
            $template->param(results_per_page =>  $results_per_page);
699
            my $hide = C4::Context->preference('OpacHiddenItems');
699
            my $hide = C4::Context->preference('OpacHiddenItems');
700
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
700
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
701
702
            my $branch = C4::Context->userenv->{branch};
703
            if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
704
                if (
705
                    ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
706
                    ||
707
                    C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
708
                ) {
709
                    my $branchname;
710
                    if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
711
                        $branchname = $branches->{$branch}->{'branchname'};
712
                    }
713
                    elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
714
                        $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
715
                    }
716
717
                    foreach my $res ( @newresults ) {
718
                        my @new_loop;
719
                        my @top_loop;
720
                        my @old_loop = @{$res->{'available_items_loop'}};
721
                        foreach my $item ( @old_loop ) {
722
                            if ( $item->{'branchname'} eq $branchname ) {
723
                                $item->{'this_branch'} = 1;
724
                                push( @top_loop, $item );
725
                            } else {
726
                                push( @new_loop, $item );
727
                            }
728
                        }
729
                        my @complete_loop = ( @top_loop, @new_loop );
730
                        $res->{'available_items_loop'} = \@complete_loop;
731
                    }
732
                }
733
            }
734
701
            $template->param(
735
            $template->param(
702
                SEARCH_RESULTS => \@newresults,
736
                SEARCH_RESULTS => \@newresults,
703
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
737
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
704
- 

Return to bug 7740