Bug 15542: Always display the patron's info the same way.

The patron's information displayed in the member module
(includes/circ-menu.inc and includes/member-display-address-style-*.inc)
are not always displayed the same way.
Sometimes the streetnumber is missing, sometimes it's the streettype.
Sometimes the streettype is after the address, sometimes before...

Test plan:
Go on a patron detail page, and open all the tabs on the left (Check
out, Fines, Notices, etc.)
Without this patch, the patron's info displayed will differ from one page to
another.
With this patch, they will be displayed the same everywhere.

Followed test plan, works as expected. (Tested both patches together.)
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Jonathan Druart 2016-01-11 09:18:30 +00:00 committed by Brendan Gallagher
parent ca6bd89b85
commit bde685fa92
28 changed files with 21 additions and 49 deletions

View File

@ -1,6 +1,10 @@
[% IF ( address or address2 ) %]
[% IF ( address ) %]
<li class="patronaddress1">[% if (streetnumber) %][% streetnumber %][% end %] [% address %][%if (roadtype) %] [% roadtype %][% end %]</li>
[% SET roadtype_desc = '' %]
[% IF streettype %]
[% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', streettype) %]
[% END %]
<li class="patronaddress1">[% if (streetnumber) %][% streetnumber %][% end %] [% IF roadtype_desc %][% roadtype_desc %] [% END %][% address %][% end %]</li>
[% END %]
[% IF ( address2 ) %]
<li class="patronaddress2">[% address2 %]</li>

View File

@ -1,4 +1,5 @@
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; [% IF (unknowuser) %]Patron does not exist[% ELSE %]Discharge for [% firstname %] [% surname %] ([% cardnumber %])[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]

View File

@ -1,4 +1,5 @@
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Files for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]

View File

@ -1,5 +1,6 @@
[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE ColumnsSettings %]
[% IF Koha.Preference('ExportRemoveFields') OR Koha.Preference('ExportWithCsvProfile') %]
[% SET exports_enabled = 1 %]

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title>

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for [% borrower.firstname %] [% borrower.surname %]</title>
[% INCLUDE 'doc-head-close.inc' %]

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' %]</title>
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />

View File

