From: Matthias Schmidt Date: Sun, 5 Jul 2020 14:45:12 +0000 (+0200) Subject: Add third gender option (#3436) X-Git-Tag: 5.3.0_Alpha_1~156 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe0457a9b373fcfaf160dd3207fed8c12dce84aa;p=GitHub%2FWoltLab%2FWCF.git Add third gender option (#3436) Close #3389 --- diff --git a/com.woltlab.wcf/userOption.xml b/com.woltlab.wcf/userOption.xml index 57685b1248..4bfee239d7 100644 --- a/com.woltlab.wcf/userOption.xml +++ b/com.woltlab.wcf/userOption.xml @@ -77,7 +77,8 @@ 0 0:wcf.global.noDeclaration 1:wcf.user.gender.male -2:wcf.user.gender.female +2:wcf.user.gender.female +3:wcf.user.gender.other wcf\system\option\user\SelectOptionsUserOptionOutput 1 15 diff --git a/wcfsetup/install/files/acp/templates/userRankAdd.tpl b/wcfsetup/install/files/acp/templates/userRankAdd.tpl index 7758939831..e30352caff 100644 --- a/wcfsetup/install/files/acp/templates/userRankAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userRankAdd.tpl @@ -161,6 +161,7 @@ + {if $errorField == 'requiredGender'} diff --git a/wcfsetup/install/files/acp/templates/userRankList.tpl b/wcfsetup/install/files/acp/templates/userRankList.tpl index 0aa2d4765d..b50e287632 100644 --- a/wcfsetup/install/files/acp/templates/userRankList.tpl +++ b/wcfsetup/install/files/acp/templates/userRankList.tpl @@ -55,7 +55,17 @@ {$userRank->getTitle()} {if $userRank->rankImage}{@$userRank->getImage()}{/if} {$userRank->groupName|language} - {if $userRank->requiredGender}{if $userRank->requiredGender == 1}{lang}wcf.user.gender.male{/lang}{else}{lang}wcf.user.gender.female{/lang}{/if}{/if} + + {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} + {#$userRank->requiredPoints} {event name='columns'} diff --git a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php index 197b5ea2e7..2ff6548ee6 100644 --- a/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php @@ -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; } diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index 13ef2189f9..cd0bf855cd 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -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; diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 093f77dd79..84acf9d36e 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -4511,6 +4511,7 @@ Dateianhänge: + Die aktiven Filter zurücksetzen.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index f2a5040948..cc66fa176d 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -4512,6 +4512,7 @@ Attachments: + Reset the applied filters.]]>