-my $sth = $dbh->prepare($query);
-$sth->execute();
-my @results;
-while (my $line= $sth->fetchrow_hashref) {
- push @results, $line;
-}
-
-my $timeLimitFinite = $timeLimit;
-if($timeLimit eq 999){ $timeLimitFinite = 0 };
-
-$template->param(do_it => 1,
- limit => $limit,
- branch => $branches->{$branch}->{branchname} || 'all locations',
- itemtype => $itemtypes->{$itemtype}->{description} || 'item types',
- timeLimit => $timeLimit,
- timeLimitFinite => $timeLimit,
- results_loop => \@results,
- );
-
-$template->param( branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}));
-
-# the index parameter is different for item-level itemtypes
-my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
-$itemtypes = GetItemTypes;
-my @itemtypesloop;
-my $selected=1;
-if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
- foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
- my $selected = 1 if $thisitemtype eq $itemtype;
- my %row =( value => $thisitemtype,
- description => $itemtypes->{$thisitemtype}->{'description'},
- selected => $selected,
- );
- push @itemtypesloop, \%row;
- }
-} else {
- my $advsearchtypes = GetAuthorisedValues($advanced_search_types, '', 'opac');
- for my $thisitemtype (@$advsearchtypes) {
- my $selected = 1 if $thisitemtype->{authorised_value} eq $itemtype;
- my %row =( value => $thisitemtype->{authorised_value},
- selected => $selected,
- description => $thisitemtype->{'lib'},
- );
- push @itemtypesloop, \%row;
- }
-}