Bugzilla – Attachment 55531 Details for
Bug 17213
Self registration cardnumber is not editable if errors found when form submitted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17213 - Add HTML5 validation to cardnumber field on patron self registration
Bug-17213---Add-HTML5-validation-to-cardnumber-fie.patch (text/plain), 4.54 KB, created by
Nick Clemens (kidclamp)
on 2016-09-13 13:37:31 UTC
(
hide
)
Description:
Bug 17213 - Add HTML5 validation to cardnumber field on patron self registration
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-09-13 13:37:31 UTC
Size:
4.54 KB
patch
obsolete
>From c4e68d3708959ff79d57a8a948dce58a20454122 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 29 Aug 2016 10:54:30 +0000 >Subject: [PATCH] Bug 17213 - Add HTML5 validation to cardnumber field on > patron self registration > >To test: >Verify that different values in 'CardnumberLength' system preference >display correctly in the self reigstration form > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../bootstrap/en/modules/opac-memberentry.tt | 19 +++++++++++++++++-- > opac/opac-memberentry.pl | 7 +++++++ > 2 files changed, 24 insertions(+), 2 deletions(-) > >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 f231015..53401b9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -137,8 +137,23 @@ > [% IF borrower && !(cardnumber_wrong_length || cardnumber_already_exists) %] > [% borrower.cardnumber %] > [% ELSE %] >- <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" value="[% borrower.cardnumber %]" /> >- [% IF mandatory.defined('cardnumber') %]<span class="required">Required</span>[% END %] >+ [% IF minlength_cardnumber == maxlength_cardnumber %] >+ <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" /> >+ [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %] >+ <div class="hint">Card number must be exactly [% minlength_cardnumber %] characters.</div> >+ [% ELSIF minlength_cardnumber && maxlength_cardnumber %] >+ <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" /> >+ [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %] >+ <div class="hint">Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.</div> >+ [% ELSIF maxlength_cardnumber %] >+ <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber %]" maxlength="[% maxlength_cardnumber %]" /> >+ [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %] >+ <div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div> >+ [% ELSE %] >+ <input type="text" id="borrower_cardnumber" name="borrower_cardnumber" size="20" value="[% borrower.cardnumber %]" /> >+ [% IF ( mandatory.defined('cardnumber') ) %]<span class="required">Required</span>[% END %] >+ <div class="hint">There is no minimum or maximum character length.</div> >+ [% END %] > [% END %] > </li> > [% END %] >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 34f9ac8..3fd4c1f 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -70,6 +70,13 @@ my @libraries = Koha::Libraries->search; > if ( my @libraries_to_display = split '\|', C4::Context->preference('PatronSelfRegistrationLibraryList') ) { > @libraries = map { my $b = $_; my $branchcode = $_->branchcode; grep( /^$branchcode$/, @libraries_to_display ) ? $b : () } @libraries; > } >+my ( $min, $max ) = C4::Members::get_cardnumber_length(); >+if ( defined $min ) { >+ $template->param( >+ minlength_cardnumber => $min, >+ maxlength_cardnumber => $max >+ ); >+ } > > $template->param( > action => $action, >-- >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 17213
:
54970
|
54971
|
55097
|
55449
|
55450
|
55530
|
55531
|
55665
|
55666
|
55667