Lines 59-68
my ($template, $borrowernumber, $cookie)
Link Here
|
59 |
}); |
59 |
}); |
60 |
my $dbh = C4::Context->dbh; |
60 |
my $dbh = C4::Context->dbh; |
61 |
# Displaying results |
61 |
# Displaying results |
|
|
62 |
my $do_it = $input->param('do_it') || 0; # as form been posted |
62 |
my $limit = $input->param('limit'); |
63 |
my $limit = $input->param('limit'); |
63 |
$limit = 10 unless ($limit && $limit =~ /^\d+$/); # control user input for SQL query |
64 |
$limit = 10 unless ($limit && $limit =~ /^\d+$/); # control user input for SQL query |
64 |
$limit = 100 if $limit > 100; |
65 |
$limit = 100 if $limit > 100; |
65 |
my $branch = $input->param('branch') || ''; |
66 |
my $branch = $input->param('branch') || ''; |
|
|
67 |
if (!$do_it && C4::Context->userenv && C4::Context->userenv->{'branch'} ) { |
68 |
$branch = C4::Context->userenv->{'branch'}; # select user branch by default |
69 |
} |
66 |
my $itemtype = $input->param('itemtype') || ''; |
70 |
my $itemtype = $input->param('itemtype') || ''; |
67 |
my $timeLimit = $input->param('timeLimit') || 3; |
71 |
my $timeLimit = $input->param('timeLimit') || 3; |
68 |
my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); |
72 |
my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); |
Lines 138-144
$template->param(do_it => 1,
Link Here
|
138 |
results_loop => \@results, |
142 |
results_loop => \@results, |
139 |
); |
143 |
); |
140 |
|
144 |
|
141 |
$template->param( branchloop => GetBranchesLoop(C4::Context->userenv?C4::Context->userenv->{'branch'}:'')); |
145 |
$template->param( branchloop => GetBranchesLoop($branch)); |
142 |
|
146 |
|
143 |
# the index parameter is different for item-level itemtypes |
147 |
# the index parameter is different for item-level itemtypes |
144 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
148 |
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; |
145 |
- |
|
|