From f46ebf69a001ab3e5525a375301e7aae3db31073 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 4 Dec 2007 15:00:09 -0600 Subject: [PATCH] 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 Signed-off-by: Joshua Ferraro --- circ/circulation.pl | 5 +++++ members/boraccount.pl | 4 ++++ members/mancredit.pl | 8 ++++++++ members/maninvoice.pl | 6 ++++++ members/member-flags.pl | 4 ++++ members/member-password.pl | 5 +++++ members/pay.pl | 5 +++++ members/readingrec.pl | 4 ++++ 8 files changed, 41 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index fd66189307..c277e56554 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -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 diff --git a/members/boraccount.pl b/members/boraccount.pl index eec30d18d8..c1dd6a093c 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -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'}, diff --git a/members/mancredit.pl b/members/mancredit.pl index 2f809d35f9..59f63367ec 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -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'}, diff --git a/members/maninvoice.pl b/members/maninvoice.pl index faa38a8e3f..25903f1098 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -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'}, diff --git a/members/member-flags.pl b/members/member-flags.pl index 46c5cb4cb9..1106b2c044 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -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'}, diff --git a/members/member-password.pl b/members/member-password.pl index 7f170793be..760860b58f 100755 --- a/members/member-password.pl +++ b/members/member-password.pl @@ -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'}, diff --git a/members/pay.pl b/members/pay.pl index eb29032f11..4e060c483f 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -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'}, diff --git a/members/readingrec.pl b/members/readingrec.pl index dcecbf0e75..a7ef3a47c5 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -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'}, -- 2.39.5