- delete $$patron{$_} unless($$patron{$_});
-}
-my @categories=C4::Category->all;
-
-my $branches = GetBranches;
-my @branchloop;
-
-foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
- my $selected;
- $selected = 1 if $branches->{$_}->{branchcode} eq $$patron{branchcode};
- my %row = ( value => $_,
- selected => $selected,
- branchname => $branches->{$_}->{branchname},
- );
- push @branchloop, \%row;
-}
-
-my %categories_dislay;
-
-foreach my $category (@categories){
- my $hash={
- category_description=>$$category{description},
- category_type=>$$category{category_type}
- };
- $categories_dislay{$$category{categorycode}} = $hash;
-}
-my $AddPatronLists = C4::Context->preference("AddPatronLists") || '';
-$template->param(
- "AddPatronLists_$AddPatronLists" => "1",
- );
-if ($AddPatronLists=~/code/){
- $categories[0]->{'first'}=1;
-}
-
-my $member=$input->param('member');
-my $orderbyparams=$input->param('orderby');
-my @orderby;
-if ($orderbyparams){
- my @orderbyelt=split(/,/,$orderbyparams);
- push @orderby, {$orderbyelt[0]=>$orderbyelt[1]||0};
-}
-else {
- @orderby = ({surname=>0},{firstname=>0});