@@ -, +, @@ --- C4/Members/AttributeTypes.pm | 43 +++++++++++++++++++++++++++---------------- admin/patron-attr-types.pl | 17 +++++++++-------- opac/opac-memberentry.pl | 5 +++-- 3 files changed, 39 insertions(+), 26 deletions(-) --- a/C4/Members/AttributeTypes.pm +++ a/C4/Members/AttributeTypes.pm @@ -215,23 +215,34 @@ sub store { WHERE code = ?"); } else { $sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types - (description, repeatable, unique_id, opac_display, opac_editable, - staff_searchable, authorised_value_category, display_checkout, category_code, class, code) - VALUES (?, ?, ?, ?, ?, - ?, ?, ?, ?, ?, ?)"); + ( description, + repeatable, + unique_id, + opac_display, + opac_editable, + staff_searchable, + authorised_value_category, + display_checkout, + category_code, + class, + code + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); } - $sth->bind_param(1, $self->{'description'}); - $sth->bind_param(2, $self->{'repeatable'}); - $sth->bind_param(3, $self->{'unique_id'}); - $sth->bind_param(4, $self->{'opac_display'}); - $sth->bind_param(5, $self->{'opac_editable'}); - $sth->bind_param(7, $self->{'staff_searchable'}); - $sth->bind_param(8, $self->{'authorised_value_category'}); - $sth->bind_param(9, $self->{'display_checkout'}); - $sth->bind_param(10, $self->{'category_code'} || undef); - $sth->bind_param(11, $self->{'class'}); - $sth->bind_param(12, $self->{'code'}); - $sth->execute; + + $sth->execute( + $self->{'description'}, + $self->{'repeatable'}, + $self->{'unique_id'}, + $self->{'opac_display'}, + $self->{'opac_editable'}, + $self->{'staff_searchable'} || 0, + $self->{'authorised_value_category'}, + $self->{'display_checkout'}, + $self->{'category_code'} || undef, + $self->{'class'}, + $self->{'code'} + ); if ( defined $$self{branches} ) { $sth = $dbh->prepare("DELETE FROM borrower_attribute_types_branches WHERE bat_code = ?"); --- a/admin/patron-attr-types.pl +++ a/admin/patron-attr-types.pl @@ -40,14 +40,15 @@ our $input = new CGI; my $op = $input->param('op') || ''; -our ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "admin/patron-attr-types.tt", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => {parameters => 'parameters_remaining_permissions'}, - debug => 1, - }); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "admin/patron-attr-types.tt", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { parameters => 'parameters_remaining_permissions' } + } +); + $template->param(script_name => $script_name); --- a/opac/opac-memberentry.pl +++ a/opac/opac-memberentry.pl @@ -23,7 +23,6 @@ use List::MoreUtils qw( each_array uniq ); use String::Random qw( random_string ); use C4::Auth; -use C4::Koha qw( GetAuthorisedValueByCode ); use C4::Output; use C4::Members; use C4::Form::MessagingPreferences; @@ -513,7 +512,9 @@ sub GeneratePatronAttributesForm { foreach my $class (@classes) { next unless ( $items_by_class{$class} ); - my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class, 1 ) || $class; + my $av = Koha::AuthorisedValues->search({ category => 'PA_CLASS', authorised_value => $class }); + my $lib = $av->count ? $av->next->opac_description : $class; + push @class_loop, { class => $class, items => $items_by_class{$class}, --