Lines 834-874
for (my $i=0;$i<@servers;$i++) {
Link Here
|
834 |
} |
834 |
} |
835 |
$template->param(results_per_page => $results_per_page); |
835 |
$template->param(results_per_page => $results_per_page); |
836 |
my $hide = ($hidingrules) ? 1 : 0; |
836 |
my $hide = ($hidingrules) ? 1 : 0; |
837 |
my $branch = ''; |
|
|
838 |
if (C4::Context->userenv){ |
839 |
$branch = C4::Context->userenv->{branch}; |
840 |
} |
841 |
if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) { |
842 |
if ( |
843 |
( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch ) |
844 |
|| |
845 |
C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' |
846 |
) { |
847 |
my $branchcode; |
848 |
if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { |
849 |
$branchcode = $branch; |
850 |
} |
851 |
elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { |
852 |
$branchcode = $ENV{'BRANCHCODE'}; |
853 |
} |
854 |
|
855 |
foreach my $res ( @newresults ) { |
856 |
my @new_loop; |
857 |
my @top_loop; |
858 |
my @old_loop = @{$res->{'available_items_loop'}}; |
859 |
foreach my $item ( @old_loop ) { |
860 |
if ( $item->{'branchcode'} eq $branchcode ) { |
861 |
$item->{'this_branch'} = 1; |
862 |
push( @top_loop, $item ); |
863 |
} else { |
864 |
push( @new_loop, $item ); |
865 |
} |
866 |
} |
867 |
my @complete_loop = ( @top_loop, @new_loop ); |
868 |
$res->{'available_items_loop'} = \@complete_loop; |
869 |
} |
870 |
} |
871 |
} |
872 |
|
837 |
|
873 |
$template->param( |
838 |
$template->param( |
874 |
SEARCH_RESULTS => \@newresults, |
839 |
SEARCH_RESULTS => \@newresults, |