@ -1,5 +1,6 @@
[% USE KohaDates %]
[% USE Koha %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo;
[% IF ( unknowuser ) %]

View File

@ -1,4 +1,5 @@
[% USE Koha %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
Koha &rsaquo; Tools &rsaquo;

View File

@ -104,14 +104,11 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
$template->param(%$data);
$template->param(
finesview => 1,
borrowernumber => $borrowernumber,
roadtype => $roadtype,
branchname => GetBranchName($data->{'branchcode'}),
total => sprintf("%.2f",$total),
totalcredit => $totalcredit,

View File

@ -115,6 +115,8 @@ if ( $input->param('borrowernumber') ) {
category_type => $data->{'category_type'},
categoryname => $data->{'description'},
address => $data->{'address'},
streetnumber => $data->{streetnumber},
streettype => $data->{streettype},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},

View File

@ -118,16 +118,11 @@ else {
my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'});
$template->param( picture => 1 ) if $picture;
# Computes full borrower address
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
$template->param(
files => Koha::Borrower::Files->new( borrowernumber => $borrowernumber )
->GetFilesInfo(),
errors => \%errors,
address => $address,
);
output_html_with_http_headers $cgi, $cookie, $template->output;
}

View File

@ -91,14 +91,12 @@ if ($add){
);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
$template->param(%$data);
$template->param(
finesview => 1,
borrowernumber => $borrowernumber,
categoryname => $data->{'description'},
roadtype => $roadtype,
branchname => GetBranchName($data->{'branchcode'}),
is_child => ($data->{'category_type'} eq 'C'),
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),

View File

@ -117,14 +117,12 @@ if ($add){
);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
$template->param(%$data);
$template->param(
finesview => 1,
borrowernumber => $borrowernumber,
categoryname => $data->{'description'},
branchname => GetBranchName($data->{'branchcode'}),
roadtype => $roadtype,
is_child => ($data->{'category_type'} eq 'C'),
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
RoutingSerials => C4::Context->preference('RoutingSerials'),

View File

@ -168,10 +168,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
);
}
# Computes full borrower address
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $bor->{streettype} );
my $address = $bor->{'streetnumber'} . " $roadtype " . $bor->{'address'};
$template->param(
borrowernumber => $bor->{'borrowernumber'},
cardnumber => $bor->{'cardnumber'},
@ -181,8 +177,9 @@ $template->param(
categorycode => $bor->{'categorycode'},
category_type => $bor->{'category_type'},
categoryname => $bor->{'description'},
address => $address,
address => $bor->{address},
address2 => $bor->{'address2'},
streettype => $bor->{streettype},
city => $bor->{'city'},
state => $bor->{'state'},
zipcode => $bor->{'zipcode'},

View File

@ -100,10 +100,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
);
}
# Computes full borrower address
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $bor->{streettype} ) // '';
my $address = $bor->{'streetnumber'} . " $roadtype " . $bor->{'address'};
$template->param( othernames => $bor->{'othernames'},
surname => $bor->{'surname'},
firstname => $bor->{'firstname'},
@ -112,8 +108,9 @@ my $address = $bor->{'streetnumber'} . " $roadtype " . $bor->{'address'};
categorycode => $bor->{'categorycode'},
category_type => $bor->{'category_type'},
categoryname => $bor->{'description'},
address => $address,
address => $bor->{address},
address2 => $bor->{'address2'},
streettype => $$bor->{streettype},
city => $bor->{'city'},
state => $bor->{'state'},
zipcode => $bor->{'zipcode'},

View File

@ -248,7 +248,6 @@ my $relatives_issues_count =
Koha::Database->new()->schema()->resultset('Issue')
->count( { borrowernumber => \@relatives } );
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
my $today = DateTime->now( time_zone => C4::Context->tz);
$today->truncate(to => 'day');
my $overdues_exist = 0;
@ -333,7 +332,6 @@ $template->param( $data->{'categorycode'} => 1 );
$template->param(
detailview => 1,
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
roadtype => $roadtype,
borrowernumber => $borrowernumber,
othernames => $data->{'othernames'},
categoryname => $data->{'description'},

View File

@ -60,7 +60,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{'streettype'} );
$template->param(%$borrower);
$template->param(
@ -69,7 +68,6 @@ $template->param(
sentnotices => 1,
branchname => GetBranchName($borrower->{'branchcode'}),
categoryname => $borrower->{'description'},
roadtype => $roadtype,
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
RoutingSerials => C4::Context->preference('RoutingSerials'),
);

View File

@ -228,8 +228,6 @@ sub borrower_add_additional_fields {
if ($picture) {
$b_ref->{has_picture} = 1;
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
$b_ref->{roadtype} = $roadtype;
if (C4::Context->preference('ExtendedPatronAttributes')) {
$b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);

View File

@ -184,9 +184,6 @@ sub borrower_add_additional_fields {
$b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
$b_ref->{roadtype} = $roadtype;
$b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
return;
}

View File

@ -62,10 +62,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
);
}
# Computes full borrower address
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
$template->param( roadtype => $roadtype );
my ($picture, $dberror) = GetPatronImage($borrowernumber);
$template->param( picture => 1 ) if $picture;

View File

@ -117,14 +117,12 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
$template->param(%$data);
$template->param(
readingrecordview => 1,
borrowernumber => $borrowernumber,
categoryname => $data->{description},
roadtype => $roadtype,
is_child => ( $data->{category_type} eq 'C' ),
branchname => $branches->{ $data->{branchcode} }->{branchname},
loop_reading => $issues,

View File

@ -101,7 +101,6 @@ if ($borrowernumber) {
##################################################################################
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
$template->param(%$borrower);
$template->param(
@ -111,7 +110,6 @@ $template->param(
branch => $branch,
branchname => GetBranchName($borrower->{'branchcode'}),
categoryname => $borrower->{description},
roadtype => $roadtype,
RoutingSerials => C4::Context->preference('RoutingSerials'),
);

View File

@ -96,13 +96,11 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'});
$template->param( picture => 1 ) if $picture;
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
$template->param(%$borrower);
$template->param(
statisticsview => 1,
datas => $datas,
roadtype => $roadtype,
column_names => \@statistic_column_names,
count_total_issues => $count_total_issues,
count_total_issues_returned => $count_total_issues_returned,

View File

@ -58,10 +58,6 @@ foreach my $accountline (@$accts) {
}
}
my $roadtype =
C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} ) // '';
$roadtype = '' if ( ! $roadtype );
our $totalprice = 0;
my $total_format = '';
$total_format = sprintf( "%.2f", $total ) if ($total);
@ -74,7 +70,6 @@ $template->param(
%$data,
borrowernumber => $borrowernumber,
address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'},
accounts => $accts,
totaldue => $total_format,

View File

@ -84,14 +84,12 @@ if ( $src eq 'circ' ) {
);
}
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
$template->param(%$data);
$template->param(
menu => 1,
borrowernumber => $borrowernumber,
categoryname => $data->{'description'},
roadtype => $roadtype,
branchname => GetBranchName( $data->{'branchcode'} ),
RoutingSerials => C4::Context->preference('RoutingSerials'),
);