Bug 15691: Show card number minimum and maximum in visible hint when adding a patron
The CardnumberLength system preference defines card number minimum and maximum allowed values when adding a patron. This information is currently hidden in a title attribute on the card number input field. This patch moves the information into a <div class="hint">, matching other fields in the entry form which offer details about entry guidelines. To test, apply the patch and open the new patron entry form. Test for various values of CardnumberLength, and with 'cardnumber' mandatory or not mandatory as defined in BorrowerMandatoryField. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
parent
a382c8c1cb
commit
9f172a3c1b
1 changed files with 12 additions and 5 deletions
|
@ -633,15 +633,22 @@
|
|||
[% END %]
|
||||
Card number: </label>
|
||||
[% IF minlength_cardnumber == maxlength_cardnumber %]
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="exactly [% minlength_cardnumber %] characters" />
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
|
||||
[% IF ( mandatorycardnumber ) %]<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="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters" />
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" minlength="[% minlength_cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
|
||||
[% IF ( mandatorycardnumber ) %]<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="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" title="up to [% maxlength_cardnumber %] characters" />
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" maxlength="[% maxlength_cardnumber %]" />
|
||||
[% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
|
||||
<div class="hint">Card number can be up to [% maxlength_cardnumber %] characters.</div>
|
||||
[% ELSE %]
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
|
||||
<input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
|
||||
[% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
|
||||
<div class="hint">There is no minimum or maximum character length.</div>
|
||||
[% END %]
|
||||
[% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]
|
||||
</li>
|
||||
[% END %]
|
||||
[% UNLESS nobranchcode %]
|
||||
|
|
Loading…
Reference in a new issue