Add users in cc in workflow: fix code style

This commit is contained in:
nobohan 2023-03-23 11:24:21 +01:00
parent 295406d9b7
commit a3db67fd1e
4 changed files with 14 additions and 8 deletions

View File

@ -228,7 +228,6 @@ class WorkflowController extends AbstractController
); );
} }
/** /**
* @Route("/{_locale}/main/workflow/list/cc", name="chill_main_workflow_list_cc") * @Route("/{_locale}/main/workflow/list/cc", name="chill_main_workflow_list_cc")
*/ */

View File

@ -126,19 +126,19 @@ class EntityWorkflowStep
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32)); $this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
} }
public function addDestEmail(string $email): self public function addCcUser(User $user): self
{ {
if (!in_array($email, $this->destEmail, true)) { if (!$this->ccUser->contains($user)) {
$this->destEmail[] = $email; $this->ccUser[] = $user;
} }
return $this; return $this;
} }
public function addCcUser(User $user): self public function addDestEmail(string $email): self
{ {
if (!$this->ccUser->contains($user)) { if (!in_array($email, $this->destEmail, true)) {
$this->ccUser[] = $user; $this->destEmail[] = $email;
} }
return $this; return $this;

View File

@ -160,7 +160,7 @@ class WorkflowStepType extends AbstractType
'label' => 'workflow.cc for next steps', 'label' => 'workflow.cc for next steps',
'multiple' => true, 'multiple' => true,
'mapped' => false, 'mapped' => false,
'required' => false 'required' => false,
]) ])
->add('future_dest_emails', ChillCollectionType::class, [ ->add('future_dest_emails', ChillCollectionType::class, [
'label' => 'workflow.dest by email', 'label' => 'workflow.dest by email',

View File

@ -2,6 +2,13 @@
declare(strict_types=1); declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Main; namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;