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

(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 365-367 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
365
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice');
365
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice');
366
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo');
366
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo');
367
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo');
367
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo');
368
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');
369
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 5249-5254 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5249
    SetVersion($DBversion);
5249
    SetVersion($DBversion);
5250
}
5250
}
5251
5251
5252
$DBversion = "3.09.00.XXX";
5253
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5254
    $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')");
5255
    $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')");
5256
    print "Upgrade to $DBversion done (Add syspref HighlightOwnItemsOnOPAC)\n";
5257
    SetVersion ($DBversion);
5258
}
5259
5252
=head1 FUNCTIONS
5260
=head1 FUNCTIONS
5253
5261
5254
=head2 TableExists($table)
5262
=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 2520-2522 span.sep { Link Here
2520
}
2520
}
2521
2521
2522
*/
2522
*/
2523
2524
.highlight-row-results {
2525
    font-size: 120%;
2526
}
2527
2528
.highlight-row-detail {
2529
    font-weight: bold;
2530
}
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-2 / +3 lines)
Lines 720-727 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
720
            <th id="item_datedue">Date due</th>
720
            <th id="item_datedue">Date due</th>
721
        </tr></thead>
721
        </tr></thead>
722
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
722
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
723
	    <tr>[% IF ( item_level_itypes ) %]<td>[% 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 %]
723
              [% IF ITEM_RESULT.this_branch %]<tr class="highlight-row-detail">[% ELSE %]<tr>[% END %]
724
		<td>
724
              [% 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 %]
725
              <td>
725
    [% UNLESS ( singleBranchMode ) %]
726
    [% UNLESS ( singleBranchMode ) %]
726
        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
727
        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
727
        [% IF ( ITEM_RESULT.branchurl ) %]
728
        [% IF ( ITEM_RESULT.branchurl ) %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (+2 lines)
Lines 450-455 $(document).ready(function(){ Link Here
450
                    <span class="available"><strong>Copies available:</strong>
450
                    <span class="available"><strong>Copies available:</strong>
451
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
451
                    [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
452
                    [% UNLESS ( available_items_loo.hideatopac ) %]
452
                    [% UNLESS ( available_items_loo.hideatopac ) %]
453
                    [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
453
                    [% IF ( singleBranchMode ) %]
454
                    [% IF ( singleBranchMode ) %]
454
                        [% available_items_loo.location %]
455
                        [% available_items_loo.location %]
455
                    [% ELSE %]
456
                    [% ELSE %]
Lines 461-466 $(document).ready(function(){ Link Here
461
                        [% 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 %]
462
                        [% 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 %]
462
                    [% END %]
463
                    [% END %]
463
                    ([% available_items_loo.count %]),
464
                    ([% available_items_loo.count %]),
465
                    </span>
464
                    [% END %]
466
                    [% END %]
465
                    [% END %]
467
                    [% END %]
466
                    </span>
468
                    </span>
(-)a/opac/opac-detail.pl (+32 lines)
Lines 435-440 if ($hideitems) { Link Here
435
    @items = @all_items;
435
    @items = @all_items;
436
}
436
}
437
437
438
my $branches = GetBranches();
439
my $branch = C4::Context->userenv->{branch};
440
if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
441
    if (
442
        ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
443
        ||
444
        C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
445
    ) {
446
        my $branchname;
447
        if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
448
            $branchname = $branches->{$branch}->{'branchname'};
449
        }
450
        elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
451
            $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
452
        }
453
454
        my @our_items;
455
        my @other_items;
456
457
        foreach my $item ( @items ) {
458
           if ( $item->{'branchname'} eq $branchname ) {
459
               $item->{'this_branch'} = 1;
460
               push( @our_items, $item );
461
           } else {
462
               push( @other_items, $item );
463
           }
464
        }
465
466
        @items = ( @our_items, @other_items );
467
    }
468
}
469
438
my $dat = &GetBiblioData($biblionumber);
470
my $dat = &GetBiblioData($biblionumber);
439
471
440
my $itemtypes = GetItemTypes();
472
my $itemtypes = GetItemTypes();
(-)a/opac/opac-search.pl (-1 / +34 lines)
Lines 669-674 for (my $i=0;$i<@servers;$i++) { Link Here
669
            $template->param(results_per_page =>  $results_per_page);
669
            $template->param(results_per_page =>  $results_per_page);
670
            my $hide = C4::Context->preference('OpacHiddenItems');
670
            my $hide = C4::Context->preference('OpacHiddenItems');
671
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
671
            $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
672
673
            my $branch = C4::Context->userenv->{branch};
674
            if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
675
                if (
676
                    ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
677
                    ||
678
                    C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
679
                ) {
680
                    my $branchname;
681
                    if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
682
                        $branchname = $branches->{$branch}->{'branchname'};
683
                    }
684
                    elsif (  C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
685
                        $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
686
                    }
687
688
                    foreach my $res ( @newresults ) {
689
                        my @new_loop;
690
                        my @top_loop;
691
                        my @old_loop = @{$res->{'available_items_loop'}};
692
                        foreach my $item ( @old_loop ) {
693
                            if ( $item->{'branchname'} eq $branchname ) {
694
                                $item->{'this_branch'} = 1;
695
                                push( @top_loop, $item );
696
                            } else {
697
                                push( @new_loop, $item );
698
                            }
699
                        }
700
                        my @complete_loop = ( @top_loop, @new_loop );
701
                        $res->{'available_items_loop'} = \@complete_loop;
702
                    }
703
                }
704
            }
705
672
            $template->param(
706
            $template->param(
673
                SEARCH_RESULTS => \@newresults,
707
                SEARCH_RESULTS => \@newresults,
674
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0),
708
                OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0),
675
- 

Return to bug 7740