Lines 237-288
$template->param(
Link Here
|
237 |
); |
237 |
); |
238 |
|
238 |
|
239 |
# load the Type stuff |
239 |
# load the Type stuff |
240 |
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; |
|
|
241 |
# the index parameter is different for item-level itemtypes |
242 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
243 |
my @advancedsearchesloop; |
244 |
my $cnt; |
245 |
my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; |
246 |
my @advanced_search_types = split(/\|/, $advanced_search_types); |
247 |
|
248 |
foreach my $advanced_srch_type (@advanced_search_types) { |
249 |
$advanced_srch_type =~ s/^\s*//; |
250 |
$advanced_srch_type =~ s/\s*$//; |
251 |
if ($advanced_srch_type eq 'itemtypes') { |
252 |
# itemtype is a special case, since it's not defined in authorized values |
253 |
my @itypesloop; |
254 |
foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes ) { |
255 |
my %row =( number=>$cnt++, |
256 |
ccl => "$itype_or_itemtype,phr", |
257 |
code => $thisitemtype, |
258 |
description => $itemtypes->{$thisitemtype}->{translated_description}, |
259 |
imageurl=> getitemtypeimagelocation( 'intranet', $itemtypes->{$thisitemtype}->{'imageurl'} ), |
260 |
); |
261 |
push @itypesloop, \%row; |
262 |
} |
263 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
264 |
code_loop => \@itypesloop ); |
265 |
push @advancedsearchesloop, \%search_code; |
266 |
} else { |
267 |
# covers all the other cases: non-itemtype authorized values |
268 |
my $advsearchtypes = GetAuthorisedValues($advanced_srch_type); |
269 |
my @authvalueloop; |
270 |
for my $thisitemtype (@$advsearchtypes) { |
271 |
my %row =( |
272 |
number=>$cnt++, |
273 |
ccl => $advanced_srch_type, |
274 |
code => $thisitemtype->{authorised_value}, |
275 |
description => $thisitemtype->{'lib'}, |
276 |
imageurl => getitemtypeimagelocation( 'intranet', $thisitemtype->{'imageurl'} ), |
277 |
); |
278 |
push @authvalueloop, \%row; |
279 |
} |
280 |
my %search_code = ( advanced_search_type => $advanced_srch_type, |
281 |
code_loop => \@authvalueloop ); |
282 |
push @advancedsearchesloop, \%search_code; |
283 |
} |
284 |
} |
285 |
$template->param(advancedsearchesloop => \@advancedsearchesloop); |
286 |
my $types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; |
240 |
my $types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; |
287 |
my $advancedsearchesloop = prepare_adv_search_types($types); |
241 |
my $advancedsearchesloop = prepare_adv_search_types($types); |
288 |
$template->param(advancedsearchesloop => $advancedsearchesloop); |
242 |
$template->param(advancedsearchesloop => $advancedsearchesloop); |
289 |
- |
|
|