Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions files/lib/action/AddConversationParticipantDialogAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use wcf\system\conversation\TConversationForm;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\form\builder\field\BooleanFormField;
use wcf\system\form\builder\field\dependency\NonEmptyFormFieldDependency;
use wcf\system\form\builder\field\MultipleSelectionFormField;
use wcf\system\form\builder\field\RadioButtonFormField;
use wcf\system\form\builder\field\user\UserFormField;
Expand Down Expand Up @@ -126,18 +124,12 @@ private function getForm(Conversation $conversation): Psr15DialogForm
->maximumMultiples(WCF::getSession()->getPermission('user.conversation.maxParticipants') - $conversation->participants)
->addValidator($this->getParticipantsValidator())
->addValidator($this->getMaximumParticipantsValidator(invisibleParticipantGroupsFieldId: null)),
BooleanFormField::create('addGroupParticipants')
->label('wcf.conversation.addGroupParticipants')
->available(\count($groupParticipants) > 0),
MultipleSelectionFormField::create('participantGroups')
->label('wcf.conversation.participantGroups')
->available(WCF::getSession()->getPermission('user.conversation.canAddGroupParticipants'))
->filterable()
->options($groupParticipants)
->addDependency(
NonEmptyFormFieldDependency::create('addGroupParticipantsDependency')
->fieldId('addGroupParticipants')
),
->available(WCF::getSession()->getPermission('user.conversation.canAddGroupParticipants')
&& \count($groupParticipants) > 0)
->filterable(\count($groupParticipants) > 20)
->options($groupParticipants),
RadioButtonFormField::create('messageVisibility')
->label('wcf.conversation.visibility')
->available(!$conversation->isDraft && $conversation->canAddParticipantsUnrestricted())
Expand Down
33 changes: 7 additions & 26 deletions files/lib/form/ConversationAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
use wcf\system\form\builder\container\FormContainer;
use wcf\system\form\builder\container\wysiwyg\WysiwygFormContainer;
use wcf\system\form\builder\data\processor\CustomFormDataProcessor;
use wcf\system\form\builder\data\processor\VoidFormDataProcessor;
use wcf\system\form\builder\field\BooleanFormField;
use wcf\system\form\builder\field\dependency\NonEmptyFormFieldDependency;
use wcf\system\form\builder\field\MultipleSelectionFormField;
use wcf\system\form\builder\field\TextFormField;
use wcf\system\form\builder\field\user\UserFormField;
Expand Down Expand Up @@ -125,18 +123,12 @@ static function (UserGroup $group) {
->addValidator($this->getParticipantsValidator())
->addValidator($this->getMaximumParticipantsValidator())
->value($this->user ? [$this->user->userID] : []),
BooleanFormField::create('addGroupParticipants')
->label('wcf.conversation.addGroupParticipants')
->available(\count($groupParticipants) > 0),
MultipleSelectionFormField::create('participantGroups')
->label('wcf.conversation.participantGroups')
->available(WCF::getSession()->getPermission('user.conversation.canAddGroupParticipants'))
->filterable()
->options($groupParticipants)
->addDependency(
NonEmptyFormFieldDependency::create('addGroupParticipantsDependency')
->fieldId('addGroupParticipants')
),
->available(WCF::getSession()->getPermission('user.conversation.canAddGroupParticipants')
&& \count($groupParticipants) > 0)
->filterable(\count($groupParticipants) > 20)
->options($groupParticipants),
UserFormField::create('invisibleParticipants')
->label('wcf.conversation.invisibleParticipants')
->description('wcf.conversation.invisibleParticipants.description')
Expand Down Expand Up @@ -174,24 +166,15 @@ static function (UserFormField $formField) {
}
)
),
BooleanFormField::create('addInvisibleGroupParticipants')
->label('wcf.conversation.addInvisibleGroupParticipants')
->available(
\count($groupParticipants) > 0
&& WCF::getSession()->getPermission('user.conversation.canAddInvisibleParticipants')
),
MultipleSelectionFormField::create('invisibleParticipantGroups')
->label('wcf.conversation.invisibleParticipantGroups')
->available(
WCF::getSession()->getPermission('user.conversation.canAddInvisibleParticipants')
&& WCF::getSession()->getPermission('user.conversation.canAddGroupParticipants')
&& \count($groupParticipants) > 0
)
->filterable()
->options($groupParticipants)
->addDependency(
NonEmptyFormFieldDependency::create('addInvisibleGroupParticipantsDependency')
->fieldId('addInvisibleGroupParticipants')
),
->filterable(\count($groupParticipants) > 20)
->options($groupParticipants),
BooleanFormField::create('participantCanInvite')
->label('wcf.conversation.participantCanInvite')
->available(WCF::getSession()->getPermission('user.conversation.canSetCanInvite')),
Expand Down Expand Up @@ -224,8 +207,6 @@ protected function finalizeForm()
parent::finalizeForm();

