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