diff --git a/module/build/control.php b/module/build/control.php index 182eace820..df1338d9ab 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -11,6 +11,25 @@ */ class build extends control { + /** + * Common actions. + * + * @param int $projectID + * @access public + * @return void + */ + public function commonActions($projectID = 0) + { + $hidden = ''; + if($projectID) + { + $project = $this->loadModel('project')->getByID($projectID); + if(!$project->hasProduct) $hidden = 'hide'; + } + + $this->view->hidden = $hidden; + } + /** * Create a build. * @@ -59,6 +78,7 @@ class build extends control { $execution = $this->execution->getByID($executionID); $executions = $this->execution->getPairs($execution->project); + $projectID = $execution->project; $this->execution->setMenu($executionID); $this->session->set('project', $execution->project); } @@ -69,6 +89,7 @@ class build extends control $executions = $this->execution->getPairs($projectID); } + $this->commonActions($projectID); $executionList = empty($executions) ? array() : $this->execution->getByIdList(array_keys($executions)); foreach($executionList as $execution) { @@ -185,6 +206,8 @@ class build extends control foreach($productGroups as $product) $products[$product->id] = $product->name; + $this->commonActions($build->project); + $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->edit; $this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $execution->name); $this->view->position[] = $this->lang->build->edit; @@ -273,6 +296,8 @@ class build extends control $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); + $this->commonActions($build->project); + $this->view->title = "BUILD #$build->id $build->name" . (isset($executions[$build->execution]) ? " - " . $executions[$build->execution] : ''); $this->view->stories = $stories; $this->view->storyPager = $storyPager; @@ -544,6 +569,12 @@ class build extends control $this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, 'story', 0, $build->branch); $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList); + if($build->project) + { + $project = $this->loadModel('project')->getByID($build->project); + if(!$project->hasProduct and $project->model != 'scrum') unset($this->config->product->search['fields']['plan']); + } + if($product->type == 'normal') { unset($this->config->product->search['fields']['branch']); @@ -654,6 +685,13 @@ class build extends control unset($this->config->bug->search['params']['product']); unset($this->config->bug->search['fields']['project']); unset($this->config->bug->search['params']['project']); + + if($build->project) + { + $project = $this->loadModel('project')->getByID($build->project); + if(!$project->hasProduct and $project->model != 'scrum') unset($this->config->bug->search['fields']['plan']); + } + if($product->type == 'normal') { unset($this->config->bug->search['fields']['branch']); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index c080e0d04e..f70552933e 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -25,7 +25,7 @@ - + build->product;?> diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index fa0d420eea..877ec3eb38 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -23,7 +23,7 @@
- +
build->product;?> build->basicInfo?>
- + diff --git a/module/execution/control.php b/module/execution/control.php index 0576110f86..5fc9582114 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -80,11 +80,13 @@ class execution extends control $childExecutions = $this->execution->getChildExecutions($executionID); $teamMembers = $this->execution->getTeamMembers($executionID); $actions = $this->loadModel('action')->getList($this->objectType, $executionID); + $project = $this->loadModel('project')->getByID($execution->project); /* Set menu. */ $this->execution->setMenu($executionID, $buildID = 0, $extra); /* Assign. */ + $this->view->hidden = !empty($project->hasProduct) ? "" : 'hide'; $this->view->executions = $this->executions; $this->view->execution = $execution; $this->view->childExecutions = $childExecutions; diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index 3f2e90bc4b..c1610c1616 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -25,7 +25,7 @@ echo html::a(inlink('build', "executionID=$executionID&type=$featureType"), $label, '',"class='btn btn-link $activeClass' data-app={$app->tab} id='$featureType'"); } ?> -
productCommon}'");?>
+
productCommon}'");?>
execution->byQuery;?>
@@ -49,7 +49,7 @@
- + @@ -63,7 +63,7 @@ $build):?> - + + hasProduct):?> + @@ -63,7 +67,9 @@ $build):?> + hasProduct):?> +
build->product;?> productName;?>
build->id;?>build->product;?>build->product;?> build->name;?> build->scmPath;?> build->filePath;?>
id"), sprintf('%03d', $build->id));?>productName;?>productName;?> branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name);?> diff --git a/module/project/control.php b/module/project/control.php index c104de1407..24b52366f5 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1349,6 +1349,7 @@ class project extends control $executions = $this->loadModel('execution')->getByProject($projectID, 'all', '', true, $devel); $this->config->build->search['fields']['execution'] = $this->project->lang->executionCommon; $this->config->build->search['params']['execution'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $executions); + if(!$project->hasProduct) unset($this->config->build->search['fields']['product']); $product = $param ? $this->loadModel('product')->getById($param) : ''; if($product and $product->type != 'normal') diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 100e689765..4a26479723 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -29,7 +29,9 @@ echo html::a(inlink('build', "projectID=$projectID&type=$featureType"), $label, '',"class='btn btn-link $activeClass' data-app={$app->tab} id=" . $featureType .'Tab'); } ?> + hasProduct):?>
productCommon}'");?>
+ execution->byQuery;?>
@@ -48,7 +50,9 @@
build->id;?>build->product;?> build->name;?> executionCommon;?> build->scmPath;?>
id"), sprintf('%03d', $build->id), '', "data-app='project'");?>productName;?> branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name, '', "data-app='project'");?>