Bug 12542: Tabs inconsistency in different circ-menu.inc uses
authorOwen Leonard <oleonard@myacpl.org>
Mon, 14 Jul 2014 18:29:20 +0000 (14:29 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 18 Jul 2014 13:41:27 +0000 (10:41 -0300)
Differences between circ-menu.tt and circ-menu.inc always crop up when a
new menu item is added--usually only to circ-menu.inc as happened with
Bug 9261.

Other sidebar differences are present due to differences in the patron
data passed by various patron-related script to their templates. This
patch also irons out some of these inconsistencies.

To test, apply the patch and check out to a patron whose record has more
than just basic data: othername, country, patron attributes, street
number, road types, etc. View the following pages and compare the patron
data and visible tabs to confirm that they match:

circ/circulation.pl?borrowernumber=X
members/boraccount.pl?borrowernumber=X
members/files.pl?borrowernumber=X
members/mancredit.pl?borrowernumber=X
members/maninvoice.pl?borrowernumber=X
members/member-flags.pl?member=X
members/member-password.pl?member=X
members/moremember.pl?borrowernumber=X
members/notices.pl?borrowernumber=X
members/pay.pl?borrowernumber=X
members/paycollect.pl?borrowernumber=X
members/purchase-suggestions.pl?borrowernumber=X
members/readingrec.pl?borrowernumber=X
members/routing-lists.pl?borrowernumber=X
members/statistics.pl?borrowernumber=X
tools/viewlog.pl?do_it=1&modules=MEMBERS&modules=circulation&src=circ&object=X

The only difference I've found which is not fixed by this patch is the
display of extended patron attributes in the sidebar of moremember.pl.
This is a piecemeal fix for a problem which really deserves a
centralized solution, but at least it gets us back to consistency for
the moment.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Going through all tabs shows consistency is back. A mid term solution should
implement this in a centralized way. Great job Owen!
No koha-qa errors btw.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
21 files changed:
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
members/boraccount.pl
members/files.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/notices.pl
members/pay.pl
members/paycollect.pl
members/purchase-suggestions.pl
members/readingrec.pl
members/routing-lists.pl
members/statistics.pl
tools/viewlog.pl

index dce75e4..b95bffa 100755 (executable)
@@ -534,7 +534,9 @@ $template->param(
     state              => $borrower->{'state'},
     zipcode           => $borrower->{'zipcode'},
     country           => $borrower->{'country'},
-    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
+    phone             => $borrower->{'phone'},
+    mobile            => $borrower->{'mobile'},
+    phonepro          => $borrower->{'phonepro'},
     cardnumber        => $borrower->{'cardnumber'},
     othernames        => $borrower->{'othernames'},
     amountold         => $amountold,
index 7505d06..2fe0a68 100644 (file)
@@ -20,7 +20,7 @@
             <li class="patronaddress2">[% address2 %]</li>
         [% END %]
     [% ELSE %]
-            <li><span class="empty" id="noadressstored">No address stored.</span></li>
+            <li><span class="empty" id="noaddressstored">No address stored.</span></li>
     [% END %]
     <li class="patroncity">[% IF ( city ) %]
             [% city %][% IF ( state ) %], [% state %][% END %]
@@ -83,7 +83,7 @@
     [% IF EnableBorrowerFiles %]
         [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
     [% END %]
-    [% IF (  suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrowernumber %]">Purchase<br/>suggestions</a></li>
+    [% IF (  suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrowernumber %]">Purchase suggestions</a></li>
 </ul></div>
 [% END %]
 
index e98f846..aead23b 100644 (file)
@@ -1,7 +1,7 @@
 [%# duplicates circ-menu.inc but assumes all borrower attributes are in a borrower variable rather than
 in the global namespace %]
 [% IF borrower %]
-<div class="patroninfo"><h5>[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])</h5>
+<div class="patroninfo"><h5>[% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] [% borrower.surname %] ([% borrower.cardnumber %])</h5>
 <!--[if IE 6]>
 <style type="tex/css">img { width: expression(this.width > 140 ? 140: true);
 }</style>
@@ -76,12 +76,13 @@ in the global namespace %]
     [% IF ( intranetreadinghistory ) %][% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrower.borrowernumber %]">Circulation history</a></li>[% END %]
     [% IF ( CAN_user_parameters ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=MEMBERS&amp;modules=circulation&amp;object=[% borrower.borrowernumber %]&amp;src=circ">Modification log</a></li>[% END %]
     [% IF ( EnhancedMessagingPreferences ) %]
-    [% END %]
     [% IF ( sentnotices ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrower.borrowernumber %]">Notices</a></li>
+    [% END %]
     [% IF (  statisticsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/statistics.pl?borrowernumber=[% borrower.borrowernumber %]">Statistics</a></li>
     [% IF EnableBorrowerFiles %]
         [% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrower.borrowernumber %]">Files</a></li>
     [% END %]
+    [% IF (  suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrower.borrowernumber %]">Purchase<br/>suggestions</a></li>
 </ul></div>
 [% END %]
 
index 5ecc5e2..13500ab 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Borrowers &rsaquo; Create manual credit</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Create manual credit</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
index adaf96a..445fffe 100644 (file)
@@ -1,5 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Borrowers &rsaquo; Create manual invoice</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Create manual invoice</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
index d6b95f8..74c89c9 100644 (file)
@@ -176,8 +176,7 @@ function validate1(date) {
 
      [% UNLESS ( I ) %][% IF ( othernames ) %]&ldquo;[% othernames %]&rdquo;[% END %]
 
-<p class="address">[% streetnumber %]
-        [% IF roadtype %][% roadtype %][% END %]
+<p class="address">
         [% address %]<br />
         [% IF ( address2 ) %][% address2 %]<br />[% END %]
        [% IF ( city ) %][% city %][% END %] 
index 6e1b51f..50f5db9 100755 (executable)
@@ -106,6 +106,10 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     );
 }
 
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
+my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
 $template->param(
     finesview           => 1,
     firstname           => $data->{'firstname'},
@@ -116,14 +120,17 @@ $template->param(
     categorycode        => $data->{'categorycode'},
     category_type       => $data->{'category_type'},
     categoryname               => $data->{'description'},
-    address             => $data->{'address'},
+    address             => $address,
     address2            => $data->{'address2'},
     city                => $data->{'city'},
     state               => $data->{'state'},
     zipcode             => $data->{'zipcode'},
     country             => $data->{'country'},
     phone               => $data->{'phone'},
+    phonepro            => $data->{'phonepro'},
+    mobile              => $data->{'mobile'},
     email               => $data->{'email'},
+    emailpro            => $data->{'emailpro'},
     branchcode          => $data->{'branchcode'},
        branchname                      => GetBranchName($data->{'branchcode'}),
     total               => sprintf("%.2f",$total),
index 90f0dbc..f9b7080 100755 (executable)
@@ -118,11 +118,16 @@ 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
+        errors => \%errors,
+        address => $address,
     );
     output_html_with_http_headers $cgi, $cookie, $template->output;
 }
index e52219f..c8eb619 100755 (executable)
@@ -90,24 +90,32 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
         extendedattributes => $attributes
     );
 }
-    
+
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
+my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
     $template->param(
         finesview => 1,
         borrowernumber => $borrowernumber,
         firstname => $data->{'firstname'},
         surname  => $data->{'surname'},
+        othernames => $data->{'othernames'},
                    cardnumber => $data->{'cardnumber'},
                    categorycode => $data->{'categorycode'},
                    category_type => $data->{'category_type'},
                    categoryname  => $data->{'description'},
-                   address => $data->{'address'},
+            address => $address,
                    address2 => $data->{'address2'},
                    city => $data->{'city'},
                    state => $data->{'state'},
                    zipcode => $data->{'zipcode'},
                    country => $data->{'country'},
                    phone => $data->{'phone'},
+            phonepro => $data->{'phonepro'},
+            mobile => $data->{'mobile'},
                    email => $data->{'email'},
+            emailpro => $data->{'emailpro'},
                    branchcode => $data->{'branchcode'},
                    branchname => GetBranchName($data->{'branchcode'}),
                    is_child        => ($data->{'category_type'} eq 'C'),
index cf7876e..c72b387 100755 (executable)
@@ -116,23 +116,32 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
         extendedattributes => $attributes
     );
 }
+
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
+my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
        $template->param(
                 finesview => 1,
                 borrowernumber => $borrowernumber,
                firstname => $data->{'firstname'},
                 surname  => $data->{'surname'},
+        othernames => $data->{'othernames'},
                cardnumber => $data->{'cardnumber'},
                categorycode => $data->{'categorycode'},
                category_type => $data->{'category_type'},
                categoryname  => $data->{'description'},
-               address => $data->{'address'},
+        address => $address,
                address2 => $data->{'address2'},
                city => $data->{'city'},
                state => $data->{'state'},
                zipcode => $data->{'zipcode'},
                country => $data->{'country'},
                phone => $data->{'phone'},
+        phonepro => $data->{'phonepro'},
+        mobile => $data->{'mobile'},
                email => $data->{'email'},
+        emailpro => $data->{'emailpro'},
                branchcode => $data->{'branchcode'},
                branchname => GetBranchName($data->{'branchcode'}),
                is_child        => ($data->{'category_type'} eq 'C'),
index 82c9bc2..ab96951 100755 (executable)
@@ -171,22 +171,30 @@ 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'},
                surname => $bor->{'surname'},
                firstname => $bor->{'firstname'},
+        othernames => $bor->{'othernames'},
                categorycode => $bor->{'categorycode'},
                category_type => $bor->{'category_type'},
                categoryname => $bor->{'description'},
-               address => $bor->{'address'},
+        address => $address,
                address2 => $bor->{'address2'},
                city => $bor->{'city'},
         state => $bor->{'state'},
                zipcode => $bor->{'zipcode'},
                country => $bor->{'country'},
                phone => $bor->{'phone'},
+        phonepro => $bor->{'phonepro'},
+        mobile => $bor->{'mobile'},
                email => $bor->{'email'},
+        emailpro => $bor->{'emailpro'},
                branchcode => $bor->{'branchcode'},
                branchname => GetBranchName($bor->{'branchcode'}),
                loop => \@loop,
index 937852c..eb37b99 100755 (executable)
@@ -100,6 +100,10 @@ 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'},
@@ -108,14 +112,17 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
            categorycode => $bor->{'categorycode'},
            category_type => $bor->{'category_type'},
            categoryname => $bor->{'description'},
-           address => $bor->{'address'},
+        address => $address,
            address2 => $bor->{'address2'},
            city => $bor->{'city'},
            state => $bor->{'state'},
            zipcode => $bor->{'zipcode'},
            country => $bor->{'country'},
            phone => $bor->{'phone'},
+        phonepro => $bor->{'phonepro'},
+        mobile => $bor->{'mobile'},
            email => $bor->{'email'},
+        emailpro => $bor->{'emailpro'},
            branchcode => $bor->{'branchcode'},
            branchname => GetBranchName($bor->{'branchcode'}),
            userid      => $bor->{'userid'},
index 53ccae3..b1df1dd 100755 (executable)
@@ -338,6 +338,9 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
     $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
 }
 
+# Computes full borrower address
+my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
 # in template <TMPL_IF name="I"> => instutitional (A for Adult, C for children) 
 $template->param( $data->{'categorycode'} => 1 ); 
 $template->param(
@@ -367,6 +370,7 @@ $template->param(
     PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
     relatives_issues_count => $relatives_issues_count,
     relatives_borrowernumbers => \@relatives,
+    address => $address
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;
index 4b67a9b..e0338d3 100755 (executable)
@@ -62,12 +62,17 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     );
 }
 
+# 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,
                        borrowernumber          => $borrowernumber,
                        sentnotices             => 1,
                         branchname              => GetBranchName($borrower->{'branchcode'}),
                         categoryname            => $borrower->{'description'},
+                        address                 => $address,
                        activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
             RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
index ce432e6..a543823 100755 (executable)
@@ -227,6 +227,10 @@ sub borrower_add_additional_fields {
         $b_ref->{has_picture} = 1;
     }
 
+    # Computes full borrower address
+    my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
+    $b_ref->{address} = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'};
+
     if (C4::Context->preference('ExtendedPatronAttributes')) {
         $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
         $template->param(
index 37b7713..01536b0 100755 (executable)
@@ -25,6 +25,7 @@ use C4::Auth;
 use C4::Output;
 use CGI;
 use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Accounts;
 use C4::Koha;
 use C4::Branch;
@@ -175,6 +176,17 @@ sub borrower_add_additional_fields {
         $b_ref->{has_picture} = 1;
     }
 
+    if (C4::Context->preference('ExtendedPatronAttributes')) {
+        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
+        $template->param(
+            ExtendedPatronAttributes => 1,
+        );
+    }
+
+    # Computes full borrower address
+    my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
+    $b_ref->{address} = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'};
+
     $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} );
     return;
 }
index e19da5b..d7d7ab0 100755 (executable)
@@ -25,6 +25,7 @@ use C4::Context;
 use C4::Output;
 use C4::Branch;
 use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Suggestions;
 
 my $input = new CGI;
@@ -50,8 +51,22 @@ $template->param(
     suggestionsview  => 1,
     categoryname => $borrower->{'description'},
     branchname   => GetBranchName( $borrower->{'branchcode'} ),
+    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
+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( address => $address );
+
 my ($picture, $dberror) = GetPatronImage($borrowernumber);
 $template->param( picture => 1 ) if $picture;
 
index 85ac4d8..672c2c8 100755 (executable)
@@ -122,6 +122,11 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
     );
 }
 
+
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
+my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
 $template->param(
     readingrecordview => 1,
     title             => $data->{title},
@@ -134,14 +139,17 @@ $template->param(
     categorycode      => $data->{categorycode},
     category_type     => $data->{category_type},
     categoryname      => $data->{description},
-    address           => $data->{address},
+    address           => $address,
     address2          => $data->{address2},
     city              => $data->{city},
     state             => $data->{state},
     zipcode           => $data->{zipcode},
     country           => $data->{country},
     phone             => $data->{phone},
+    phonepro          => $data->{phonepro},
+    mobile            => $data->{mobile},
     email             => $data->{email},
+    emailpro             => $data->{emailpro},
     branchcode        => $data->{branchcode},
     is_child          => ( $data->{category_type} eq 'C' ),
     branchname        => $branches->{ $data->{branchcode} }->{branchname},
index 6331d07..ae6bf1c 100755 (executable)
@@ -24,6 +24,7 @@ use C4::Output;
 use C4::Auth qw/:DEFAULT get_session/;
 use C4::Branch; # GetBranches
 use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
 use C4::Context;
 use C4::Serials;
 use CGI::Session;
@@ -111,23 +112,37 @@ $template->param(
     borrowernumber    => $borrowernumber,
     branch            => $branch,
     branchname        => GetBranchName($borrower->{'branchcode'}),
+    title             => $borrower->{'title'},
+    initials          => $borrower->{'initials'},
     firstname         => $borrower->{'firstname'},
     surname           => $borrower->{'surname'},
+    othernames        => $borrower->{'othernames'},
     categorycode      => $borrower->{'categorycode'},
     categoryname      => $borrower->{description},
     address           => $address,
     address2          => $borrower->{'address2'},
+    phone             => $borrower->{'phone'},
+    phonepro          => $borrower->{'phonepro'},
+    mobile            => $borrower->{'mobile'},
     email             => $borrower->{'email'},
     emailpro          => $borrower->{'emailpro'},
     borrowernotes     => $borrower->{'borrowernotes'},
     city              => $borrower->{'city'},
+    state             => $borrower->{'state'},
     zipcode           => $borrower->{'zipcode'},
     country           => $borrower->{'country'},
-    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
     cardnumber        => $borrower->{'cardnumber'},
     RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+    my $attributes = GetBorrowerAttributes($borrowernumber);
+    $template->param(
+        ExtendedPatronAttributes => 1,
+        extendedattributes => $attributes
+    );
+}
+
 my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'});
 $template->param( picture => 1 ) if $picture;
 
index 5222cf0..15a1c69 100755 (executable)
@@ -96,9 +96,14 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
 my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'});
 $template->param( picture => 1 ) if $picture;
 
+# Computes full borrower address
+my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $borrower->{streettype} );
+my $address = $borrower->{'streetnumber'} . " $roadtype " . $borrower->{'address'};
+
 $template->param(
     statisticsview => 1,
     datas          => $datas,
+    address        => $address,
     column_names   => \@statistic_column_names,
     length_keys    => scalar( @statistic_column_names),
     count_total_issues => $count_total_issues,
index 6961ed7..3fe7b0a 100755 (executable)
@@ -70,11 +70,24 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 
 if ($src eq 'circ') {   # if we were called from circulation, use the circulation menu and get data to populate it -fbcit
     use C4::Members;
+    use C4::Members::Attributes qw(GetBorrowerAttributes);
     my $borrowernumber = $object;
     my $data = GetMember('borrowernumber'=>$borrowernumber);
     my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'});
     $template->param( picture => 1 ) if $picture;
-    
+
+    if (C4::Context->preference('ExtendedPatronAttributes')) {
+        my $attributes = GetBorrowerAttributes($data->{'borrowernumber'});
+        $template->param(
+            ExtendedPatronAttributes => 1,
+            extendedattributes => $attributes
+        );
+    }
+
+    # Computes full borrower address
+    my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
+    my $address = $data->{'streetnumber'} . " $roadtype " . $data->{'address'};
+
     $template->param(   menu            => 1,
                         title           => $data->{'title'},
                         initials        => $data->{'initials'},
@@ -86,14 +99,17 @@ if ($src eq 'circ') {   # if we were called from circulation, use the circulatio
                         categorycode    => $data->{'categorycode'},
                         category_type   => $data->{'category_type'},
                         categoryname   => $data->{'description'},
-                        address         => $data->{'address'},
+                        address         => $address,
                         address2        => $data->{'address2'},
                         city            => $data->{'city'},
                         state           => $data->{'state'},
                         zipcode         => $data->{'zipcode'},
+                        country         => $data->{'country'},
                         phone           => $data->{'phone'},
                         phonepro        => $data->{'phonepro'},
+                        mobile          => $data->{'mobile'},
                         email           => $data->{'email'},
+                        emailpro        => $data->{'emailpro'},
                         branchcode      => $data->{'branchcode'},
                         branchname             => GetBranchName($data->{'branchcode'}),
                         RoutingSerials => C4::Context->preference('RoutingSerials'),