Lines 2182-2198
sub extended_attributes {
Link Here
|
2182 |
} |
2182 |
} |
2183 |
|
2183 |
|
2184 |
# Check globally mandatory types |
2184 |
# Check globally mandatory types |
2185 |
my @required_attribute_types = |
2185 |
my $interface = C4::Context->interface; |
2186 |
Koha::Patron::Attribute::Types->search( |
2186 |
my $params = { |
2187 |
{ |
2187 |
mandatory => 1, |
2188 |
mandatory => 1, |
2188 |
category_code => [ undef, $self->categorycode ], |
2189 |
category_code => [ undef, $self->categorycode ], |
2189 |
'borrower_attribute_types_branches.b_branchcode' => undef, |
2190 |
'borrower_attribute_types_branches.b_branchcode' => |
2190 |
}; |
2191 |
undef, |
2191 |
|
2192 |
}, |
2192 |
if ( $interface eq 'opac' ) { |
2193 |
{ join => 'borrower_attribute_types_branches' } |
2193 |
$params->{opac_editable} = 1; |
2194 |
)->get_column('code'); |
2194 |
} |
2195 |
for my $type ( @required_attribute_types ) { |
2195 |
|
|
|
2196 |
my @required_attribute_types = Koha::Patron::Attribute::Types->search( |
2197 |
$params, |
2198 |
{ join => 'borrower_attribute_types_branches' } |
2199 |
)->get_column('code'); |
2200 |
for my $type (@required_attribute_types) { |
2196 |
Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( |
2201 |
Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( |
2197 |
type => $type, |
2202 |
type => $type, |
2198 |
) if !$new_types->{$type}; |
2203 |
) if !$new_types->{$type}; |
2199 |
- |
|
|