Bug 12542: Tabs inconsistency in different circ-menu.inc uses

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>
This commit is contained in:
Owen Leonard 2014-07-14 14:29:20 -04:00 committed by Tomas Cohen Arazi
parent d020e0a5a1
commit 526af4ea07
21 changed files with 150 additions and 20 deletions

View File

@ -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,

View 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 %]

View 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 %]

View 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[

View 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[

View 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 %]

View File

@ -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),

View File

@ -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;
}

View File

@ -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'),

View File

@ -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'),

View File

@ -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,

View File

@ -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'},

View File

@ -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;

View File

@ -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'),
);

View File

@ -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(

View File

@ -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;
}

View File

@ -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;

View File

@ -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},

View File

@ -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;

View File

@ -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,

View File

@ -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'),