Bug 15343 [QA Followup] - Fix issues
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 18 Dec 2015 19:30:13 +0000 (19:30 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 24 Feb 2016 04:04:04 +0000 (04:04 +0000)
1) "Contact information" should be "Password"
2) Don't pass sysprefs from the script to the template, use Koha.Preference()
3) minPasswordLength is optional, we cannot always assume it is set
4) Password field when does not follow convention completely when mandatory

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
opac/opac-memberentry.pl

index 90f4b83..a57ab0c 100644 (file)
                     </fieldset>
                 [% END %]
 
-                [% UNLESS action == 'edit' %]
+                [% UNLESS action == 'edit' || hidden.defined('password') %]
                     <fieldset class="rows" id="memberentry_password">
-                        <legend id="contact_legend">Contact information</legend>
-                    [% UNLESS hidden.defined('password') %]
-                        <div class="alert alert-info">Your password must be at least [% minpassw %] characters long.
+                        <legend id="contact_legend">Password</legend>
+                        [% IF Koha.Preference('minPasswordLength') || !mandatory.defined('password') %]
+                            <div class="alert alert-info">
+                                [% IF Koha.Preference('minPasswordLength') %]
+                                    <p>Your password must be at least [% Koha.Preference('minPasswordLength') %] characters long.</p>
+                                [% END %]
+                                [% UNLESS mandatory.defined('password') %]
+                                    If you do not enter a password a system generated password will be created.
+                                [% END %]
+                            </div>
+                        [% END %]
+
                         [% IF mandatory.defined('password') %]
-                            <br>You must enter a password!</div>
                             <ol>
                                 <li><label for="borrower_password" class="required">Password</label>
                                     <input type="text" name="borrower_password" id="password" />
+                                    <span class="required">Required</span>
                                 </li>
                                 <li><label for="borrower_password2" class="required">Confirm password</label>
                                     <input type="text" name="borrower_password2" id="password2" />
+                                    <span class="required">Required</span>
                                 </li>
                             </ol>
                         [% ELSE %]
-                            <br>If you do not enter a password a system generated password will be created</div>
                             <ol>
                                 <li><label for="borrower_password">Password</label>
                                     <input type="text" name="borrower_password" id="password" />
                                 </li>
                             </ol>
                         [% END %]
-                    [% END %]
                     </fieldset>
 
                     <fieldset class="rows" id="memberentry_captcha">
index 86135cd..a453f75 100755 (executable)
@@ -67,7 +67,6 @@ $template->param(
     action            => $action,
     hidden            => $hidden,
     mandatory         => $mandatory,
-    minpassw          => C4::Context->preference('minPasswordLength'),
     member_titles     => GetTitles() || undef,
     branches          => GetBranchesLoop(),
     OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),