bug2580: category name and home library will now correctly display on all patron tabs

This patch fixes several improperly named variables and includes the home library variable on the pages that were missing it. The category
description was added to the GetMemberDetails function since a couple of the pages using that function required the variable.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Danny Bouman 2008-09-04 11:50:58 -04:00 committed by Galen Charlton
parent f55d783c25
commit bb76d95a91
8 changed files with 45 additions and 33 deletions

View File

@ -355,11 +355,11 @@ sub GetMemberDetails {
my $query;
my $sth;
if ($borrowernumber) {
$sth = $dbh->prepare("select borrowers.*,category_type from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?");
$sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where borrowernumber=?");
$sth->execute($borrowernumber);
}
elsif ($cardnumber) {
$sth = $dbh->prepare("select borrowers.*,category_type from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?");
$sth = $dbh->prepare("select borrowers.*,category_type,categories.description from borrowers left join categories on borrowers.categorycode=categories.categorycode where cardnumber=?");
$sth->execute($cardnumber);
}
else {

View File

@ -673,7 +673,7 @@ $template->param(
dateexpiry => format_date($newexpiry),
expiry => format_date($borrower->{'dateexpiry'}),
categorycode => $borrower->{'categorycode'},
categoryname => $borrowercategory->{description},
categoryname => $borrower->{description},
address => $borrower->{'address'},
address2 => $borrower->{'address2'},
email => $borrower->{'email'},

View File

@ -27,6 +27,7 @@ use C4::Output;
use CGI;
use C4::Members;
use C4::Branch;
use C4::Accounts;
use C4::Items;
@ -75,13 +76,15 @@ if ($add){
cardnumber => $data->{'cardnumber'},
categorycode => $data->{'categorycode'},
category_type => $data->{'category_type'},
category_description => $data->{'description'},
categoryname => $data->{'description'},
address => $data->{'address'},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},
phone => $data->{'phone'},
email => $data->{'email'},
branchcode => $data->{'branchcode'},
branchname => GetBranchName($data->{'branchcode'}),
is_child => ($data->{'category_type'} eq 'C'),
);
output_html_with_http_headers $input, $cookie, $template->output;

View File

@ -28,6 +28,7 @@ use CGI;
use C4::Members;
use C4::Accounts;
use C4::Items;
use C4::Branch;
my $input=new CGI;
@ -86,20 +87,22 @@ if ($add){
$template->param( picture => 1 ) if $picture;
$template->param(
borrowernumber => $borrowernumber,
firstname => $data->{'firstname'},
surname => $data->{'surname'},
cardnumber => $data->{'cardnumber'},
categorycode => $data->{'categorycode'},
category_type => $data->{'category_type'},
category_description => $data->{'description'},
address => $data->{'address'},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},
phone => $data->{'phone'},
email => $data->{'email'},
is_child => ($data->{'category_type'} eq 'C'),
borrowernumber => $borrowernumber,
firstname => $data->{'firstname'},
surname => $data->{'surname'},
cardnumber => $data->{'cardnumber'},
categorycode => $data->{'categorycode'},
category_type => $data->{'category_type'},
categoryname => $data->{'description'},
address => $data->{'address'},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},
phone => $data->{'phone'},
email => $data->{'email'},
branchcode => $data->{'branchcode'},
branchname => GetBranchName($data->{'branchcode'}),
is_child => ($data->{'category_type'} eq 'C'),
);
output_html_with_http_headers $input, $cookie, $template->output;
}

View File

@ -11,6 +11,7 @@ use C4::Output;
use C4::Auth qw(:DEFAULT :EditPermissions);
use C4::Context;
use C4::Members;
use C4::Branch;
#use C4::Acquisitions;
use C4::Output;
@ -171,7 +172,7 @@ $template->param(
firstname => $bor->{'firstname'},
categorycode => $bor->{'categorycode'},
category_type => $bor->{'category_type'},
category_description => $bor->{'description'},
categoryname => $bor->{'description'},
address => $bor->{'address'},
address2 => $bor->{'address2'},
city => $bor->{'city'},
@ -179,6 +180,7 @@ $template->param(
phone => $bor->{'phone'},
email => $bor->{'email'},
branchcode => $bor->{'branchcode'},
branchname => GetBranchName($bor->{'branchcode'}),
loop => \@loop,
is_child => ($bor->{'category_type'} eq 'C'),
);

View File

@ -9,6 +9,7 @@ use C4::Auth;
use C4::Output;
use C4::Context;
use C4::Members;
use C4::Branch;
use C4::Circulation;
use CGI;
@ -94,7 +95,7 @@ $template->param( picture => 1 ) if $picture;
cardnumber => $bor->{'cardnumber'},
categorycode => $bor->{'categorycode'},
category_type => $bor->{'category_type'},
category_description => $bor->{'description'},
categoryname => $bor->{'description'},
address => $bor->{'address'},
address2 => $bor->{'address2'},
city => $bor->{'city'},
@ -102,6 +103,7 @@ $template->param( picture => 1 ) if $picture;
phone => $bor->{'phone'},
email => $bor->{'email'},
branchcode => $bor->{'branchcode'},
branchname => GetBranchName($bor->{'branchcode'}),
userid => $bor->{'userid'},
destination => $destination,
is_child => ($bor->{'category_type'} eq 'C'),

View File

@ -142,7 +142,8 @@ $template->param( messagingview => 1,
message_queue => $message_queue,
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
borrowernumber => $borrowernumber,
branch => $branch,
branchcode => $borrower->{'branchcode'},
branchname => GetBranchName($borrower->{'branchcode'}),
dateformat => C4::Context->preference("dateformat"),
categoryname => $borrower->{'description'},
$borrower->{'categorycode'} => 1,

View File

@ -147,18 +147,19 @@ $template->param( picture => 1 ) if $picture;
firstname => $data->{'firstname'},
surname => $data->{'surname'},
borrowernumber => $borrowernumber,
cardnumber => $data->{'cardnumber'},
categorycode => $data->{'categorycode'},
category_type => $data->{'category_type'},
category_description => $data->{'description'},
address => $data->{'address'},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},
phone => $data->{'phone'},
email => $data->{'email'},
branchcode => $data->{'branchcode'},
is_child => ($data->{'category_type'} eq 'C'),
cardnumber => $data->{'cardnumber'},
categorycode => $data->{'categorycode'},
category_type => $data->{'category_type'},
categoryname => $data->{'description'},
address => $data->{'address'},
address2 => $data->{'address2'},
city => $data->{'city'},
zipcode => $data->{'zipcode'},
phone => $data->{'phone'},
email => $data->{'email'},
branchcode => $data->{'branchcode'},
branchname => GetBranchName($data->{'branchcode'}),
is_child => ($data->{'category_type'} eq 'C'),
total => sprintf( "%.2f", $total )
);
output_html_with_http_headers $input, $cookie, $template->output;