use C4::External::OverDrive;
use Koha::ItemTypes;
-use Koha::LibraryCategories;
use Koha::Ratings;
use Koha::Virtualshelves;
+use Koha::Library::Groups;
use POSIX qw(ceil floor strftime);
use URI::Escape;
elsif (@params && $build_grouped_results) {
$template_name = 'opac-results-grouped.tt';
}
-elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) {
+elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) {
$template_name = 'opac-results.tt';
}
else {
}
}
-my $library_categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } );
-$template->param( searchdomainloop => $library_categories );
+my @search_groups = Koha::Library::Groups->get_search_groups();
+$template->param( search_groups => \@search_groups );
# load the language limits (for search)
my $languages_limit_loop = getLanguages($lang, 1);
# add translated_description to itemtypes
foreach my $itemtype ( keys %{$itemtypes} ) {
# Itemtypes search categories don't have (yet) translated descriptions, they are auth values (and could still have no descriptions too BZ 18400)
- my $translated_description = Koha::ItemTypes->find( $itemtype )->translated_description;
+ # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
+ my $translated_description = $itemtypes->{$itemtype}->{iscat}
+ ? $itemtypes->{$itemtype}->{description}
+ : Koha::ItemTypes->find($itemtype)->translated_description;
$itemtypes->{$itemtype}->{translated_description} = $translated_description || $itemtypes->{$itemtype}->{description} || q{};
}
}
}
- if (C4::Context->preference('OPACNumbersPreferPhrase')) {
- $template->param('numbersphr' => 1);
- }
output_html_with_http_headers $cgi, $cookie, $template->output;
exit;
@limits = map { uri_unescape($_) } @limits;
if($params->{'multibranchlimit'}) {
- my $library_category = Koha::LibraryCategories->find( $params->{multibranchlimit} );
- my @libraries = $library_category->libraries;
- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->id } @libraries ) .')';
+ my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
+ my @libraries = $search_group->all_libraries;
+ my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')';
push @limits, $multibranch if ($multibranch ne '()');
}