From c1f1cd948fba907dca45a4c36d4d80cd3efdefc8 Mon Sep 17 00:00:00 2001 From: Casey Peel Date: Mon, 11 May 2026 14:02:17 -0700 Subject: [PATCH] Allow PFs to clone projects with original PM --- tools/project_manager/editproject.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/project_manager/editproject.php b/tools/project_manager/editproject.php index 70c09a0b5..71f98d3b7 100644 --- a/tools/project_manager/editproject.php +++ b/tools/project_manager/editproject.php @@ -285,10 +285,13 @@ public function set_from_post() if (user_is_a_sitemanager()) { $this->project->username = @$_POST['username']; } elseif (user_is_proj_facilitator()) { - // PFs can create a project in which case the project should - // be assigned to them. For existing projects, theirs or others, - // they can't change the PM. - if (!$this->project->projectid) { + // If a PF clones a project, keep the original PM. + // If they create a new project, assign it to them, otherwise + // the PM is unchanged. + if (isset($this->clone_projectid)) { + $orig_project = new Project($this->clone_projectid); + $this->project->username = $orig_project->username; + } elseif (!$this->project->projectid) { $this->project->username = $pguser; } } else {