From 234560a690c78ef7723f15c0cb31f0497d073988 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 21 Feb 2014 10:35:40 -0500 Subject: [PATCH] Bug 11809: don't display 'Clear date' on OPAC patron details form if date of birth is required MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Katrin Fischer Works as expected, passes all tests and QA script. Signed-off-by: Galen Charlton --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 4 +++- koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt | 4 +++- 2 files changed, 6 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 cbfd3f2c88..4417171302 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -166,7 +166,9 @@ [% UNLESS action == 'edit' && !OPACPatronDetails %] - Clear date + [% UNLESS ( mandatory.defined('dateofbirth') ) %] + Clear date + [% END %] [% END %] [% IF mandatory.defined('dateofbirth') %]Required[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt index 22a355ebca..0e21010a17 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt @@ -173,7 +173,9 @@ [% UNLESS action == 'edit' && !OPACPatronDetails %] - Clear date + [% UNLESS ( mandatory.defined('dateofbirth') ) %] + Clear date + [% END %] [% END %] [% IF mandatory.defined('dateofbirth') %]Required[% END %] -- 2.39.2