duplicate projects with all settings (#1465)
This commit is contained in:
@@ -25,6 +25,7 @@ use App\Form\ProjectRateForm;
|
||||
use App\Form\ProjectTeamPermissionForm;
|
||||
use App\Form\Toolbar\ProjectToolbarForm;
|
||||
use App\Form\Type\ProjectType;
|
||||
use App\Project\ProjectDuplicationService;
|
||||
use App\Repository\ActivityRepository;
|
||||
use App\Repository\ProjectRateRepository;
|
||||
use App\Repository\ProjectRepository;
|
||||
@@ -374,6 +375,17 @@ final class ProjectController extends AbstractController
|
||||
return $this->renderProjectForm($project, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/{id}/duplicate", name="admin_project_duplicate", methods={"GET", "POST"})
|
||||
* @Security("is_granted('edit', project)")
|
||||
*/
|
||||
public function duplicateAction(Project $project, Request $request, ProjectDuplicationService $projectDuplicationService)
|
||||
{
|
||||
$newProject = $projectDuplicationService->duplicate($project, $project->getName() . ' [COPY]');
|
||||
|
||||
return $this->redirectToRoute('project_details', ['id' => $newProject->getId()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/{id}/delete", name="admin_project_delete", methods={"GET", "POST"})
|
||||
* @Security("is_granted('delete', project)")
|
||||
|
||||
Reference in New Issue
Block a user