diff --git a/module/project/model.php b/module/project/model.php index dd8a5cd557..2f823bea97 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1528,7 +1528,7 @@ class projectModel extends model ->checkIF($project->begin != '', 'begin', 'date') ->checkIF($project->end != '', 'end', 'date') ->checkIF($project->end != '', 'end', 'gt', $project->begin) - ->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$project->parent' and `model` = '{$project->model}' and `deleted` = '0'") + ->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = '$oldProject->parent' and `model` = '{$project->model}' and `deleted` = '0'") ->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = '{$project->model}' and `deleted` = '0'") ->checkFlow() ->where('id')->eq($projectID) @@ -1603,7 +1603,7 @@ class projectModel extends model if(!empty($unlinkedProducts)) { $products = $this->dao->select('name')->from(TABLE_PRODUCT)->where('id')->in($unlinkedProducts)->fetchPairs(); - $this->action->create('project', $projectID, 'unlinkproduct', '', implode(',', $products)); + $this->loadModel('action')->create('project', $projectID, 'unlinkproduct', '', implode(',', $products)); } /* Activate or close the shadow product of the project. */