Lines 312-361
if ( $template_type && $template_type eq 'advsearch' ) {
Link Here
|
312 |
$template->param( sort_by => $default_sort_by ); |
312 |
$template->param( sort_by => $default_sort_by ); |
313 |
} |
313 |
} |
314 |
|
314 |
|
315 |
# determine what to display next to the search boxes (ie, boolean option |
|
|
316 |
# shouldn't appear on the first one, scan indexes should, adding a new |
317 |
# box should only appear on the last, etc. |
318 |
my @search_boxes_array; |
319 |
my $search_boxes_count = 3; # begin with 3 boxes |
320 |
$template->param( search_boxes_count => $search_boxes_count ); |
321 |
|
322 |
if ($cgi->cookie("num_paragraph")){ |
323 |
$search_boxes_count = $cgi->cookie("num_paragraph"); |
324 |
} |
325 |
|
326 |
for (my $i=1;$i<=$search_boxes_count;$i++) { |
327 |
# if it's the first one, don't display boolean option, but show scan indexes |
328 |
if ($i==1) { |
329 |
push @search_boxes_array, |
330 |
{ |
331 |
scan_index => 1, |
332 |
}; |
333 |
|
334 |
} |
335 |
# if it's the last one, show the 'add field' box |
336 |
elsif ($i==$search_boxes_count) { |
337 |
push @search_boxes_array, |
338 |
{ |
339 |
boolean => 1, |
340 |
add_field => 1, |
341 |
}; |
342 |
} |
343 |
else { |
344 |
push @search_boxes_array, |
345 |
{ |
346 |
boolean => 1, |
347 |
}; |
348 |
} |
349 |
|
350 |
} |
351 |
|
352 |
my @advsearch_limits = split /,/, C4::Context->preference('OpacAdvSearchOptions'); |
315 |
my @advsearch_limits = split /,/, C4::Context->preference('OpacAdvSearchOptions'); |
353 |
my @advsearch_more_limits = split /,/, |
316 |
my @advsearch_more_limits = split /,/, |
354 |
C4::Context->preference('OpacAdvSearchMoreOptions'); |
317 |
C4::Context->preference('OpacAdvSearchMoreOptions'); |
355 |
$template->param( |
318 |
$template->param( |
356 |
uc( C4::Context->preference("marcflavour") ) => 1, # we already did this for UNIMARC |
319 |
uc( C4::Context->preference("marcflavour") ) => 1, # we already did this for UNIMARC |
357 |
advsearch => 1, |
320 |
advsearch => 1, |
358 |
search_boxes_loop => \@search_boxes_array, |
|
|
359 |
OpacAdvSearchOptions => \@advsearch_limits, |
321 |
OpacAdvSearchOptions => \@advsearch_limits, |
360 |
OpacAdvSearchMoreOptions => \@advsearch_more_limits, |
322 |
OpacAdvSearchMoreOptions => \@advsearch_more_limits, |
361 |
); |
323 |
); |
362 |
- |
|
|