From 66e70c9201162f1188f3289ddfa53d195e58f672 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Mon, 4 May 2020 02:29:14 +0000 Subject: [PATCH] Bug 25364: Add "Other" to the gender options in a patron record This patch adds "Other" as an option, and also changes the wording of "None specified" slightly. To test: 1) Apply the patch 2) Check that there is an "Other" radio button in the patron record, and that the wording of "None specified" has changed to "None specified / Prefer not to say". 3) Check that you can save changes to the gender of this patron record, both on create and modify. 4) Check that these changes also work in the Opac Self-Registration functionality. Correct typos in previous commit Signed-off-by: Devinim Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/memberentrygen.tt | 26 ++++++++++++------- .../en/modules/members/moremember-brief.tt | 2 +- .../prog/en/modules/members/moremember.tt | 2 +- .../bootstrap/en/modules/opac-memberentry.tt | 14 +++++++--- members/memberentry.pl | 2 ++ 5 files changed, 31 insertions(+), 15 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 5f5978b0a8..006e3baa54 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -379,24 +379,30 @@ legend:hover {
  • [% UNLESS ( opduplicate ) %] [% IF ( female ) %] - + [% ELSE %] - + [% END %] [% IF ( male ) %] - + [% ELSE %] - + + [% END %] + [% IF ( other ) %] + + [% ELSE %] + [% END %] [% IF ( none ) %] - + [% ELSE %] - + [% END %] [% ELSE %] - - - + + + + [% END # /UNLESS ( opduplicate )%]
  • [% END # /UNLESS nosex %] @@ -1603,7 +1609,7 @@ legend:hover { } $(toggle_from).each(function() { var input_label = $(this).attr('for'); - if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' ) { + if ( input_label == 'sex-male' || input_label == 'sex-none' || input_label == 'sex-female' || input_label == 'sex-other' ) { $(toggle_to+"[for='"+input_label+"']").next().prop('checked', $(this).next().prop('checked') ); return; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index 2b4391b59c..641121eac0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -36,7 +36,7 @@ [% UNLESS ( I ) %] [% IF ( patron.initials ) %]
  • Initials: [% patron.initials | html %]
  • [% END %] [% IF ( patron.dateofbirth ) %]
  • Date of birth:[% patron.dateofbirth | $KohaDates %]
  • [% END %] - [% IF ( patron.sex ) %]
  • Gender:[% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex | html %][% END %]
  • [% END %] + [% IF ( patron.sex ) %]
  • Gender:[% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSIF ( patron.sex == 'O' ) %]Other[% ELSE %][% patron.sex | html %][% END %]
  • [% END %] [% END %] [% IF guarantees %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 11f9897ef0..d18bf5d558 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -255,7 +255,7 @@ [% IF ( patron.sex ) %]
  • Gender: - [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex | html %][% END %] + [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSIF (patron.sex == 'O' ) %]Other[% ELSE %][% patron.sex | html %][% END %]
  • [% END %] [% END %] 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 645f53dd75..faace88613 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -372,21 +372,29 @@ [% UNLESS hidden.defined('sex') %]
  • - + [% IF borrower.sex == 'F' %] [% ELSE %] [% END %] - + [% IF borrower.sex == 'M' %] [% ELSE %] [% END %] - + + [% IF borrower.sex == 'O' %] + + [% ELSE %] + + [% END %] + + + [% IF borrower.sex == '' %] [% ELSE %] diff --git a/members/memberentry.pl b/members/memberentry.pl index 985a96446c..671ec5cf6d 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -650,6 +650,8 @@ if(!defined($data{'sex'})){ $template->param( female => 1); } elsif ($data{'sex'} eq 'M'){ $template->param( male => 1); +} elsif ($data{'sex'} eq 'O') { + $template->param( other => 1); } else { $template->param( none => 1); } -- 2.39.5