diff --git a/module/bug/control.php b/module/bug/control.php index d8b51330fb..d45640c17e 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -451,7 +451,7 @@ class bug extends control $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $stories; - $this->view->projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); + $this->view->projects = $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); $this->view->builds = $builds; $this->view->moduleID = (int)$moduleID; $this->view->projectID = $projectID; @@ -554,7 +554,7 @@ class bug extends control $this->view->stories = $stories; $this->view->builds = $builds; $this->view->users = $this->user->getPairs('devfirst|nodeleted'); - $this->view->projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : 0, $params = 'nodeleted'); + $this->view->projects = $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'nodeleted'); $this->view->projectID = $projectID; $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); $this->view->moduleID = $moduleID; @@ -727,7 +727,7 @@ class bug extends control $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch); $this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch); $this->view->currentModuleID = $currentModuleID; - $this->view->projects = $this->product->getProjectPairs($bug->product, $bug->branch ? "0,{$bug->branch}" : 0, 'nodeleted'); + $this->view->projects = $this->product->getExecutionPairsByProduct($bug->product, $bug->branch ? "0,{$bug->branch}" : 0, 'nodeleted'); $this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product, $bug->branch); $this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); $this->view->tasks = $this->task->getProjectTaskPairs($bug->project); @@ -1100,7 +1100,7 @@ class bug extends control $this->view->bug = $bug; $this->view->users = $users; $this->view->assignedTo = $assignedTo; - $this->view->projects = $this->loadModel('product')->getProjectPairs($productID, $bug->branch ? "0,{$bug->branch}" : 0, $params = 'nodeleted'); + $this->view->projects = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'nodeleted'); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = $bug->branch, 'all'); $this->view->actions = $this->action->getList('bug', $bugID); $this->display(); diff --git a/module/bug/model.php b/module/bug/model.php index 6f8f068e38..dd3057037c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1273,7 +1273,7 @@ class bugModel extends model $this->config->bug->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->bug->allProduct); $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); - $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); + $this->config->bug->search['params']['project']['values'] = $this->product->getExecutionPairsByProduct($productID); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; //Fix bug #939. $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; diff --git a/module/build/config.php b/module/build/config.php index bcee51e703..adc7ace046 100644 --- a/module/build/config.php +++ b/module/build/config.php @@ -13,7 +13,7 @@ global $lang; $config->build->search['module'] = 'build'; $config->build->search['fields']['name'] = $lang->build->name; $config->build->search['fields']['id'] = $lang->build->id; -$config->build->search['fields']['product'] = $lang->story->product; +$config->build->search['fields']['product'] = $lang->build->product; $config->build->search['fields']['scmPath'] = $lang->build->scmPath; $config->build->search['fields']['filePath'] = $lang->build->filePath; $config->build->search['fields']['date'] = $lang->build->date; diff --git a/module/build/control.php b/module/build/control.php index 4c78b26015..49196599dd 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -14,22 +14,22 @@ class build extends control /** * Create a build. * - * @param int $projectID + * @param int $executionID * @param int $productID * @access public * @return void */ - public function create($projectID, $productID = 0) + public function create($executionID, $productID = 0) { if(!empty($_POST)) { - $buildID = $this->build->create($projectID); + $buildID = $this->build->create($executionID); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); $this->executeHooks($buildID); - if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProjectBuilds($projectID)"));//Code for task #5126. + if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.loadProjectBuilds($executionID)"));//Code for task #5126. $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID"))); } @@ -40,29 +40,30 @@ class build extends control $this->loadModel('user'); /* Set menu. */ - $this->project->setMenu($this->project->getExecutionPairs($this->session->PRJ), $projectID); + $executions = $this->project->getExecutionPairs($this->session->PRJ); + $this->project->setMenu($executions, $executionID); /* Get stories and bugs. */ $orderBy = 'status_asc, stage_asc, id_desc'; /* Assign. */ - $project = $this->loadModel('project')->getById($projectID); + $project = $this->loadModel('project')->getExecutionById($executionID); - $productGroups = $this->project->getProducts($projectID); + $productGroups = $this->project->getProducts($executionID); $productID = $productID ? $productID : key($productGroups); $products = array(); foreach($productGroups as $product) $products[$product->id] = $product->name; - $this->view->title = $project->name . $this->lang->colon . $this->lang->build->create; - $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$projectID"), $project->name); - $this->view->position[] = $this->lang->build->create; + $this->view->title = $project->name . $this->lang->colon . $this->lang->build->create; + $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$executionID"), $project->name); + $this->view->position[] = $this->lang->build->create; + $this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : ''; $this->view->branches = (isset($productGroups[$productID]) and $productGroups[$productID]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID); - $this->view->projectID = $projectID; + $this->view->executionID = $executionID; $this->view->orderBy = $orderBy; - $this->view->products = $products; - $this->view->lastBuild = $this->build->getLast($projectID); + $this->view->lastBuild = $this->build->getLast($executionID); $this->view->productGroups = $productGroups; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); $this->display(); @@ -107,15 +108,15 @@ class build extends control $orderBy = 'status_asc, stage_asc, id_desc'; /* Assign. */ - $project = $this->loadModel('project')->getById($build->project); - if(empty($project)) + $execution = $this->loadModel('project')->getExecutionById($build->project); + if(empty($execution)) { - $project = new stdclass(); - $project->name = ''; + $execution = new stdclass(); + $execution->name = ''; } - $projects = $this->loadModel('product')->getProjectPairs($build->product, $build->branch, 'nodeleted'); - if(!isset($projects[$build->project])) $projects[$build->project] = $project->name; + $executions = $this->loadModel('product')->getExecutionPairsByProduct($build->product, $build->branch, 'nodeleted'); + if(!isset($executions[$build->project])) $executions[$build->project] = $execution->name; $productGroups = $this->project->getProducts($build->project); @@ -130,12 +131,12 @@ class build extends control $products = array(); foreach($productGroups as $product) $products[$product->id] = $product->name; - $this->view->title = $project->name . $this->lang->colon . $this->lang->build->edit; - $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $project->name); + $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit; + $this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $execution->name); $this->view->position[] = $this->lang->build->edit; $this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : ''; $this->view->branches = (isset($productGroups[$build->product]) and $productGroups[$build->product]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($build->product); - $this->view->projects = $projects; + $this->view->executions = $executions; $this->view->orderBy = $orderBy; $this->view->productGroups = $productGroups; @@ -524,7 +525,7 @@ class build extends control $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, $viewType = 'bug', $startModuleID = 0); - $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($build->product); + $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($build->product); $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product, $branch = 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 67c6d0ae1e..31b46fdd3c 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -36,7 +36,7 @@