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

(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 386-388 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy Link Here
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
386
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
387
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
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');
390
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 6020-6025 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6020
   SetVersion ($DBversion);
6020
   SetVersion ($DBversion);
6021
}
6021
}
6022
6022
6023
$DBversion = "3.09.00.XXX";
6024
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6025
    $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')");
6026
    $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')");
6027
    print "Upgrade to $DBversion done (Add syspref HighlightOwnItemsOnOPAC)\n";
6028
    SetVersion ($DBversion);
6029
}
6030
6023
=head1 FUNCTIONS
6031
=head1 FUNCTIONS
6024
6032
6025
=head2 TableExists($table)
6033
=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 2820-2822 body#opac-main #opacmainuserblockmobile { Link Here
2820
.tagweight9 {
2820
.tagweight9 {
2821
    font-size: 30px;
2821
    font-size: 30px;
2822
}
2822
}
2823
2824
.highlight-row-results {
2825
    font-size: 120%;
2826
}
2827
2828
.highlight-row-detail {
2829
    font-weight: bold;
2830
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +2 lines)
Lines 754-760 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
754
        [% END %]
754
        [% END %]
755
        </tr></thead>
755
        </tr></thead>
756
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
756
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
757
      <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 %]
757
      [% IF ITEM_RESULT.this_branch %]<tr class="highlight-row-detail">[% ELSE %]<tr>[% END %]
758
      [% 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 %]
758
             <td class="location">
759
             <td class="location">
759
    [% UNLESS ( singleBranchMode ) %]
760
    [% UNLESS ( singleBranchMode ) %]
760
        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
761
        <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 489-494 $(document).ready(function(){ Link Here
489
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
489
                    [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
490
                    <span class="available"><strong>Copies available:</strong>
490
                    <span class="available"><strong>Copies available:</strong>
491
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
491
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
492
                    [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
492
                    [% IF ( singleBranchMode ) %]
493
                    [% IF ( singleBranchMode ) %]
493
                        [% available_items_loo.location %]
494
                        [% available_items_loo.location %]
494
                    [% ELSE %]
495
                    [% ELSE %]
Lines 500-505 $(document).ready(function(){ Link Here
500
                        [% 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 %]
501
                        [% 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 %]
501
                    [% END %]
502
                    [% END %]
502
                    ([% available_items_loo.count %]),
503
                    ([% available_items_loo.count %]),
504
                    </span>
503
                    [% END %]
505
                    [% END %]
504
                    </span>
506
                    </span>
505
                    [% ELSE %]
507
                    [% ELSE %]
(-)a/opac/opac-detail.pl (+32 lines)
Lines 440-445 if ($hideitems) { Link Here
440
    @items = @all_items;
440
    @items = @all_items;
441
}
441
}
442
442
443
my $branches = GetBranches();
444
my $branch = C4::Context->userenv->{branch};
445
if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
446
    if (
447
        ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
448
        ||
449
        C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
450
    ) {
451
        my $branchname;
452
        if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
453
            $branchname = $branches->{$branch}->{'branchname'};
454
        }
455
        elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
456
            $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
457
        }
458
459
        my @our_items;
460
        my @other_items;
461
462
        foreach my $item ( @items ) {
463
           if ( $item->{'branchname'} eq $branchname ) {
464
               $item->{'this_branch'} = 1;
465
               push( @our_items, $item );
466
           } else {
467
               push( @other_items, $item );
468
           }
469
        }
470
471
        @items = ( @our_items, @other_items );
472
    }
473
}
474
443
my $dat = &GetBiblioData($biblionumber);
475
my $dat = &GetBiblioData($biblionumber);
444
476
445
my $itemtypes = GetItemTypes();
477
my $itemtypes = GetItemTypes();
(-)a/opac/opac-search.pl (-1 / +34 lines)
Lines 694-699 for (my $i=0;$i<@servers;$i++) { Link Here
694
            $template->param(results_per_page =>  $results_per_page);
694
            $template->param(results_per_page =>  $results_per_page);
695
            my $hide = C4::Context->preference('OpacHiddenItems');
695
            my $hide = C4::Context->preference('OpacHiddenItems');
696
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
696
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
697
698
            my $branch = C4::Context->userenv->{branch};
699
            if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
700
                if (
701
                    ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
702
                    ||
703
                    C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
704
                ) {
705
                    my $branchname;
706
                    if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
707
                        $branchname = $branches->{$branch}->{'branchname'};
708
                    }
709
                    elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
710
                        $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
711
                    }
712
713
                    foreach my $res ( @newresults ) {
714
                        my @new_loop;
715
                        my @top_loop;
716
                        my @old_loop = @{$res->{'available_items_loop'}};
717
                        foreach my $item ( @old_loop ) {
718
                            if ( $item->{'branchname'} eq $branchname ) {
719
                                $item->{'this_branch'} = 1;
720
                                push( @top_loop, $item );
721
                            } else {
722
                                push( @new_loop, $item );
723
                            }
724
                        }
725
                        my @complete_loop = ( @top_loop, @new_loop );
726
                        $res->{'available_items_loop'} = \@complete_loop;
727
                    }
728
                }
729
            }
730
697
            $template->param(
731
            $template->param(
698
                SEARCH_RESULTS => \@newresults,
732
                SEARCH_RESULTS => \@newresults,
699
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
733
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
700
- 

Return to bug 7740