Lines 38-44
use C4::Search::History;
Link Here
|
38 |
use C4::Biblio; # GetBiblioData |
38 |
use C4::Biblio; # GetBiblioData |
39 |
use C4::Koha; |
39 |
use C4::Koha; |
40 |
use C4::Tags qw(get_tags); |
40 |
use C4::Tags qw(get_tags); |
41 |
use C4::Branch; # GetBranches |
|
|
42 |
use C4::SocialData; |
41 |
use C4::SocialData; |
43 |
use C4::Ratings; |
42 |
use C4::Ratings; |
44 |
use C4::External::OverDrive; |
43 |
use C4::External::OverDrive; |
Lines 202-208
if ($cgi->cookie("search_path_code")) {
Link Here
|
202 |
} |
201 |
} |
203 |
} |
202 |
} |
204 |
|
203 |
|
205 |
my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established |
|
|
206 |
my $library_categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } ); |
204 |
my $library_categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } ); |
207 |
$template->param( searchdomainloop => $library_categories ); |
205 |
$template->param( searchdomainloop => $library_categories ); |
208 |
|
206 |
|
Lines 597-603
if ($tag) {
Link Here
|
597 |
# FIXME: No facets for tags search. |
595 |
# FIXME: No facets for tags search. |
598 |
} elsif ($build_grouped_results) { |
596 |
} elsif ($build_grouped_results) { |
599 |
eval { |
597 |
eval { |
600 |
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); |
598 |
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$query_type,$scan); |
601 |
}; |
599 |
}; |
602 |
} else { |
600 |
} else { |
603 |
$pasarParams .= '&query=' . uri_escape_utf8($query); |
601 |
$pasarParams .= '&query=' . uri_escape_utf8($query); |
Lines 605-611
if ($tag) {
Link Here
|
605 |
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query); |
603 |
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query); |
606 |
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type); |
604 |
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type); |
607 |
eval { |
605 |
eval { |
608 |
($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes_nocategory,$query_type,$scan,1); |
606 |
($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$itemtypes_nocategory,$query_type,$scan,1); |
609 |
}; |
607 |
}; |
610 |
} |
608 |
} |
611 |
# This sorts the facets into alphabetical order |
609 |
# This sorts the facets into alphabetical order |
Lines 794-805
for (my $i=0;$i<@servers;$i++) {
Link Here
|
794 |
|| |
792 |
|| |
795 |
C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' |
793 |
C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' |
796 |
) { |
794 |
) { |
797 |
my $branchname; |
795 |
my $branchcode; |
798 |
if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { |
796 |
if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) { |
799 |
$branchname = $branches->{$branch}->{'branchname'}; |
797 |
$branchcode = $branch; |
800 |
} |
798 |
} |
801 |
elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { |
799 |
elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) { |
802 |
$branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'}; |
800 |
$branchcode = $ENV{'BRANCHCODE'}; |
803 |
} |
801 |
} |
804 |
|
802 |
|
805 |
foreach my $res ( @newresults ) { |
803 |
foreach my $res ( @newresults ) { |
Lines 807-813
for (my $i=0;$i<@servers;$i++) {
Link Here
|
807 |
my @top_loop; |
805 |
my @top_loop; |
808 |
my @old_loop = @{$res->{'available_items_loop'}}; |
806 |
my @old_loop = @{$res->{'available_items_loop'}}; |
809 |
foreach my $item ( @old_loop ) { |
807 |
foreach my $item ( @old_loop ) { |
810 |
if ( $item->{'branchname'} eq $branchname ) { |
808 |
if ( $item->{'branchcode'} eq $branchcode ) { |
811 |
$item->{'this_branch'} = 1; |
809 |
$item->{'this_branch'} = 1; |
812 |
push( @top_loop, $item ); |
810 |
push( @top_loop, $item ); |
813 |
} else { |
811 |
} else { |