|
Lines 95-111
my ($template,$borrowernumber,$cookie);
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 205-211
my $languages_limit_loop = getLanguages($lang, 1);
Link Here
|
| 205 |
$template->param(search_languages_loop => $languages_limit_loop,); |
205 |
$template->param(search_languages_loop => $languages_limit_loop,); |
| 206 |
|
206 |
|
| 207 |
# load the Type stuff |
207 |
# load the Type stuff |
| 208 |
my $itemtypes = GetItemTypes; |
208 |
my $itemtypes = GetItemTypesCategorized; |
| 209 |
# the index parameter is different for item-level itemtypes |
209 |
# the index parameter is different for item-level itemtypes |
| 210 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
210 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
| 211 |
my @advancedsearchesloop; |
211 |
my @advancedsearchesloop; |
|
Lines 223-230
foreach my $advanced_srch_type (@advanced_search_types) {
Link Here
|
| 223 |
code => $thisitemtype, |
223 |
code => $thisitemtype, |
| 224 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
224 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
| 225 |
imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ), |
225 |
imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ), |
|
|
226 |
cat => $itemtypes->{$thisitemtype}->{'iscat'}, |
| 227 |
hideinopac => $itemtypes->{$thisitemtype}->{'hideinopac'}, |
| 228 |
searchcategory => $itemtypes->{$thisitemtype}->{'searchcategory'}, |
| 226 |
); |
229 |
); |
| 227 |
push @itypesloop, \%row; |
230 |
if ( !$itemtypes->{$thisitemtype}->{'hideinopac'} ) { |
|
|
231 |
push @itypesloop, \%row; |
| 232 |
} |
| 228 |
} |
233 |
} |
| 229 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
234 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
| 230 |
code_loop => \@itypesloop ); |
235 |
code_loop => \@itypesloop ); |
|
Lines 239-244
foreach my $advanced_srch_type (@advanced_search_types) {
Link Here
|
| 239 |
ccl => $advanced_srch_type, |
244 |
ccl => $advanced_srch_type, |
| 240 |
code => $thisitemtype->{authorised_value}, |
245 |
code => $thisitemtype->{authorised_value}, |
| 241 |
description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, |
246 |
description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, |
|
|
247 |
searchcategory => $itemtypes->{$thisitemtype}->{'searchcategory'}, |
| 242 |
imageurl => getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ), |
248 |
imageurl => getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ), |
| 243 |
); |
249 |
); |
| 244 |
push @authvalueloop, \%row; |
250 |
push @authvalueloop, \%row; |
|
Lines 406-411
my @limits = $cgi->param('limit');
Link Here
|
| 406 |
my @nolimits = $cgi->param('nolimit'); |
412 |
my @nolimits = $cgi->param('nolimit'); |
| 407 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
413 |
my %is_nolimit = map { $_ => 1 } @nolimits; |
| 408 |
@limits = grep { not $is_nolimit{$_} } @limits; |
414 |
@limits = grep { not $is_nolimit{$_} } @limits; |
|
|
415 |
|
| 416 |
if (@searchCategories > 0) { |
| 417 |
my @tabcat; |
| 418 |
foreach my $typecategory (@searchCategories) { |
| 419 |
push (@tabcat, GetItemTypesByCategory($typecategory)); |
| 420 |
} |
| 421 |
|
| 422 |
foreach my $itemtypeInCategory (@tabcat) { |
| 423 |
push (@limits, "mc-$itype_or_itemtype,phr:".$itemtypeInCategory); |
| 424 |
} |
| 425 |
} |
| 426 |
|
| 409 |
@limits = map { uri_unescape($_) } @limits; |
427 |
@limits = map { uri_unescape($_) } @limits; |
| 410 |
|
428 |
|
| 411 |
if($params->{'multibranchlimit'}) { |
429 |
if($params->{'multibranchlimit'}) { |