@@ -, +, @@
another library
---
.../prog/en/modules/members/memberentrygen.tt | 14 +++++++++++---
members/memberentry.pl | 8 +++++++-
2 files changed, 18 insertions(+), 4 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
@@ -1004,8 +1004,15 @@
[% END %]
[% FOREACH patron_attribute IN pa_loo.items %]
- -
-
+ [% IF patron_attribute.limited_to_another_branch %]
+
+
+ [% IF patron_attribute.password_allowed %]
+
+ [% END %]
+ [% ELSE %]
+
-
+
[% IF ( patron_attribute.use_dropdown ) %]
+
+ [% END %]
[% END %]
[% IF pa_loo.class %][% END %]
--- a/members/memberentry.pl
+++ a/members/memberentry.pl
@@ -745,7 +745,7 @@ sub patron_attributes_form {
my $template = shift;
my $borrowernumber = shift;
- my @types = C4::Members::AttributeTypes::GetAttributeTypes();
+ my @types = C4::Members::AttributeTypes::GetAttributeTypes(1, 1);
if (scalar(@types) == 0) {
$template->param(no_patron_attribute_types => 1);
return;
@@ -763,8 +763,13 @@ sub patron_attributes_form {
my @attribute_loop = ();
my $i = 0;
my %items_by_class;
+ my $user_branch = C4::Context->userenv->{"branch"};
foreach my $type_code (map { $_->{code} } @types) {
my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
+ my $limited_to_another_branch = 0;
+ if ( my $branch_limitations = $attr_type->branches ) {
+ $limited_to_another_branch = not grep { /^$user_branch$/ } @$branch_limitations;
+ }
my $entry = {
class => $attr_type->class(),
code => $attr_type->code(),
@@ -774,6 +779,7 @@ sub patron_attributes_form {
category => $attr_type->authorised_value_category(),
category_code => $attr_type->category_code(),
password => '',
+ limited_to_another_branch => $limited_to_another_branch,
};
if (exists $attr_hash{$attr_type->code()}) {
foreach my $attr (@{ $attr_hash{$attr_type->code()} }) {
--