diff --git a/module/execution/control.php b/module/execution/control.php index 6d0e3736eb..072219bda6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1808,7 +1808,7 @@ 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 : '', true); + $copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', isset($project->model) ? $project->model : '', 'multiple'); $copyProjectID = ($projectID == 0) ? key($copyProjects) : $projectID; if(!empty($project->hasProduct)) $allProducts = array(0 => '') + $allProducts; diff --git a/module/product/control.php b/module/product/control.php index d14444e506..8f701aee51 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -100,7 +100,7 @@ class product extends control $accounts = array(); $projectStats = $this->product->getProjectStatsByProduct($productID, $status, $branch, $involved, $orderBy, $pager); $product = $this->product->getByID($productID); - $projects = $this->project->getPairsByProgram($product->program, 'all', false, 'order_asc'); + $projects = $this->project->getPairsByProgram($product->program, 'all', false, 'order_asc', '', '', 'product'); foreach($projectStats as $project) { @@ -110,8 +110,6 @@ class product extends control $PMList = $this->user->getListByAccounts($accounts, 'account'); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->product->project; - $this->view->position[] = $this->products[$productID]; - $this->view->position[] = $this->lang->product->project; $this->view->projectStats = $projectStats; $this->view->PMList = $PMList; $this->view->productID = $productID; diff --git a/module/project/model.php b/module/project/model.php index 11c14bb5a0..58f2142c85 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -792,11 +792,11 @@ class projectModel extends model * @param string $orderBy * @param string $excludedModel * @param string $model - * @param bool $multiple + * @param string $param multiple|product * @access public * @return object */ - public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc', $excludedModel = '', $model = '', $multiple = false) + public function getPairsByProgram($programID = '', $status = 'all', $isQueryAll = false, $orderBy = 'order_asc', $excludedModel = '', $model = '', $param = '') { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectPairs(); return $this->dao->select('id, name')->from(TABLE_PROJECT) @@ -807,7 +807,8 @@ class projectModel extends model ->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($multiple)->andWhere('multiple')->eq(1)->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() ->beginIF(!$this->app->user->admin and !$isQueryAll)->andWhere('id')->in($this->app->user->view->projects)->fi() ->orderBy($orderBy)