diff --git a/module/execution/control.php b/module/execution/control.php index d47b66eaa6..23e12a6ecc 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1862,7 +1862,12 @@ class execution extends control $this->loadModel('product'); $allProducts = $this->product->getProductPairsByProject($projectID, 'noclosed'); - $copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', isset($project->model) ? $project->model : '', 'multiple'); + + $projectModel = isset($project->model) ? $project->model : ''; + if($projectModel == 'agileplus') $projectModel = array('scrum', 'agileplus'); + if($projectModel == 'waterfallplus') $projectModel = array('waterfall', 'waterfallplus'); + + $copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', $projectModel, 'multiple'); $copyProjectID = ($projectID == 0) ? key($copyProjects) : $projectID; if(!empty($project->hasProduct)) $allProducts = array(0 => '') + $allProducts; diff --git a/module/project/model.php b/module/project/model.php index 10892907d5..cd23ccc3d0 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -818,13 +818,13 @@ class projectModel extends model /** * Get project pairs by programID. * - * @param int $programID - * @param status $status all|wait|doing|suspended|closed|noclosed - * @param bool $isQueryAll - * @param string $orderBy - * @param string $excludedModel - * @param string $model - * @param string $param multiple|product + * @param int $programID + * @param status $status all|wait|doing|suspended|closed|noclosed + * @param bool $isQueryAll + * @param string $orderBy + * @param string $excludedModel + * @param string|array $model + * @param string $param multiple|product * @access public * @return object */ @@ -839,7 +839,7 @@ class projectModel extends model ->beginIF($programID === 0)->andWhere('parent')->eq(0)->fi() ->beginIF($status != 'all' and $status != 'noclosed')->andWhere('status')->eq($status)->fi() ->beginIF($excludedModel)->andWhere('model')->ne($excludedModel)->fi() - ->beginIF($model)->andWhere('model')->eq($model)->fi() + ->beginIF($model)->andWhere('model')->in($model)->fi() ->beginIF(strpos($param, 'multiple') !== false)->andWhere('multiple')->eq(1)->fi() ->beginIF(strpos($param, 'product') !== false)->andWhere('hasProduct')->eq(1)->fi() ->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi()