Bugzilla – Attachment 4843 Details for
Bug 5749
The display of borrower adresses composed of streetnumber, streettype and address is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch (updated)
0001-Bug-5749-Fix-borrower-address-display-in-intranet.patch (text/plain), 3.75 KB, created by
Paul Poulain
on 2011-08-04 13:38:40 UTC
(
hide
)
Description:
proposed patch (updated)
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-08-04 13:38:40 UTC
Size:
3.75 KB
patch
obsolete
>From d832d8c8f4c3c1f3856323630a3a945efda3d111 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?St=C3=A9phane=20Delaune?= <stephane.delaune@biblibre.com> >Date: Mon, 23 Aug 2010 16:54:04 +0200 >Subject: [PATCH] Bug 5749 Fix borrower address display in intranet > >The display of borrower adresses composed of streetnumber, streettype and address was broken. >--- > C4/Members.pm | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ > members/member.pl | 11 +++++---- > 2 files changed, 61 insertions(+), 5 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index ce694e5..1147410 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -91,6 +91,8 @@ BEGIN { > &DeleteMessage > &GetMessages > &GetMessagesCount >+ &SetMemberInfosInTemplate >+ &getFullBorrowerAddress > ); > > #Modify data >@@ -1726,6 +1728,59 @@ sub DelMember { > return $sth->rows; > } > >+=head2 SetMemberInfosInTemplate >+ &SetMemberInfosInTemplate($borrowernumber, $template) >+ >+ >+Settings borrower informations for template user >+ >+=cut >+ >+sub SetMemberInfosInTemplate { >+ my ($borrowernumber, $template) = @_; >+ >+ my $borrower = GetMemberDetails( $borrowernumber, 0 ); >+ foreach my $key (keys %$borrower){ >+ $template->param($key => $borrower->{$key}); >+ } >+ >+ # Computes full borrower address >+ my (undef, $roadttype_hashref) = &GetRoadTypes(); >+ my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'}; >+ $template->param(is_child => ($borrower->{'category_type'} eq 'C'), >+ address => $address, >+ branchname => GetBranchName($borrower->{'branchcode'}), >+ ); >+ >+ foreach (qw(dateenrolled dateexpiry dateofbirth)) { >+ my $userdate = $borrower->{$_}; >+ unless ($userdate) { >+ $borrower->{$_} = ''; >+ next; >+ } >+ $userdate = C4::Dates->new($userdate,'iso')->output('syspref'); >+ $borrower->{$_} = $userdate || ''; >+ $template->param( $_ => $userdate ); >+ } >+ >+ my $attributes = GetBorrowerAttributes($borrowernumber); >+ $template->param( >+ extendedattributes => $attributes, >+ ); >+} >+ >+sub getFullBorrowerAddress { >+ my ( $borrowernumber ) = @_; >+ my $borrower = GetMemberDetails( $borrowernumber, 0 ); >+ # Computes full borrower address >+ my ( undef, $roadttype_hashref ) = &GetRoadTypes(); >+ my $address1=""; >+ if(($borrower->{'streetnumber'}) ne ''){$address1=$address1.$borrower->{'streetnumber'}.' ';} >+ if(($roadttype_hashref->{ $borrower->{'streettype'} }) ne ""){$address1=$address1.$roadttype_hashref->{ $borrower->{'streettype'} }.' ';} >+ $address1=$address1.$borrower->{'address'}; >+ return $address1; >+} >+ > =head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE) > > $date = ExtendMemberSubscriptionTo($borrowerid, $date); >diff --git a/members/member.pl b/members/member.pl >index 2be45bc..48682a2 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -123,6 +123,7 @@ foreach my $borrower(@$results[$from..$to-1]){ > my ($od,$issue,$fines)=GetMemberIssuesAndFines($$borrower{'borrowernumber'}); > > $$borrower{'dateexpiry'}= C4::Dates->new($$borrower{'dateexpiry'},'iso')->output('syspref'); >+ $$borrower{'address'}=getFullBorrowerAddress($$borrower{'borrowernumber'}); > > my %row = ( > count => $index++, >@@ -170,10 +171,10 @@ $template->param( > branchloop=>\@branchloop, > categories=>\@categories, > searching => "1", >- actionname =>basename($0), >- %$patron, >- numresults => $count, >- resultsloop => \@resultsdata, >- ); >+ actionname =>basename($0), >+ %$patron, >+ numresults => $count, >+ resultsloop => \@resultsdata, >+); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5749
:
3138
|
3139
|
4843
|
8034
|
8126