Lines 745-751
sub patron_attributes_form {
Link Here
|
745 |
my $template = shift; |
745 |
my $template = shift; |
746 |
my $borrowernumber = shift; |
746 |
my $borrowernumber = shift; |
747 |
|
747 |
|
748 |
my @types = C4::Members::AttributeTypes::GetAttributeTypes(); |
748 |
my @types = C4::Members::AttributeTypes::GetAttributeTypes(1, 1); |
749 |
if (scalar(@types) == 0) { |
749 |
if (scalar(@types) == 0) { |
750 |
$template->param(no_patron_attribute_types => 1); |
750 |
$template->param(no_patron_attribute_types => 1); |
751 |
return; |
751 |
return; |
Lines 763-770
sub patron_attributes_form {
Link Here
|
763 |
my @attribute_loop = (); |
763 |
my @attribute_loop = (); |
764 |
my $i = 0; |
764 |
my $i = 0; |
765 |
my %items_by_class; |
765 |
my %items_by_class; |
|
|
766 |
my $user_branch = C4::Context->userenv->{"branch"}; |
766 |
foreach my $type_code (map { $_->{code} } @types) { |
767 |
foreach my $type_code (map { $_->{code} } @types) { |
767 |
my $attr_type = C4::Members::AttributeTypes->fetch($type_code); |
768 |
my $attr_type = C4::Members::AttributeTypes->fetch($type_code); |
|
|
769 |
my $limited_to_another_branch = 0; |
770 |
if ( my $branch_limitations = $attr_type->branches ) { |
771 |
$limited_to_another_branch = not grep { /^$user_branch$/ } @$branch_limitations; |
772 |
} |
768 |
my $entry = { |
773 |
my $entry = { |
769 |
class => $attr_type->class(), |
774 |
class => $attr_type->class(), |
770 |
code => $attr_type->code(), |
775 |
code => $attr_type->code(), |
Lines 774-779
sub patron_attributes_form {
Link Here
|
774 |
category => $attr_type->authorised_value_category(), |
779 |
category => $attr_type->authorised_value_category(), |
775 |
category_code => $attr_type->category_code(), |
780 |
category_code => $attr_type->category_code(), |
776 |
password => '', |
781 |
password => '', |
|
|
782 |
limited_to_another_branch => $limited_to_another_branch, |
777 |
}; |
783 |
}; |
778 |
if (exists $attr_hash{$attr_type->code()}) { |
784 |
if (exists $attr_hash{$attr_type->code()}) { |
779 |
foreach my $attr (@{ $attr_hash{$attr_type->code()} }) { |
785 |
foreach my $attr (@{ $attr_hash{$attr_type->code()} }) { |
780 |
- |
|
|