Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-stanek committed Oct 19, 2023
1 parent 90458d9 commit fd37d5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
22 changes: 11 additions & 11 deletions app/AdminModule/MailingModule/Forms/SendFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)
Expand All @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion app/lang/admin.cs_CZ.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fd37d5d

Please sign in to comment.