From bb76d95a91d65d5ca3cfeea22d273fc42c843587 Mon Sep 17 00:00:00 2001 From: Danny Bouman Date: Thu, 4 Sep 2008 11:50:58 -0400 Subject: [PATCH] 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 --- C4/Members.pm | 4 ++-- circ/circulation.pl | 2 +- members/mancredit.pl | 5 ++++- members/maninvoice.pl | 31 +++++++++++++++++-------------- members/member-flags.pl | 4 +++- members/member-password.pl | 4 +++- members/messaging.pl | 3 ++- members/pay.pl | 25 +++++++++++++------------ 8 files changed, 45 insertions(+), 33 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 7df942475d..6c66dd9626 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -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 { diff --git a/circ/circulation.pl b/circ/circulation.pl index 788f5ed361..e6a92d9218 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -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'}, diff --git a/members/mancredit.pl b/members/mancredit.pl index b71233e083..eb25f26127 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -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; diff --git a/members/maninvoice.pl b/members/maninvoice.pl index d5cd765f5c..c9931bdd3c 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -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; } diff --git a/members/member-flags.pl b/members/member-flags.pl index 64de60a16c..d2eea2f87a 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -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'), ); diff --git a/members/member-password.pl b/members/member-password.pl index e538711eb4..4845a0609f 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -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'), diff --git a/members/messaging.pl b/members/messaging.pl index 81821e5a8d..eff6ee49cd 100755 --- a/members/messaging.pl +++ b/members/messaging.pl @@ -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, diff --git a/members/pay.pl b/members/pay.pl index a6504721dc..b782e454e8 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -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; -- 2.39.5