- my $attr_type = C4::Members::AttributeTypes->fetch($code);
-
- $template->param(code => $code);
- $template->param(description => $attr_type->description());
- $template->param(class => $attr_type->class());
-
- if ($attr_type->repeatable()) {
- $template->param(repeatable_checked => 1);
- }
- $template->param(repeatable_disabled => 1);
- if ($attr_type->unique_id()) {
- $template->param(unique_id_checked => 1);
- }
- $template->param(unique_id_disabled => 1);
- if ($attr_type->opac_display()) {
- $template->param(opac_display_checked => 1);
- }
- if ($attr_type->opac_editable()) {
- $template->param(opac_editable_checked => 1);
- }
- if ($attr_type->staff_searchable()) {
- $template->param(staff_searchable_checked => 1);
- }
- if ($attr_type->display_checkout()) {
- $template->param(display_checkout_checked => 'checked="checked"');
- }
- $template->param( authorised_value_category => $attr_type->authorised_value_category() );
- $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
-
- my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
- my @branches_loop;
- my $selected_branches = $attr_type->branches;
- foreach my $branch (@$branches) {
- my $selected = ( grep {$_->{branchcode} eq $branch->{branchcode}} @$selected_branches ) ? 1 : 0;
- push @branches_loop, {
- branchcode => $branch->{branchcode},
- branchname => $branch->{branchname},
- selected => $selected,
- };
- }
- $template->param( branches_loop => \@branches_loop );
-
- $template->param(
- category_code => $attr_type->category_code,
- category_class => $attr_type->class,
- category_description => $attr_type->category_description,
- );