X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=members%2Fnotices.pl;h=113e20cbb9499f28717adec8a410e1adf0b20f7f;hb=7a94c50fa6b51e25586d3a02a72cb17987649e7a;hp=a6e65c807e47465fc57633f349a9ede476454690;hpb=944831555e89c8fdb4dc865764de51887a98a23b;p=koha.git diff --git a/members/notices.pl b/members/notices.pl index a6e65c807e..113e20cbb9 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -23,7 +23,7 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Auth; use C4::Output; -use CGI; +use CGI qw ( -utf8 ); use C4::Members; use C4::Branch; use C4::Letters; @@ -38,7 +38,7 @@ my $borrowernumber = $input->param('borrowernumber'); my $borrower = GetMember(borrowernumber => $borrowernumber); my ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "members/notices.tmpl", += get_template_and_user({template_name => "members/notices.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -47,13 +47,24 @@ my ($template, $loggedinuser, $cookie) }); $template->param( $borrower ); -my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); +my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); $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 + ); +} + +# Computes full borrower address +my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{'streettype'} ); +my $address = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'}; $template->param( QUEUED_MESSAGES => $queued_messages, @@ -61,7 +72,9 @@ $template->param( sentnotices => 1, branchname => GetBranchName($borrower->{'branchcode'}), categoryname => $borrower->{'description'}, - extendedattributes => $attributes, + address => $address, + activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output;