|
Lines 49-59
my $theme = $input->param('theme') || "default";
Link Here
|
| 49 |
|
49 |
|
| 50 |
my $patron = $input->Vars; |
50 |
my $patron = $input->Vars; |
| 51 |
foreach (keys %$patron){ |
51 |
foreach (keys %$patron){ |
| 52 |
delete $$patron{$_} unless($$patron{$_}); |
52 |
delete $$patron{$_} unless($$patron{$_}); |
| 53 |
} |
53 |
} |
| 54 |
|
|
|
| 55 |
my @categories=C4::Category->all; |
54 |
my @categories=C4::Category->all; |
| 56 |
my $branches=(defined $$patron{branchcode}?GetBranchesLoop($$patron{branchcode}):GetBranchesLoop()); |
55 |
|
|
|
56 |
my $branches = GetBranches; |
| 57 |
my @branchloop; |
| 58 |
|
| 59 |
foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { |
| 60 |
my $selected = 1 if $branches->{$_}->{branchcode} eq $$patron{branchcode}; |
| 61 |
my %row = ( value => $_, |
| 62 |
selected => $selected, |
| 63 |
branchname => $branches->{$_}->{branchname}, |
| 64 |
); |
| 65 |
push @branchloop, \%row; |
| 66 |
} |
| 57 |
|
67 |
|
| 58 |
my %categories_dislay; |
68 |
my %categories_dislay; |
| 59 |
|
69 |
|
|
Lines 119-129
foreach my $borrower(@$results[$from..$to-1]){
Link Here
|
| 119 |
push(@resultsdata, \%row); |
129 |
push(@resultsdata, \%row); |
| 120 |
} |
130 |
} |
| 121 |
|
131 |
|
| 122 |
if ($$patron{branchcode}){ |
|
|
| 123 |
foreach my $branch (grep{$_->{value} eq $$patron{branchcode}}@$branches){ |
| 124 |
$$branch{selected}=1; |
| 125 |
} |
| 126 |
} |
| 127 |
if ($$patron{categorycode}){ |
132 |
if ($$patron{categorycode}){ |
| 128 |
foreach my $category (grep{$_->{categorycode} eq $$patron{categorycode}}@categories){ |
133 |
foreach my $category (grep{$_->{categorycode} eq $$patron{categorycode}}@categories){ |
| 129 |
$$category{selected}=1; |
134 |
$$category{selected}=1; |
|
Lines 142-150
my $base_url =
Link Here
|
| 142 |
); |
147 |
); |
| 143 |
|
148 |
|
| 144 |
my @letters = map { {letter => $_} } ( 'A' .. 'Z'); |
149 |
my @letters = map { {letter => $_} } ( 'A' .. 'Z'); |
| 145 |
$template->param( letters => \@letters ); |
|
|
| 146 |
|
150 |
|
| 147 |
$template->param( |
151 |
$template->param( |
|
|
152 |
letters => \@letters, |
| 148 |
paginationbar => pagination_bar( |
153 |
paginationbar => pagination_bar( |
| 149 |
$base_url, |
154 |
$base_url, |
| 150 |
int( $count / $resultsperpage ) + ($count % $resultsperpage ? 1 : 0), |
155 |
int( $count / $resultsperpage ) + ($count % $resultsperpage ? 1 : 0), |
|
Lines 154-168
$template->param(
Link Here
|
| 154 |
from => ($startfrom-1)*$resultsperpage+1, |
159 |
from => ($startfrom-1)*$resultsperpage+1, |
| 155 |
to => $to, |
160 |
to => $to, |
| 156 |
multipage => ($count != $to+1 || $startfrom!=1), |
161 |
multipage => ($count != $to+1 || $startfrom!=1), |
| 157 |
); |
162 |
advsearch => ($$patron{categorycode} || $$patron{branchcode}), |
| 158 |
$template->param( |
163 |
branchloop=>\@branchloop, |
| 159 |
branchloop=>$branches, |
|
|
| 160 |
categories=>\@categories, |
164 |
categories=>\@categories, |
| 161 |
); |
165 |
searching => "1", |
| 162 |
|
|
|
| 163 |
|
| 164 |
$template->param( |
| 165 |
searching => "1", |
| 166 |
actionname =>basename($0), |
166 |
actionname =>basename($0), |
| 167 |
%$patron, |
167 |
%$patron, |
| 168 |
numresults => $count, |
168 |
numresults => $count, |