From 8df9ba7ec5c8a01b1a12ebab12c5b965441d0f21 Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Thu, 21 Dec 2017 10:20:48 -0500 Subject: [PATCH] Bug 19466: Warn about conflicting settings of autoMemberNum and BorrowerMandatoryField for cardnumber Changes the appearance of the cardnumber entry field in memberentrygen.tt The "Leave empty for autocalc" message has been moved to the hint div under the input field. If AutoMemberNum and BorrowerMandatoryField interfere with each other, the auto calc hint is replace by a warning telling the user that auto calc has been disabled. Cardnumber should now correctly appear as mandatory if marked as such in BorrowerMandatoryField. Test plan: 0] Apply patch 1} Disable AutoMemberNum, remove cardnumber from BorrowerMandatoryField 2) Edit or create a patron, scroll down to cardnumber input field Hint is some form of "Cardnumber must be this long" Cardnumber input is not marked as required There is no mention of auto calc 3> Enable AutoMemberNum Hint includes "Leave empty for auto calc" message 4~ Add cardnumber to BorrowerMandatoryField Hint warns you that your sysprefs are conflicting. Cardnumber input is marked as required 5: Disable AutoMemberNum Hint is some form of "Cardnumber must be this long" Cardnumber input is marked as required Signed-off-by: Claire Gravely Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/memberentrygen.tt | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 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 ed02f796ee..73a06fc874 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -653,33 +653,39 @@ $(document).ready(function() { Library management
    [% UNLESS nocardnumber %]
  1. - [% IF mandatorycardnumber and not autoMemberNum %] + [% IF mandatorycardnumber %] - [% END %] + Card number: + + [% IF minlength_cardnumber == maxlength_cardnumber %] - [% IF mandatorycardnumber and not autoMemberNum %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. -
    Card number must be exactly [% minlength_cardnumber %] characters.
    + [% IF mandatorycardnumber %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. +
    Card number must be exactly [% minlength_cardnumber %] characters. [% ELSIF minlength_cardnumber && maxlength_cardnumber %] - [% IF mandatorycardnumber and not autoMemberNum %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. -
    Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters.
    + [% IF mandatorycardnumber %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. +
    Card number must be between [% minlength_cardnumber %] and [% maxlength_cardnumber %] characters. [% ELSIF maxlength_cardnumber %] - [% IF mandatorycardnumber and not autoMemberNum %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. -
    Card number can be up to [% maxlength_cardnumber %] characters.
    + [% IF mandatorycardnumber %]Required[% END %]Card number must not be more than [% maxlength_cardnumber %] characters. +
    Card number can be up to [% maxlength_cardnumber %] characters. [% ELSE %] - [% IF mandatorycardnumber and not autoMemberNum %]Required[% END %] -
    There is no minimum or maximum character length.
    + [% IF mandatorycardnumber %]Required[% END %] +
    There is no minimum or maximum character length. + [% END %] + [% IF autoMemberNum %] + [% IF mandatorycardnumber %] +
    AutoMemberNum is set to enabled, but cardnumber is marked as mandatory in BorrowerMandatoryField: auto calc has been disabled. + [% ELSE %] +
    Leave empty for auto calc during registration + [% END %] [% END %] +
  2. [% END %] [% UNLESS nobranchcode %] -- 2.39.5