Bug 11809: don't display 'Clear date' on OPAC patron details form if date of birth...
authorOwen Leonard <oleonard@myacpl.org>
Fri, 21 Feb 2014 15:35:40 +0000 (10:35 -0500)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 6 Jun 2014 13:24:43 +0000 (09:24 -0400)
On the OPAC's patron details form, if the date of birth field is
required we shouldn't offer the user a "clear date." This patch removes
the "clear date" link if the field is required.

To test, configure the BorrowerMandatoryField system preference to
require dateofbirth. Enable the OPACPatronDetails system preference and
log in to the OPAC. View the "personal details" form and confirm that
there is no "clear date" link next to the required date of birth field.

Remove dateofbirth from the BorrowerMandatoryField system preference and
re-test. The "clear date" link should appear.

Test in both prog and Bootstrap themes.

I tested with prog and bootstrap themes, adding/removing field 'dateofbirth'
in sys pref PatronSelfRegistrationBorrowerMandatoryField.
Patch behaves as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as expected, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 234560a690c78ef7723f15c0cb31f0497d073988)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit d10087c9765997fdf6db9ed8608a780f175cdda0)

koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt

index 145ad6c..0c963e1 100644 (file)
                                                     <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
 
                                                     [% UNLESS action == 'edit' && !OPACPatronDetails %]
-                                                        <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a>
+                                                        [% UNLESS ( mandatory.defined('dateofbirth') ) %]
+                                                            <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a>
+                                                        [% END %]
                                                     [% END %]
 
                                                     [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]