Lines 667-705
if(!defined($data{'sex'})){
Link Here
|
667 |
|
667 |
|
668 |
##Now all the data to modify a member. |
668 |
##Now all the data to modify a member. |
669 |
|
669 |
|
670 |
my @typeloop; |
670 |
my $patron_categories = Koha::Patron::Categories->search_with_library_limits( |
671 |
my $no_categories = 1; |
671 |
{ |
672 |
my $no_add; |
672 |
category_type => [qw(C A S P I X)], |
673 |
foreach my $category_type (qw(C A S P I X)) { |
673 |
( $guarantor_id ? ( can_be_guarantee => 1 ) : () ) |
674 |
my $categories_limits = { category_type => $category_type }; |
674 |
}, |
675 |
$categories_limits->{can_be_guarantee} = 1 if ($guarantor_id); |
675 |
{ order_by => ['categorycode'] } |
676 |
my $patron_categories = Koha::Patron::Categories->search_with_library_limits( $categories_limits, {order_by => ['categorycode']} ); |
676 |
); |
677 |
$no_categories = 0 if $patron_categories->count > 0; |
677 |
my $no_categories = ! $patron_categories->count; |
678 |
|
678 |
my $categories = {}; |
679 |
my @categoryloop; |
679 |
foreach my $patron_category ($patron_categories->as_list ) { |
680 |
while ( my $patron_category = $patron_categories->next ) { |
680 |
push @{ $categories->{ $patron_category->category_type } }, $patron_category; |
681 |
$categorycode = $patron_category->categorycode unless defined($categorycode); #If none passed in, select the first |
|
|
682 |
push @categoryloop, |
683 |
{ 'categorycode' => $patron_category->categorycode, |
684 |
'categoryname' => $patron_category->description, |
685 |
'effective_min_password_length' => $patron_category->effective_min_password_length, |
686 |
'effective_require_strong_password' => $patron_category->effective_require_strong_password, |
687 |
'categorycodeselected' => |
688 |
( $patron_category->categorycode eq $categorycode ), |
689 |
}; |
690 |
} |
691 |
my %typehash; |
692 |
$typehash{'typename'} = $category_type; |
693 |
my $typedescription = "typename_" . $typehash{'typename'}; |
694 |
$typehash{'categoryloop'} = \@categoryloop; |
695 |
push @typeloop, |
696 |
{ 'typename' => $category_type, |
697 |
$typedescription => 1, |
698 |
'categoryloop' => \@categoryloop |
699 |
}; |
700 |
} |
681 |
} |
|
|
682 |
|
701 |
$template->param( |
683 |
$template->param( |
702 |
typeloop => \@typeloop, |
684 |
patron_categories => $categories, |
703 |
no_categories => $no_categories, |
685 |
no_categories => $no_categories, |
704 |
); |
686 |
); |
705 |
|
687 |
|
Lines 761-766
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' ||
Link Here
|
761 |
} |
743 |
} |
762 |
$template->param( userbranch => $userbranch ); |
744 |
$template->param( userbranch => $userbranch ); |
763 |
|
745 |
|
|
|
746 |
my $no_add; |
764 |
if ( Koha::Libraries->search->count < 1 ){ |
747 |
if ( Koha::Libraries->search->count < 1 ){ |
765 |
$no_add = 1; |
748 |
$no_add = 1; |
766 |
$template->param(no_branches => 1); |
749 |
$template->param(no_branches => 1); |
767 |
- |
|
|