Bugzilla – Attachment 108283 Details for
Bug 26211
Patron age verification while doing the self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26211-Patron age checking while doing the membership registration through OPAC
0001-Bug-26211-Patron-age-checking-while-doing-the-member.patch (text/plain), 2.98 KB, created by
Amit Gupta
on 2020-08-14 14:10:09 UTC
(
hide
)
Description:
Bug 26211-Patron age checking while doing the membership registration through OPAC
Filename:
MIME Type:
Creator:
Amit Gupta
Created:
2020-08-14 14:10:09 UTC
Size:
2.98 KB
patch
obsolete
>From 1e5df51f8fe8ade00a978232e5a138f019741991 Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amit.gupta@informaticsglobal.com> >Date: Fri, 14 Aug 2020 13:59:10 +0000 >Subject: [PATCH] Bug 26211 - Patron age checking while doing the membership > registration through OPAC > >To Test >1. Create the patron category from the staff page for ex: Kid and give age required and age Upperage limit > age required 5 yrs and upperage limit 17. >2. Allow category in PatronSelfRegistrationDefaultCategory for online registration from opac. >3. Go to /cgi-bin/koha/opac-memberentry.pl page. >4. Fill the form and give choose date of birth 10/10/1974 and click OK. Now you can able to save the page. >5. Apply the patch. >6. Again go to cgi-bin/koha/opac-memberentry.pl page. >7. Fill the form and give choose date of birth 10/10/1974 and click OK. It will give the error message. > Patron's age is incorrect for their category. Ages allowed are 5-17. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 3 +++ > opac/opac-memberentry.pl | 12 ++++++++++++ > 2 files changed, 15 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index 7acd45a..60cf7c2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -96,6 +96,9 @@ > [% IF field == "email_match" %] > <li>Emails do not match! <a href="#borrower_repeat_email">confirm email address</a></li> > [% END %] >+ [% IF field == "ERROR_age_limitations" %] >+ <li>Patron's age is incorrect for their category. Ages allowed are [% age_low | html %]-[% age_high | html %].</li> >+ [% END %] > [% END %] > </ul> > <span>Please correct and resubmit.</span> >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index a076cd3..b6e324b 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -474,6 +474,18 @@ sub CheckForInvalidFields { > push @invalidFields, 'password_has_whitespaces' if $error eq 'has_whitespaces'; > } > } >+ >+ if ($borrower->{'dateofbirth'}) { >+ my $patron = Koha::Patron->new({ dateofbirth => $borrower->{'dateofbirth'} }); >+ my $age = $patron->get_age; >+ my $borrowercategory = Koha::Patron::Categories->find( $borrower->{'categorycode'} ); >+ my ($low, $high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); >+ if (($high && ($age > $high)) or ($age < $low)) { >+ push @invalidFields, 'ERROR_age_limitations'; >+ $template->param( age_low => $low); >+ $template->param( age_high => $high); >+ } >+ } > > return \@invalidFields; > } >-- >2.7.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 26211
:
108283
|
108303