$this->form->getDataHandler()
->addProcessor(new VoidFormDataProcessor('addGroupParticipants'))
->addProcessor(new VoidFormDataProcessor('addInvisibleGroupParticipants'))
->addProcessor(
new CustomFormDataProcessor('messageProcessor', static function (IFormDocument $document, array $parameters) {
unset($parameters['data']['message']);
Expand Down
9 changes: 2 additions & 7 deletions language/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@
<item name="wcf.conversation.participants.error.duplicate"><![CDATA[{$username} ist bereits Teilnehmer dieser Konversation.]]></item>
<item name="wcf.conversation.participants.error.canNotUseConversation"><![CDATA[{$username} besitzt nicht die notwendigen Berechtigungen, um an einer Konversation teilnehmen zu dürfen.]]></item>
<item name="wcf.conversation.participants.error.doesNotAcceptConversation"><![CDATA[{$username} möchte nicht an Konversationen teilnehmen.]]></item>
<item name="wcf.conversation.participants.error.emptyGroup"><![CDATA[Alle Mitglieder der angegebenen Gruppen sind bereits Teilnehmer dieser Konversation.]]></item>
<item name="wcf.conversation.participants.error.intersects"><![CDATA[{$username} ist bereits als sichtbarer Teilnehmer eingetragen.]]></item>
<item name="wcf.conversation.participants.error.ignoresYou"><![CDATA[{$username} hat {if LANGUAGE_USE_INFORMAL_VARIANT}dich{else}Sie{/if} blockiert.]]></item>
<item name="wcf.conversation.participants.error.tooManyParticipants"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} zu viele Teilnehmer angegeben. Das Maximum liegt bei {#$__wcf->getSession()->getPermission('user.conversation.maxParticipants')} Teilnehmern.]]></item>
<item name="wcf.conversation.participants.error.invisibleParticipantsNoPermission"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} keine Berechtigung, unsichtbare Teilnehmer hinzuzufügen.]]></item>
<item name="wcf.conversation.participants.error.participantCanInviteNoPermission"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} keine Berechtigung, Teilnehmern das Hinzufügen weiterer Teilnehmer zu erlauben.]]></item>
<item name="wcf.conversation.participants.removeParticipant"><![CDATA[Teilnehmer entfernen]]></item>
<item name="wcf.conversation.participants.removeParticipant.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} <span class="confirmationObject">{$participant->username}</span> wirklich aus dieser Konversation entfernen?]]></item>
<item name="wcf.conversation.quota"><![CDATA[Speicherplatz]]></item>
Expand Down Expand Up @@ -131,10 +128,8 @@
<item name="wcf.conversation.username"><![CDATA[Autor]]></item>
<item name="wcf.conversation.error.floodControl"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} innerhalb der letzten 24 Stunden bereits {if $limit == 1}eine Konversation{else}{#$limit} Konversationen{/if} gestartet. Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}warte{else}warten Sie{/if} bis zum <strong>{time time=$notBefore type='plainTime'}</strong>, bevor {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} eine neue Konversation {if LANGUAGE_USE_INFORMAL_VARIANT}startest{else}starten{/if}.]]></item>
<item name="wcf.conversation.message.error.floodControl"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} bereits eine Nachricht innerhalb der letzten {plural value=$__wcf->getSession()->getPermission('user.conversation.floodControlTime') 1='Sekunde' other='# Sekunden'} versendet. {if LANGUAGE_USE_INFORMAL_VARIANT}Du kannst{else}Sie können{/if} erst in {plural value=$waitTime 1='einer Sekunde' other='# Sekunden'} eine neue Nachricht verfassen.]]></item>
<item name="wcf.conversation.addGroupParticipants"><![CDATA[Benutzergruppen hinzufügen]]></item>
<item name="wcf.conversation.participantGroups"><![CDATA[Benutzergruppen]]></item>
<item name="wcf.conversation.addInvisibleGroupParticipants"><![CDATA[Unsichtbare Benutzergruppen hinzufügen]]></item>
<item name="wcf.conversation.invisibleParticipantGroups"><![CDATA[Unsichtbare Benutzergruppen]]></item>
<item name="wcf.conversation.participantGroups"><![CDATA[Benutzergruppen als Teilnehmer hinzufügen]]></item>
<item name="wcf.conversation.invisibleParticipantGroups"><![CDATA[Benutzergruppen als unsichtbare Teilnehmer hinzufügen]]></item>
<item name="wcf.conversation.form.isDraft"><![CDATA[Als Entwurf speichern]]></item>
</category>
<category name="wcf.conversation.edit">
Expand Down
9 changes: 2 additions & 7 deletions language/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@
<item name="wcf.conversation.participants.error.duplicate"><![CDATA[{$username} is already a participant of this conversation.]]></item>
<item name="wcf.conversation.participants.error.canNotUseConversation"><![CDATA[{$username} is not allowed to participate in conversations.]]></item>
<item name="wcf.conversation.participants.error.doesNotAcceptConversation"><![CDATA[{$username} does not want to be added in conversations.]]></item>
<item name="wcf.conversation.participants.error.emptyGroup"><![CDATA[All members of the entered user groups already participate in this conversation.]]></item>
<item name="wcf.conversation.participants.error.intersects"><![CDATA[{$username} was already added as a visible participant.]]></item>
<item name="wcf.conversation.participants.error.ignoresYou"><![CDATA[{$username} is blocking you.]]></item>
<item name="wcf.conversation.participants.error.tooManyParticipants"><![CDATA[You have added too many participants, you can add up to {#$__wcf->getSession()->getPermission('user.conversation.maxParticipants')} participants.]]></item>
<item name="wcf.conversation.participants.error.invisibleParticipantsNoPermission"><![CDATA[You do not have the permission to add invisible participants.]]></item>
<item name="wcf.conversation.participants.error.participantCanInviteNoPermission"><![CDATA[You do not have the permission to allow participants to add new participants.]]></item>
<item name="wcf.conversation.participants.removeParticipant"><![CDATA[Remove Participant]]></item>
<item name="wcf.conversation.participants.removeParticipant.confirmMessage"><![CDATA[Do you really want to remove <span class="confirmationObject">{$participant->username}</span> from this conversation?]]></item>
<item name="wcf.conversation.quota"><![CDATA[Quota]]></item>
Expand Down Expand Up @@ -131,10 +128,8 @@
<item name="wcf.conversation.username"><![CDATA[Author]]></item>
<item name="wcf.conversation.error.floodControl"><![CDATA[You have already started {if $limit == 1}one conversation{else}{#$limit} conversations{/if} in the past 24 hours. Please wait until <strong>{time time=$notBefore type='plainTime'}</strong> before you start a new conversation.]]></item>
<item name="wcf.conversation.message.error.floodControl"><![CDATA[You have already sent a message within the last {plural value=$__wcf->getSession()->getPermission('user.conversation.floodControlTime') 1='second' other='# seconds'}. You must wait at least {plural value=$waitTime 1='one second' other='# seconds'} before attempting to write a new message.]]></item>
<item name="wcf.conversation.addGroupParticipants"><![CDATA[Add User Groups]]></item>
<item name="wcf.conversation.participantGroups"><![CDATA[User Groups]]></item>
<item name="wcf.conversation.addInvisibleGroupParticipants"><![CDATA[Add Invisible User Groups]]></item>
<item name="wcf.conversation.invisibleParticipantGroups"><![CDATA[Invisible User Groups]]></item>
<item name="wcf.conversation.participantGroups"><![CDATA[Add User Groups as Participants]]></item>
<item name="wcf.conversation.invisibleParticipantGroups"><![CDATA[Add User Groups as Invisible Participants]]></item>
<item name="wcf.conversation.form.isDraft"><![CDATA[Save as Draft]]></item>
</category>
<category name="wcf.conversation.edit">
Expand Down