Lines 668-704
if(!defined($data{'sex'})){
Link Here
|
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 @typeloop; |
671 |
my $no_categories = 1; |
671 |
my $categories_limits = { category_type => [qw(C A S P I X) ] }; |
672 |
my $no_add; |
672 |
$categories_limits->{canbeguarantee} = 1 if ($guarantor_id); |
673 |
foreach my $category_type (qw(C A S P I X)) { |
673 |
my $patron_categories = Koha::Patron::Categories->search_with_library_limits( |
674 |
my $categories_limits = { category_type => $category_type }; |
674 |
{ |
675 |
$categories_limits->{canbeguarantee} = 1 if ($guarantor_id); |
675 |
category_type => [qw(C A S P I X)], |
676 |
my $patron_categories = Koha::Patron::Categories->search_with_library_limits( $categories_limits, {order_by => ['categorycode']} ); |
676 |
( $guarantor_id ? ( canbeguarantee => 1 ) : () ) |
677 |
$no_categories = 0 if $patron_categories->count > 0; |
677 |
}, |
678 |
|
678 |
{ order_by => ['categorycode'] } |
679 |
my @categoryloop; |
679 |
); |
680 |
while ( my $patron_category = $patron_categories->next ) { |
680 |
my $no_categories = ! $patron_categories->count; |
681 |
push @categoryloop, |
681 |
my $categories = {}; |
682 |
{ 'categorycode' => $patron_category->categorycode, |
682 |
foreach my $patron_category ($patron_categories->as_list ) { |
683 |
'categoryname' => $patron_category->description, |
683 |
push @{ $categories->{ $patron_category->category_type } }, $patron_category; |
684 |
'effective_min_password_length' => $patron_category->effective_min_password_length, |
|
|
685 |
'effective_require_strong_password' => $patron_category->effective_require_strong_password, |
686 |
'categorycodeselected' => |
687 |
( defined($categorycode) && $patron_category->categorycode eq $categorycode ), |
688 |
}; |
689 |
} |
690 |
my %typehash; |
691 |
$typehash{'typename'} = $category_type; |
692 |
my $typedescription = "typename_" . $typehash{'typename'}; |
693 |
$typehash{'categoryloop'} = \@categoryloop; |
694 |
push @typeloop, |
695 |
{ 'typename' => $category_type, |
696 |
$typedescription => 1, |
697 |
'categoryloop' => \@categoryloop |
698 |
}; |
699 |
} |
684 |
} |
|
|
685 |
|
700 |
$template->param( |
686 |
$template->param( |
701 |
typeloop => \@typeloop, |
687 |
patron_categories => $categories, |
702 |
no_categories => $no_categories, |
688 |
no_categories => $no_categories, |
703 |
); |
689 |
); |
704 |
|
690 |
|
Lines 760-765
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' ||
Link Here
|
760 |
} |
746 |
} |
761 |
$template->param( userbranch => $userbranch ); |
747 |
$template->param( userbranch => $userbranch ); |
762 |
|
748 |
|
|
|
749 |
my $no_add; |
763 |
if ( Koha::Libraries->search->count < 1 ){ |
750 |
if ( Koha::Libraries->search->count < 1 ){ |
764 |
$no_add = 1; |
751 |
$no_add = 1; |
765 |
$template->param(no_branches => 1); |
752 |
$template->param(no_branches => 1); |
766 |
- |
|
|