Bugzilla – Attachment 10928 Details for
Bug 8464
Age limitations not handled during patron creation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #1
0001-Bug-8464-Age-limitations-during-patron-creation.patch (text/plain), 3.07 KB, created by
Adrien SAURAT
on 2012-07-18 09:15:54 UTC
(
hide
)
Description:
proposed patch #1
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-07-18 09:15:54 UTC
Size:
3.07 KB
patch
obsolete
>From fe5357ccfe759ac126a23915c19b3c097cc1f658 Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Wed, 18 Jul 2012 11:14:13 +0200 >Subject: [PATCH] Bug 8464: Age limitations during patron creation > >The age limitations defined in patron category were not >handled during patron creation. >--- > .../prog/en/modules/members/memberentrygen.tt | 2 +- > members/memberentry.pl | 14 +++++++------- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 1f28b04..bfa641e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -168,7 +168,7 @@ > [% END %] > [% IF ( ERROR_age_limitations ) %] > <li id="ERROR_age_limitations">Patron's age is incorrect for their category. >- Ages allowed are [% ERROR_age_limitations %].</li> >+ Ages allowed are [% allowedAgeRange %].</li> > [% END %] > [% IF ( ERROR_branch ) %] > <li id="ERROR_branch">Library is invalid.</li> >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 58f5cf1..724d438 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -97,14 +97,14 @@ $template->param("minPasswordLength" => $minpw); > > # function to designate mandatory fields (visually with css) > my $check_BorrowerMandatoryField=C4::Context->preference("BorrowerMandatoryField"); >-my @field_check=split(/\|/,$check_BorrowerMandatoryField); >-foreach (@field_check) { >+my @field_check_mandatory=split(/\|/,$check_BorrowerMandatoryField); >+foreach (@field_check_mandatory) { > $template->param( "mandatory$_" => 1); > } > # function to designate unwanted fields > my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField"); >-@field_check=split(/\|/,$check_BorrowerUnwantedField); >-foreach (@field_check) { >+my @field_check_unwanted=split(/\|/,$check_BorrowerUnwantedField); >+foreach (@field_check_unwanted) { > next unless m/\w/o; > $template->param( "no$_" => 1); > } >@@ -263,15 +263,15 @@ if ($op eq 'save' || $op eq 'insert'){ > > if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ > push @errors, 'ERROR_cardnumber'; >- } >- my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0; >+ } >+ my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check_mandatory) ? 1 : 0; > if ($newdata{dateofbirth} && $dateofbirthmandatory) { > my $age = GetAge($newdata{dateofbirth}); > my $borrowercategory=GetBorrowercategory($newdata{'categorycode'}); > my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'}); > if (($high && ($age > $high)) or ($age < $low)) { > push @errors, 'ERROR_age_limitations'; >- $template->param('ERROR_age_limitations' => "$low to $high"); >+ $template->param('allowedAgeRange' => "$low to $high"); > } > } > >-- >1.7.4.1 >
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 8464
: 10928