Bugzilla – Attachment 67042 Details for
Bug 17492
Show warning if patron's age is out of category limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17492: Followup - adapt the code to current master
Bug-17492-Followup---adapt-the-code-to-current-mas.patch (text/plain), 2.19 KB, created by
Josef Moravec
on 2017-09-11 11:09:46 UTC
(
hide
)
Description:
Bug 17492: Followup - adapt the code to current master
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-09-11 11:09:46 UTC
Size:
2.19 KB
patch
obsolete
>From 9d5a64155232e2742a0feacc4e02582eab273f32 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 11 Sep 2017 10:58:27 +0000 >Subject: [PATCH] Bug 17492: Followup - adapt the code to current master > >--- > circ/circulation.pl | 7 +++---- > members/moremember.pl | 8 +++++--- > 2 files changed, 8 insertions(+), 7 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index c921fd4..1f22bed 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -304,11 +304,10 @@ if ($patron) { > } > > # Calculate and display patron's age >- my $dateofbirth = $borrower->{ 'dateofbirth' }; >- my $age = GetAge($dateofbirth); >+ my $age = $patron->get_age; > >- my $borrowercategory = Koha::Patron::Categories->find($borrower->{ 'categorycode' }); >- my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); >+ my $patroncategory = $patron->category; >+ my ($low,$high) = ($patroncategory->dateofbirthrequired, $patroncategory->upperagelimit); > if (($high && ($age > $high)) or ($age < $low)) { > $template->param( age_limitations => 1 ); > $template->param( age_low => $low ); >diff --git a/members/moremember.pl b/members/moremember.pl >index 64c994b..fcf51f7 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -246,13 +246,15 @@ my $overdues_exist = 0; > my $totalprice = 0; > > # Calculate and display patron's age >+my $age; > if ( $data->{dateofbirth} ) { >- $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age ); >+ $age = Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age; >+ $template->param( age => $age ); > } > > # Check patron's category against age >-my $borrowercategory = Koha::Patron::Categories->find($data->{ 'categorycode' }); >-my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); >+my $patroncategory = Koha::Patron::Categories->find($data->{ 'categorycode' }); >+my ($low,$high) = ($patroncategory->dateofbirthrequired, $patroncategory->upperagelimit); > if (($high && ($age > $high)) or ($age < $low)) { > $template->param( age_limitations => 1 ); > $template->param( age_low => $low ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17492
:
56805
|
56806
|
56874
|
56933
|
56934
|
56935
|
56936
|
56937
|
56976
|
56985
|
56986
|
56987
|
56988
|
56989
|
56990
|
56995
|
62860
|
67040
|
67041
|
67042
|
67850
|
67851
|
67867
|
67868
|
68139
|
68140
|
68141
|
68142
|
68143
|
68144
|
68145
|
91028
|
91029
|
91044
|
91045
|
91098
|
91099
|
91100