Add third gender option (#3436)
authorMatthias Schmidt <gravatronics@live.com>
Sun, 5 Jul 2020 14:45:12 +0000 (16:45 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2020 14:45:12 +0000 (16:45 +0200)
Close #3389

com.woltlab.wcf/userOption.xml
wcfsetup/install/files/acp/templates/userRankAdd.tpl
wcfsetup/install/files/acp/templates/userRankList.tpl
wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 57685b12483f28b672ed7b111556c818dd17eb7f..4bfee239d7143a4b3b4266e657faca59f0fd19e3 100644 (file)
@@ -77,7 +77,8 @@
                                <defaultvalue>0</defaultvalue>
                                <selectoptions>0:wcf.global.noDeclaration
 1:wcf.user.gender.male
-2:wcf.user.gender.female</selectoptions>
+2:wcf.user.gender.female
+3:wcf.user.gender.other</selectoptions>
                                <outputclass>wcf\system\option\user\SelectOptionsUserOptionOutput</outputclass>
                                <searchable>1</searchable>
                                <visible>15</visible>
index 7758939831ea3003aaa1bfff48ff004b885932a5..e30352caff7970791921ce2879659c15ef56460a 100644 (file)
                                        <option value="0">{lang}wcf.global.noSelection{/lang}</option>
                                        <option value="1"{if $requiredGender == 1} selected{/if}>{lang}wcf.user.gender.male{/lang}</option>
                                        <option value="2"{if $requiredGender == 2} selected{/if}>{lang}wcf.user.gender.female{/lang}</option>
+                                       <option value="3"{if $requiredGender == 3} selected{/if}>{lang}wcf.user.gender.other{/lang}</option>
                                </select>
                                {if $errorField == 'requiredGender'}
                                        <small class="innerError">
index 0aa2d4765d40dc1fae18cd6a9315036e6f8e12b6..b50e287632fa6a08ca5d62bc3be108bab6b8d44e 100644 (file)
                                                <td class="columnTitle columnRankTitle"><a href="{link controller='UserRankEdit' id=$userRank->rankID}{/link}" title="{lang}wcf.acp.user.rank.edit{/lang}" class="badge label{if $userRank->cssClassName} {$userRank->cssClassName}{/if}">{$userRank->getTitle()}</a></td>
                                                <td class="columnText columnRankImage">{if $userRank->rankImage}{@$userRank->getImage()}{/if}</td>
                                                <td class="columnText columnGroupID">{$userRank->groupName|language}</td>
-                                               <td class="columnText columnRequiredGender">{if $userRank->requiredGender}{if $userRank->requiredGender == 1}{lang}wcf.user.gender.male{/lang}{else}{lang}wcf.user.gender.female{/lang}{/if}{/if}</td>
+                                               <td class="columnText columnRequiredGender">
+                                                       {if $userRank->requiredGender}
+                                                               {if $userRank->requiredGender == 1}
+                                                                       {lang}wcf.user.gender.male{/lang}
+                                                               {elseif $userRank->requiredGender == 2}
+                                                                       {lang}wcf.user.gender.female{/lang}
+                                                               {else}
+                                                                       {lang}wcf.user.gender.other{/lang}
+                                                               {/if}
+                                                       {/if}
+                                               </td>
                                                <td class="columnDigits columnRequiredPoints">{#$userRank->requiredPoints}</td>
                                                
                                                {event name='columns'}
index 197b5ea2e706e3329d7efb7e863b0c2dec37fbe0..2ff6548ee6377860c7b05562b908600fc0cd71b6 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\acp\form;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\rank\UserRankAction;
 use wcf\data\user\rank\UserRankEditor;
+use wcf\data\user\UserProfile;
 use wcf\form\AbstractForm;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\I18nHandler;
@@ -174,7 +175,7 @@ class UserRankAddForm extends AbstractForm {
                }
                
                // required gender
-               if ($this->requiredGender < 0 || $this->requiredGender > 2) {
+               if ($this->requiredGender < 0 || $this->requiredGender > UserProfile::GENDER_OTHER) {
                        $this->requiredGender = 0;
                }
                
index 13ef2189f941c4e730f0b71e88f547ee7ce94f5d..cd0bf855cd8c300340a166a50be202370e87bd49 100644 (file)
@@ -105,6 +105,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
        
        const GENDER_MALE = 1;
        const GENDER_FEMALE = 2;
+       const GENDER_OTHER = 3;
        
        const ACCESS_EVERYONE = 0;
        const ACCESS_REGISTERED = 1;
index 093f77dd7996a579505e06a197627244bc534a27..84acf9d36ea32350a319ecd918fe783f19f72848 100644 (file)
@@ -4511,6 +4511,7 @@ Dateianhänge:
                <item name="wcf.user.usernameOrEmail"><![CDATA[Benutzername oder E-Mail-Adresse]]></item>
                <item name="wcf.user.gender.male"><![CDATA[Männlich]]></item>
                <item name="wcf.user.gender.female"><![CDATA[Weiblich]]></item>
+               <item name="wcf.user.gender.other"><![CDATA[Divers]]></item>
                <item name="wcf.user.members"><![CDATA[Mitglieder]]></item>
                <item name="wcf.user.members.filter"><![CDATA[Mitglieder filtern]]></item>
                <item name="wcf.user.members.noMembers"><![CDATA[Es wurden keine Mitglieder gefunden. <a href="{link controller='MembersList'}{/link}">Die aktiven Filter zurücksetzen.</a>]]></item>
index f2a50409489770097172a1aa55c9b3125f984bd0..cc66fa176d0caea5632ad403d08906ef0a8ffd88 100644 (file)
@@ -4512,6 +4512,7 @@ Attachments:
                <item name="wcf.user.usernameOrEmail"><![CDATA[Username or Email Address]]></item>
                <item name="wcf.user.gender.male"><![CDATA[Male]]></item>
                <item name="wcf.user.gender.female"><![CDATA[Female]]></item>
+               <item name="wcf.user.gender.other"><![CDATA[Other]]></item>
                <item name="wcf.user.members"><![CDATA[Members]]></item>
                <item name="wcf.user.members.filter"><![CDATA[Filter Members]]></item>
                <item name="wcf.user.members.noMembers"><![CDATA[No members matched your criteria. <a href="{link controller='MembersList'}{/link}">Reset the applied filters.</a>]]></item>