Lines 95-111
my $lang = C4::Templates::getlanguage($cgi, 'opac');
Link Here
|
95 |
my $template_name; |
95 |
my $template_name; |
96 |
my $template_type = 'basic'; |
96 |
my $template_type = 'basic'; |
97 |
my @params = $cgi->param("limit"); |
97 |
my @params = $cgi->param("limit"); |
98 |
|
98 |
my @searchCategories = $cgi->param('searchcat'); |
99 |
|
99 |
|
100 |
my $format = $cgi->param("format") || ''; |
100 |
my $format = $cgi->param("format") || ''; |
101 |
my $build_grouped_results = C4::Context->preference('OPACGroupResults'); |
101 |
my $build_grouped_results = C4::Context->preference('OPACGroupResults'); |
102 |
if ($format =~ /(rss|atom|opensearchdescription)/) { |
102 |
if ($format =~ /(rss|atom|opensearchdescription)/) { |
103 |
$template_name = 'opac-opensearch.tmpl'; |
103 |
$template_name = 'opac-opensearch.tmpl'; |
104 |
} |
104 |
} |
105 |
elsif (@params && $build_grouped_results) { |
105 |
elsif ((@params || @searchCategories) && $build_grouped_results) { |
106 |
$template_name = 'opac-results-grouped.tmpl'; |
106 |
$template_name = 'opac-results-grouped.tmpl'; |
107 |
} |
107 |
} |
108 |
elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { |
108 |
elsif (((@params>=1) || (@searchCategories>=1)) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { |
109 |
$template_name = 'opac-results.tmpl'; |
109 |
$template_name = 'opac-results.tmpl'; |
110 |
} |
110 |
} |
111 |
else { |
111 |
else { |
Lines 202-208
my $languages_limit_loop = getAllLanguages($lang);
Link Here
|
202 |
$template->param(search_languages_loop => $languages_limit_loop,); |
202 |
$template->param(search_languages_loop => $languages_limit_loop,); |
203 |
|
203 |
|
204 |
# load the Type stuff |
204 |
# load the Type stuff |
205 |
my $itemtypes = GetItemTypes; |
205 |
my $itemtypes = GetItemTypesCategorized; |
206 |
# the index parameter is different for item-level itemtypes |
206 |
# the index parameter is different for item-level itemtypes |
207 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
207 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
208 |
my @advancedsearchesloop; |
208 |
my @advancedsearchesloop; |
Lines 220-227
foreach my $advanced_srch_type (@advanced_search_types) {
Link Here
|
220 |
code => $thisitemtype, |
220 |
code => $thisitemtype, |
221 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
221 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
222 |
imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ), |
222 |
imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ), |
|
|
223 |
cat => $itemtypes->{$thisitemtype}->{'iscat'}, |
224 |
hideinopac => $itemtypes->{$thisitemtype}->{'hideinopac'}, |
225 |
searchcategory => $itemtypes->{$thisitemtype}->{'searchcategory'}, |
223 |
); |
226 |
); |
|
|
227 |
if ( !$itemtypes->{$thisitemtype}->{'hideinopac'} ) { |
224 |
push @itypesloop, \%row; |
228 |
push @itypesloop, \%row; |
|
|
229 |
} |
225 |
} |
230 |
} |
226 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
231 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
227 |
code_loop => \@itypesloop ); |
232 |
code_loop => \@itypesloop ); |
Lines 236-241
foreach my $advanced_srch_type (@advanced_search_types) {
Link Here
|
236 |
ccl => $advanced_srch_type, |
241 |
ccl => $advanced_srch_type, |
237 |
code => $thisitemtype->{authorised_value}, |
242 |
code => $thisitemtype->{authorised_value}, |
238 |
description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, |
243 |
description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, |
|
|
244 |
searchcategory => $itemtypes->{$thisitemtype}->{'searchcategory'}, |
239 |
imageurl => getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ), |
245 |
imageurl => getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ), |
240 |
); |
246 |
); |
241 |
push @authvalueloop, \%row; |
247 |
push @authvalueloop, \%row; |
Lines 400-405
if ($operands[0] && !$operands[1]) {
Link Here
|
400 |
|
406 |
|
401 |
# limits are use to limit to results to a pre-defined category such as branch or language |
407 |
# limits are use to limit to results to a pre-defined category such as branch or language |
402 |
my @limits = $cgi->param('limit'); |
408 |
my @limits = $cgi->param('limit'); |
|
|
409 |
|
410 |
if (@searchCategories > 0) { |
411 |
my @tabcat; |
412 |
foreach my $typecategory (@searchCategories) { |
413 |
push (@tabcat, GetItemTypesByCategory($typecategory)); |
414 |
} |
415 |
|
416 |
foreach my $itemtypeInCategory (@tabcat) { |
417 |
push (@limits, "mc-$itype_or_itemtype,phr:".$itemtypeInCategory); |
418 |
} |
419 |
} |
420 |
|
403 |
@limits = map { uri_unescape($_) } @limits; |
421 |
@limits = map { uri_unescape($_) } @limits; |
404 |
|
422 |
|
405 |
if($params->{'multibranchlimit'}) { |
423 |
if($params->{'multibranchlimit'}) { |
406 |
- |
|
|