Bug 25364: Add "Other" to the gender options in a patron record
authorDavid Roberts <david@koha-ptfs.co.uk>
Mon, 4 May 2020 02:29:14 +0000 (02:29 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2020 15:39:48 +0000 (17:39 +0200)
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 <kohadevinim@devinim.com.tr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt
members/memberentry.pl

index 5f5978b..006e3ba 100644 (file)
@@ -379,24 +379,30 @@ legend:hover {
                                                     <li class="radio">
                                                         [% UNLESS ( opduplicate ) %]
                                                             [% IF ( female ) %]
-                                                                <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /> Female</label>
+                                                                <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" checked="checked" /><span class="patronsex-female"> Female</span></label>
                                                             [% ELSE %]
-                                                                <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /> Female</label>
+                                                                <label for="sex-female"><input type="radio" name="sex" id="sex-female" value="F" /><span class="patronsex-female"> Female</span></label>
                                                             [% END %]
                                                             [% IF ( male ) %]
-                                                                <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /> Male</label>
+                                                                <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" checked="checked" /><span class="patronsex-male"> Male</span></label>
                                                             [% ELSE %]
-                                                                <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /> Male</label>
+                                                                <label for="sex-male"><input type="radio" name="sex" id="sex-male" value="M" /><span class="patronsex-male"> Male</span></label>
+                                                            [% END %]
+                                                            [% IF ( other ) %]
+                                                                <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" checked="checked" /><span class="patronsex-other"> Other</span></label>
+                                                            [% ELSE %]
+                                                                <label for="sex-other"><input type="radio" name="sex" id="sex-other" value="O" /><span class="patronsex-other"> Other</span></label>
                                                             [% END %]
                                                             [% IF ( none ) %]
-                                                                <label for="sex-none"><input type="radio" name="sex" id="sex-none" value=""  checked="checked" /> None specified</label>
+                                                                <label for="sex-none"><input type="radio" name="sex" id="sex-none" value=""  checked="checked" /><span class="patronsex-none"> None specified / Prefer not to say</span></label>
                                                             [% ELSE %]
-                                                                <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /> None specified</label>
+                                                                <label for="sex-none"><input type="radio" name="sex" id="sex-none" value="" /><span class="patronsex-none"> None specified / Prefer not to say</span></label>
                                                             [% END %]
                                                         [% ELSE %]
-                                                            <label for="sex-female">Female </label><input type="radio" name="sex" id="sex-female" value="F" />
-                                                            <label for="sex-male">Male </label><input type="radio" name="sex" id="sex-male" value="M" />
-                                                            <label for="sex-none">None specified </label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
+                                                            <label for="sex-female"><span class="patronsex-female">Female </span></label><input type="radio" name="sex" id="sex-female" value="F" />
+                                                            <label for="sex-male"><span class="patronsex-male">Male </span></label><input type="radio" name="sex" id="sex-male" value="M" />
+                                                            <label for="sex-other"><span class="patronsex-other">Other </span></label><input type="radio" name="sex" id="sex-other" value="O" />
+                                                            <label for="sex-none"><span class="patronsex-none">None specified / Prefer not to say </span></label><input type="radio" name="sex" id="sex-none" value="" checked="checked" />
                                                         [% END # /UNLESS ( opduplicate )%]
                                                     </li>
                                                 [% 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;
                     }
index 2b4391b..641121e 100644 (file)
@@ -36,7 +36,7 @@
             [% UNLESS ( I ) %]
                 [% IF ( patron.initials ) %]<li><span class="label">Initials: </span>[% patron.initials | html %]</li>[% END %]
                 [% IF ( patron.dateofbirth ) %]<li><span class="label">Date of birth:</span>[% patron.dateofbirth | $KohaDates %]</li>[% END %]
-                [% IF ( patron.sex ) %]<li><span class="label">Gender:</span>[% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex | html %][% END %]</li>[% END %]
+                [% IF ( patron.sex ) %]<li><span class="label">Gender:</span>[% IF ( patron.sex == 'F' ) %]<span class="patronsex-female">Female</span>[% ELSIF ( patron.sex == 'M' ) %]<span class="patronsex-male">Male</span>[% ELSIF ( patron.sex == 'O' ) %]<span class="patronsex-other">Other</span>[% ELSE %][% patron.sex | html %][% END %]</li>[% END %]
             [% END %]
 
             [% IF guarantees %]
index 11f9897..d18bf5d 100644 (file)
                                             [% IF ( patron.sex ) %]
                                                 <li>
                                                     <span class="label">Gender:</span>
-                                                    [% IF ( patron.sex == 'F' ) %]Female[% ELSIF ( patron.sex == 'M' ) %]Male[% ELSE %][% patron.sex | html %][% END %]
+                                                    [% IF ( patron.sex == 'F' ) %]<span class="patronsex-female">Female</span>[% ELSIF ( patron.sex == 'M' ) %]<span class="patronsex-male">Male</span>[% ELSIF (patron.sex == 'O' ) %]<span class="patronsex-other">Other</span>[% ELSE %][% patron.sex | html %][% END %]
                                                 </li>
                                             [% END %]
                                         [% END %]
index 645f53d..faace88 100644 (file)
 
                                     [% UNLESS hidden.defined('sex') %]
                                         <li class="lradio">
-                                            <label for="sex-female" class="radio inline">Female:</label>
+                                            <label for="sex-female" class="radio inline"><span class="patronsex-female">Female:</span></label>
                                             [% IF borrower.sex == 'F' %]
                                                 <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
                                             [% ELSE %]
                                                 <input type="radio" name="borrower_sex" id="sex-female" value="F" />
                                             [% END %]
 
-                                            <label for="sex-male" class="radio inline">Male:</label>
+                                            <label for="sex-male" class="radio inline"><span class="patronsex-male">Male:</span></label>
                                             [% IF borrower.sex == 'M' %]
                                                 <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
                                             [% ELSE %]
                                                 <input type="radio" name="borrower_sex" id="sex-male" value="M" />
                                             [% END %]
 
-                                            <label for="sex-none" class="radio inline">None specified: </label>
+                                            <label for="sex-other" class="radio inline"><span class="patronsex-other">Other:</span></label>
+                                            [% IF borrower.sex == 'O' %]
+                                                <input type="radio" name="borrower_sex" id="sex-other" value="O" checked="checked" />
+                                            [% ELSE %]
+                                                <input type="radio" name="borrower_sex" id="sex-other" value="O" />
+                                            [% END %]
+
+
+                                            <label for="sex-none" class="radio inline"><span class="patronsex-none">None specified / Prefer not to say:</span></label>
                                             [% IF borrower.sex == '' %]
                                                 <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
                                             [% ELSE %]
index 985a964..671ec5c 100755 (executable)
@@ -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);
 }