@@ -, +, @@ --- circ/circulation.pl | 10 ++++++++-- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 4 ++-- .../intranet-tmpl/prog/en/includes/circ-menu.tt | 4 ++-- .../prog/en/modules/members/moremember.tt | 10 +++++----- members/boraccount.pl | 10 ++++++++-- members/mancredit.pl | 8 +++++++- members/maninvoice.pl | 9 +++++++-- members/member-flags.pl | 10 ++++++++-- members/member-password.pl | 10 ++++++++-- members/moremember.pl | 9 +++++---- members/notices.pl | 10 ++++++++-- members/pay.pl | 8 +++++++- members/readingrec.pl | 10 ++++++++-- 13 files changed, 83 insertions(+), 29 deletions(-) --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -632,7 +632,14 @@ my $fast_cataloging = 0; if (defined getframeworkinfo('FA')) { $fast_cataloging = 1 } -my $attributes = GetBorrowerAttributes($borrowernumber); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( lib_messages_loop => $lib_messages_loop, @@ -682,7 +689,6 @@ $template->param( circview => 1, soundon => C4::Context->preference("SoundOn"), fast_cataloging => $fast_cataloging, - extendedattributes => $attributes, ); # save stickyduedate to session --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -48,13 +48,13 @@
  • No email stored.
  • [% END %] [% END %] - [% FOREACH extendedattribute IN extendedattributes %] + [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN extendedattributes %] [% IF ( extendedattribute.display_checkout ) %] [% IF ( extendedattribute.value ) %]
  • [% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]
  • [% END %] [% END %] - [% END %] + [% END %][% END %]
  • Category: [% categoryname %] ([% categorycode %])
  • Home Library: [% IF ( branchname ) %][% branchname %][% ELSE %][% branch %][% END %]
  • --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -50,13 +50,13 @@ in the global namespace %]
  • No email stored.
  • [% END %] [% END %] - [% FOREACH extendedattribute IN borrower.extendedattributes %] + [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN borrower.extendedattributes %] [% IF ( extendedattribute.display_checkout ) %] [% IF ( extendedattribute.value ) %]
  • [% extendedattribute.description %] : [% IF ( extendedattribute.value_description ) %][% extendedattribute.value_description %][% ELSE %][% extendedattribute.value %][% END %]
  • [% END %] [% END %] - [% END %] + [% END %][% END %]
  • Category: [% borrower.description %] ([% borrower.categorycode %])
  • Home Library: [% IF ( borrower.branchname ) %][% borrower.branchname %][% ELSE %][% borrower.branch %][% END %]
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -285,12 +285,12 @@ function validate1(date) { Type Value - [% FOREACH patron_attribute IN patron_attributes %] + [% FOREACH extendedattribute IN extendedattributes %] - [% patron_attribute.code %] ([% patron_attribute.description %]) - [% patron_attribute.value %] - [% IF ( patron_attribute.value_description ) %] - ([% patron_attribute.value_description %]) + [% extendedattribute.code %] ([% extendedattribute.description %]) + [% extendedattribute.value %] + [% IF ( extendedattribute.value_description ) %] + ([% extendedattribute.value_description %]) [% END %] --- a/members/boraccount.pl +++ a/members/boraccount.pl @@ -94,7 +94,14 @@ $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); $template->param( picture => 1 ) if $picture; -my $attributes = GetBorrowerAttributes($borrowernumber); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( finesview => 1, @@ -120,7 +127,6 @@ $template->param( is_child => ($data->{'category_type'} eq 'C'), reverse_col => $reverse_col, accounts => $accts, - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/members/mancredit.pl +++ a/members/mancredit.pl @@ -78,7 +78,14 @@ if ($add){ $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' ); my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); $template->param( picture => 1 ) if $picture; + +if (C4::Context->preference('ExtendedPatronAttributes')) { my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( borrowernumber => $borrowernumber, @@ -99,7 +106,6 @@ if ($add){ branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; } --- a/members/maninvoice.pl +++ a/members/maninvoice.pl @@ -106,8 +106,14 @@ if ($add){ $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); $template->param( picture => 1 ) if $picture; - my $attributes = GetBorrowerAttributes($borrowernumber); +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( borrowernumber => $borrowernumber, firstname => $data->{'firstname'}, @@ -127,7 +133,6 @@ if ($add){ branchcode => $data->{'branchcode'}, branchname => GetBranchName($data->{'branchcode'}), is_child => ($data->{'category_type'} eq 'C'), - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; } --- a/members/member-flags.pl +++ a/members/member-flags.pl @@ -162,7 +162,14 @@ if ($input->param('newflags')) { $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' ); my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); $template->param( picture => 1 ) if $picture; -my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( borrowernumber => $bor->{'borrowernumber'}, @@ -184,7 +191,6 @@ $template->param( branchname => GetBranchName($bor->{'branchcode'}), loop => \@loop, is_child => ($bor->{'category_type'} eq 'C'), - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/members/member-password.pl +++ a/members/member-password.pl @@ -90,7 +90,14 @@ if ( $newpassword && ! $errormsg ) { $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' ); my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); $template->param( picture => 1 ) if $picture; -my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( othernames => $bor->{'othernames'}, surname => $bor->{'surname'}, @@ -114,7 +121,6 @@ my $attributes = GetBorrowerAttributes($bor->{'borrowernumber'}); destination => $destination, is_child => ($bor->{'category_type'} eq 'C'), defaultnewpassword => $defaultnewpassword, - extendedattributes => $attributes, ); --- a/members/moremember.pl +++ a/members/moremember.pl @@ -425,8 +425,11 @@ my $branch=C4::Context->userenv->{'branch'}; $template->param(%$data); if (C4::Context->preference('ExtendedPatronAttributes')) { - $template->param(ExtendedPatronAttributes => 1); - $template->param(patron_attributes => C4::Members::Attributes::GetBorrowerAttributes($borrowernumber)); + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); my @types = C4::Members::AttributeTypes::GetAttributeTypes(); if (scalar(@types) == 0) { $template->param(no_patron_attribute_types => 1); @@ -439,7 +442,6 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { $template->param(SMSSendDriver => C4::Context->preference("SMSSendDriver")); $template->param(SMSnumber => defined $data->{'smsalertnumber'} ? $data->{'smsalertnumber'} : $data->{'mobile'}); } -my $attributes = GetBorrowerAttributes($borrowernumber); $template->param( detailview => 1, @@ -469,7 +471,6 @@ $template->param( "dateformat_" . (C4::Context->preference("dateformat") || '') => 1, samebranch => $samebranch, quickslip => $quickslip, - extendedattributes => $attributes, ); #Get the slip news items --- a/members/notices.pl +++ a/members/notices.pl @@ -53,7 +53,14 @@ $template->param( picture => 1 ) if $picture; # Getting the messages my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); $template->param( %{$borrower} ); -my $attributes = GetBorrowerAttributes($borrowernumber); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( QUEUED_MESSAGES => $queued_messages, @@ -61,7 +68,6 @@ $template->param( sentnotices => 1, branchname => GetBranchName($borrower->{'branchcode'}), categoryname => $borrower->{'description'}, - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/members/pay.pl +++ a/members/pay.pl @@ -233,7 +233,13 @@ sub borrower_add_additional_fields { if ($picture) { $b_ref->{has_picture} = 1; } - $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); + + if (C4::Context->preference('ExtendedPatronAttributes')) { + $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + ); + } $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); return; --- a/members/readingrec.pl +++ a/members/readingrec.pl @@ -96,7 +96,14 @@ if (! $limit){ my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); $template->param( picture => 1 ) if $picture; -my $attributes = GetBorrowerAttributes($borrowernumber); + +if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); +} $template->param( readingrecordview => 1, @@ -125,7 +132,6 @@ $template->param( branchname => GetBranchName($data->{'branchcode'}), showfulllink => (scalar @loop_reading > 50), loop_reading => \@loop_reading, - extendedattributes => $attributes, ); output_html_with_http_headers $input, $cookie, $template->output; --