View | Details | Raw Unified | Return to bug 5749
Collapse All | Expand All

(-)a/C4/Members.pm (+55 lines)
Lines 91-96 BEGIN { Link Here
91
		&DeleteMessage
91
		&DeleteMessage
92
		&GetMessages
92
		&GetMessages
93
		&GetMessagesCount
93
		&GetMessagesCount
94
		&SetMemberInfosInTemplate
95
      &getFullBorrowerAddress
94
	);
96
	);
95
97
96
	#Modify data
98
	#Modify data
Lines 1726-1731 sub DelMember { Link Here
1726
    return $sth->rows;
1728
    return $sth->rows;
1727
}
1729
}
1728
1730
1731
=head2 SetMemberInfosInTemplate
1732
    &SetMemberInfosInTemplate($borrowernumber, $template)
1733
    
1734
    
1735
Settings borrower informations for template user
1736
1737
=cut
1738
1739
sub SetMemberInfosInTemplate {
1740
    my ($borrowernumber, $template) = @_;
1741
    
1742
    my $borrower = GetMemberDetails( $borrowernumber, 0 );
1743
    foreach my $key (keys %$borrower){
1744
        $template->param($key => $borrower->{$key});
1745
    }
1746
    
1747
    # Computes full borrower address
1748
    my (undef, $roadttype_hashref) = &GetRoadTypes();
1749
    my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
1750
    $template->param(is_child  => ($borrower->{'category_type'} eq 'C'),
1751
                    address    => $address,
1752
                    branchname => GetBranchName($borrower->{'branchcode'}),
1753
                    );
1754
                    
1755
    foreach (qw(dateenrolled dateexpiry dateofbirth)) {
1756
		my $userdate = $borrower->{$_};
1757
		unless ($userdate) {
1758
			$borrower->{$_} = '';
1759
			next;
1760
		}
1761
		$userdate = C4::Dates->new($userdate,'iso')->output('syspref');
1762
		$borrower->{$_} = $userdate || '';
1763
		$template->param( $_ => $userdate );
1764
    }
1765
    
1766
    my $attributes = GetBorrowerAttributes($borrowernumber);
1767
    $template->param(
1768
        extendedattributes => $attributes,
1769
    );
1770
}
1771
1772
sub getFullBorrowerAddress {
1773
    my ( $borrowernumber ) = @_;
1774
    my $borrower = GetMemberDetails( $borrowernumber, 0 );
1775
    # Computes full borrower address
1776
    my ( undef, $roadttype_hashref ) = &GetRoadTypes();
1777
    my $address1="";
1778
    if(($borrower->{'streetnumber'}) ne ''){$address1=$address1.$borrower->{'streetnumber'}.' ';}
1779
    if(($roadttype_hashref->{ $borrower->{'streettype'} }) ne ""){$address1=$address1.$roadttype_hashref->{ $borrower->{'streettype'} }.' ';}
1780
    $address1=$address1.$borrower->{'address'};
1781
    return $address1;
1782
}
1783
1729
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE)
1784
=head2 ExtendMemberSubscriptionTo (OUEST-PROVENCE)
1730
1785
1731
    $date = ExtendMemberSubscriptionTo($borrowerid, $date);
1786
    $date = ExtendMemberSubscriptionTo($borrowerid, $date);
(-)a/members/member.pl (-6 / +6 lines)
Lines 123-128 foreach my $borrower(@$results[$from..$to-1]){ Link Here
123
  my ($od,$issue,$fines)=GetMemberIssuesAndFines($$borrower{'borrowernumber'});
123
  my ($od,$issue,$fines)=GetMemberIssuesAndFines($$borrower{'borrowernumber'});
124
124
125
  $$borrower{'dateexpiry'}= C4::Dates->new($$borrower{'dateexpiry'},'iso')->output('syspref');
125
  $$borrower{'dateexpiry'}= C4::Dates->new($$borrower{'dateexpiry'},'iso')->output('syspref');
126
    $$borrower{'address'}=getFullBorrowerAddress($$borrower{'borrowernumber'});
126
127
127
  my %row = (
128
  my %row = (
128
    count => $index++,
129
    count => $index++,
Lines 170-179 $template->param( Link Here
170
    branchloop=>\@branchloop,
171
    branchloop=>\@branchloop,
171
    categories=>\@categories,
172
    categories=>\@categories,
172
    searching       => "1",
173
    searching       => "1",
173
		actionname		=>basename($0),
174
    actionname		=>basename($0),
174
		%$patron,
175
    %$patron,
175
        numresults      => $count,
176
    numresults      => $count,
176
        resultsloop     => \@resultsdata,
177
    resultsloop     => \@resultsdata,
177
            );
178
);
178
179
179
output_html_with_http_headers $input, $cookie, $template->output;
180
output_html_with_http_headers $input, $cookie, $template->output;
180
- 

Return to bug 5749