copy teams from logged-in user for new projects (#3599)
This commit is contained in:
@@ -38,6 +38,7 @@ use App\Repository\ProjectRepository;
|
||||
use App\Repository\Query\ActivityQuery;
|
||||
use App\Repository\Query\ProjectQuery;
|
||||
use App\Repository\TeamRepository;
|
||||
use App\Utils\Context;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
@@ -166,7 +167,7 @@ final class ProjectController extends AbstractController
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
try {
|
||||
$this->projectService->saveNewProject($project);
|
||||
$this->projectService->saveNewProject($project, new Context($this->getUser()));
|
||||
$this->flashSuccess('action.update.success');
|
||||
|
||||
return $this->redirectToRoute('project_details', ['id' => $project->getId()]);
|
||||
|
||||
@@ -533,6 +533,11 @@ final class SystemConfigurationController extends AbstractController
|
||||
->setName('project.choice_pattern')
|
||||
->setLabel('choice_pattern')
|
||||
->setType(ProjectTypePatternType::class),
|
||||
(new Configuration())
|
||||
->setName('project.copy_teams_on_create')
|
||||
->setLabel('copy_teams_on_create')
|
||||
->setType(YesNoType::class)
|
||||
->setTranslationDomain('system-configuration'),
|
||||
]),
|
||||
(new SystemConfigurationModel('activity'))
|
||||
->setConfiguration([
|
||||
|
||||
Reference in New Issue
Block a user