Bugzilla – Attachment 38599 Details for
Bug 11925
patron category not checking ages limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11925: Check ages limits when creating/updating patrons
Bug-11925-Check-ages-limits-when-creatingupdating-.patch (text/plain), 1.74 KB, created by
Jonathan Druart
on 2015-04-28 09:49:58 UTC
(
hide
)
Description:
Bug 11925: Check ages limits when creating/updating patrons
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-28 09:49:58 UTC
Size:
1.74 KB
patch
obsolete
>From 73733e8fdf93947fa34fac0bd9de1dfa4962fe37 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 28 Apr 2015 11:45:46 +0200 >Subject: [PATCH] Bug 11925: Check ages limits when creating/updating patrons > >The check on the ages limits is only done when the dateofbirth field is >mandatory, which does not make any sense. >This check should be done when the field is filled. > >Test plan: >1/ Remove the dateofbirth field from the BorrowerMandatoryField pref >2/ Create a patron category for teenager (say between 12-17y) >3/ Try to create a patron in this category outside the range of the ages >limits. >You should not be able to do it. >--- > members/memberentry.pl | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 22bceab..967ebd1 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -135,8 +135,6 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField); > foreach (@field_check) { > $template->param( "mandatory$_" => 1); > } >-# we'll need this, later. >-my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0; > # function to designate unwanted fields > my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField"); > @field_check=split(/\|/,$check_BorrowerUnwantedField); >@@ -305,7 +303,7 @@ if ($op eq 'save' || $op eq 'insert'){ > : () > } > >- if ($newdata{dateofbirth} && $dateofbirthmandatory) { >+ if ( $newdata{dateofbirth} ) { > my $age = GetAge($newdata{dateofbirth}); > my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); > my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); >-- >2.1.0
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 11925
:
38599
|
38690
|
38706