View | Details | Raw Unified | Return to bug 39971
Collapse All | Expand All

(-)a/Koha/Patron/Attribute/Types.pm (-2 / +3 lines)
Lines 42-47 Params: Link Here
42
    $template   - The template object to be populated with patron attributes.
42
    $template   - The template object to be populated with patron attributes.
43
    $attributes - Arrayref of hashrefs containing patron attribute data.
43
    $attributes - Arrayref of hashrefs containing patron attribute data.
44
    $op         - Operation type, such as 'duplicate', used to handle unique attributes.
44
    $op         - Operation type, such as 'duplicate', used to handle unique attributes.
45
    $query      - Query to filter attributes e.g. { mandatory => 1 }.
45
46
46
=cut
47
=cut
47
48
Lines 49-57 sub patron_attributes_form { Link Here
49
    my $template   = shift;
50
    my $template   = shift;
50
    my $attributes = shift;
51
    my $attributes = shift;
51
    my $op         = shift;
52
    my $op         = shift;
53
    my $query      = shift // {};
52
54
53
    my $library_id      = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
55
    my $library_id      = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
54
    my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits( {}, {}, $library_id );
56
    my $attribute_types = Koha::Patron::Attribute::Types->search_with_library_limits( $query, {}, $library_id );
55
    if ( $attribute_types->count == 0 ) {
57
    if ( $attribute_types->count == 0 ) {
56
        $template->param( no_patron_attribute_types => 1 );
58
        $template->param( no_patron_attribute_types => 1 );
57
        return;
59
        return;
58
- 

Return to bug 39971