Passing "adultborrower" variable to the template so that "Add Child" button can be displayed in the toolbar when appropriate. Fixes Bug 1510.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Owen Leonard 2007-12-04 15:00:09 -06:00 committed by Joshua Ferraro
parent bf413a98c9
commit f46ebf69a0
8 changed files with 41 additions and 0 deletions

View File

@ -620,6 +620,10 @@ if ( C4::Context->preference("memberofinstitution") ) {
$amountold = $temp[1];
my $borrowercategory = GetBorrowercategory( $borrower->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
issued_itemtypes_count_loop => $issued_itemtypes_loop,
findborrower => $findborrower,
@ -651,6 +655,7 @@ $template->param(
inprocess => $inprocess,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
);
# set return date if stickyduedate

View File

@ -86,6 +86,10 @@ for (my $i=0;$i<$numaccts;$i++){
push(@accountrows, \%row);
}
my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
finesview => 1,
firstname => $data->{'firstname'},

View File

@ -45,6 +45,9 @@ if ($add){
manualinvoice($borrowernumber,$itemnum,$desc,$type,$amount);
print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
} else {
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/mancredit.tmpl",
query => $input,
@ -53,6 +56,11 @@ if ($add){
flagsrequired => {borrowers => 1},
debug => 1,
});
my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
borrowernumber => $borrowernumber,
firstname => $data->{'firstname'},

View File

@ -65,6 +65,7 @@ if ($add){
exit;
}
} else {
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "members/maninvoice.tmpl",
query => $input,
@ -73,6 +74,11 @@ if ($add){
flagsrequired => {borrowers => 1},
debug => 1,
});
my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
borrowernumber => $borrowernumber,
firstname => $data->{'firstname'},

View File

@ -68,6 +68,10 @@ if ($input->param('newflags')) {
push @loop, \%row;
}
my $borrowercategory = GetBorrowercategory( $bor->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(borrowernumber => $member,
borrowernumber => $bor->{'borrowernumber'},
cardnumber => $bor->{'cardnumber'},

View File

@ -76,6 +76,11 @@ if ( $newpassword && ! $errormsg ) {
for (my $i=0; $i<$length; $i++) {
$defaultnewpassword.=substr($chars, int(rand(length($chars))),1);
}
my $borrowercategory = GetBorrowercategory( $bor->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param( othernames => $bor->{'othernames'},
surname => $bor->{'surname'},
firstname => $bor->{'firstname'},

View File

@ -128,6 +128,11 @@ if ( $check == 0 ) {
'total' => $totalnotify
};
}
my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
allfile => \@allfile,
firstname => $data->{'firstname'},

View File

@ -76,6 +76,10 @@ for (my $i=0;$i<$count;$i++){
push(@loop_reading,\%line);
}
my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
my $category_type = $borrowercategory->{'category_type'};
( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
$template->param(
biblionumber => $data->{'biblionumber'},
title => $data->{'title'},