Lines 199-249
else {
Link Here
|
199 |
authnotrequired => 0, |
199 |
authnotrequired => 0, |
200 |
flagsrequired => {catalogue => 1, serials => '*'}, |
200 |
flagsrequired => {catalogue => 1, serials => '*'}, |
201 |
debug => 1, |
201 |
debug => 1, |
202 |
}); |
202 |
}); |
203 |
# load the itemtypes |
203 |
# load the Type stuff |
204 |
my $itemtypes = GetItemTypes; |
204 |
my $itemtypes = GetItemTypes; |
205 |
my @itemtypesloop; |
205 |
my @advancedsearchesloop; |
206 |
if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { |
206 |
my $selected=1; |
207 |
# load the itemtypes |
207 |
|
208 |
my $itemtypes = GetItemTypes; |
208 |
my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; |
209 |
my $selected=1; |
209 |
my @advanced_search_types = split(/\|/, $advanced_search_types); |
210 |
my $cnt; |
210 |
|
211 |
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { |
211 |
foreach my $advanced_srch_type (@advanced_search_types) { |
212 |
my %row =( |
212 |
if ($advanced_srch_type eq 'itemtypes') { |
213 |
code => $thisitemtype, |
213 |
# itemtype is a special case, since it's not defined in authorized values |
214 |
selected => $selected, |
214 |
my @itypesloop; |
215 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
215 |
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { |
216 |
); |
216 |
my %row =( |
217 |
$selected = 0 if ($selected) ; |
217 |
code => $thisitemtype, |
218 |
push @itemtypesloop, \%row; |
218 |
selected => $selected, |
219 |
} |
219 |
description => $itemtypes->{$thisitemtype}->{'description'}, |
220 |
|
220 |
); |
221 |
|
221 |
$selected = 0 if ($selected); |
222 |
} else { |
222 |
push @itypesloop, \%row; |
223 |
my $advsearchtypes = GetAuthorisedValues($advanced_search_types); |
223 |
} |
224 |
my $cnt; |
224 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
225 |
my $selected=1; |
225 |
code_loop => \@itypesloop ); |
226 |
for my $thisitemtype (sort {$a->{'lib'} cmp $b->{'lib'}} @$advsearchtypes) { |
226 |
push @advancedsearchesloop, \%search_code; |
227 |
my %row =( |
227 |
} else { |
228 |
number=>$cnt++, |
228 |
# covers all the other cases: non-itemtype authorized values |
229 |
ccl => $advanced_search_types, |
229 |
my $advsearchtypes = GetAuthorisedValues($advanced_srch_type); |
230 |
code => $thisitemtype->{authorised_value}, |
230 |
my @authvalueloop; |
231 |
selected => $selected, |
231 |
for my $thisitemtype (@$advsearchtypes) { |
232 |
description => $thisitemtype->{'lib'}, |
232 |
my %row =( |
233 |
count5 => $cnt % 4, |
233 |
code => $thisitemtype->{authorised_value}, |
234 |
imageurl=> getitemtypeimagelocation( 'intranet', $thisitemtype->{'imageurl'} ), |
234 |
description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'}, |
235 |
); |
235 |
); |
236 |
push @itemtypesloop, \%row; |
236 |
push @authvalueloop, \%row; |
237 |
} |
237 |
} |
|
|
238 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
239 |
code_loop => \@authvalueloop ); |
240 |
push @advancedsearchesloop, \%search_code; |
241 |
} |
238 |
} |
242 |
} |
239 |
|
|
|
240 |
|
241 |
if ($op eq "do_search") { |
243 |
if ($op eq "do_search") { |
242 |
$template->param("no_query" => 1); |
244 |
$template->param("no_query" => 1); |
243 |
} else { |
245 |
} else { |
244 |
$template->param("no_query" => 0); |
246 |
$template->param("no_query" => 0); |
245 |
} |
247 |
} |
246 |
$template->param(itemtypeloop => \@itemtypesloop); |
248 |
$template->param(advancedsearchesloop => \@advancedsearchesloop); |
247 |
} |
249 |
} |
248 |
# Print the page |
250 |
# Print the page |
249 |
output_html_with_http_headers $input, $cookie, $template->output; |
251 |
output_html_with_http_headers $input, $cookie, $template->output; |
250 |
- |
|
|