diff --git a/app/AdminModule/MailingModule/Forms/SendFormFactory.php b/app/AdminModule/MailingModule/Forms/SendFormFactory.php index 854e885fe..d882cdc9d 100644 --- a/app/AdminModule/MailingModule/Forms/SendFormFactory.php +++ b/app/AdminModule/MailingModule/Forms/SendFormFactory.php @@ -44,6 +44,13 @@ public function create(): Form { $form = $this->baseFormFactory->create(); + $recipientUsersMultiSelect = $form->addMultiSelect( + 'recipientUsers', + 'admin.mailing.send.recipient_users', + $this->userRepository->getUsersOptions(), + ) + ->setHtmlAttribute('data-live-search', 'true'); + $recipientRolesMultiSelect = $form->addMultiSelect( 'recipientRoles', 'admin.mailing.send.recipient_roles', @@ -56,12 +63,10 @@ public function create(): Form $this->subeventService->getSubeventsOptionsWithUsersCount(), ); - $recipientUsersMultiSelect = $form->addMultiSelect( - 'recipientUsers', - 'admin.mailing.send.recipient_users', - $this->userRepository->getUsersOptions(), - ) - ->setHtmlAttribute('data-live-search', 'true'); + $recipientUsersMultiSelect + ->addConditionOn($recipientRolesMultiSelect, Form::BLANK) + ->addConditionOn($recipientSubeventsMultiSelect, Form::BLANK) + ->addRule(Form::FILLED, 'admin.mailing.send.recipients_empty'); $recipientRolesMultiSelect ->addConditionOn($recipientSubeventsMultiSelect, Form::BLANK) @@ -73,11 +78,6 @@ public function create(): Form ->addConditionOn($recipientUsersMultiSelect, Form::BLANK) ->addRule(Form::FILLED, 'admin.mailing.send.recipients_empty'); - $recipientUsersMultiSelect - ->addConditionOn($recipientRolesMultiSelect, Form::BLANK) - ->addConditionOn($recipientSubeventsMultiSelect, Form::BLANK) - ->addRule(Form::FILLED, 'admin.mailing.send.recipients_empty'); - $form->addText('copy', 'admin.mailing.send.copy') ->addCondition(Form::FILLED) ->addRule(Form::EMAIL, 'admin.mailing.send.copy_format'); diff --git a/app/lang/admin.cs_CZ.neon b/app/lang/admin.cs_CZ.neon index 02a84b247..2b2e822a1 100644 --- a/app/lang/admin.cs_CZ.neon +++ b/app/lang/admin.cs_CZ.neon @@ -625,9 +625,10 @@ mailing: heading: "Historie" datetime: "Odesláno" subject: "Předmět" + recipient_users: "Příjemci - uživatelé" recipient_roles: "Příjemci - role" recipient_subevents: "Příjemci - podakce" - recipient_users: "Příjemci - uživatelé" + recipient_emails: "Příjemci - e-maily" automatic: "Automatický" configuration: