Merge branch 'zentaopms_239_tanghucheng' into 'zentaopms_239'

* Finish task #69004.

See merge request easycorp/zentaopms!5381
This commit is contained in:
刘刚
2022-09-16 08:53:54 +00:00
8 changed files with 53 additions and 6 deletions
+38
View File
@@ -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']);
+1 -1
View File
@@ -25,7 +25,7 @@
<td><?php echo html::select('execution', $executions, $executionID, "onchange='loadProducts(this.value);' class='form-control chosen' required");?></td>
</tr>
<?php endif;?>
<tr>
<tr class="<?php echo $hidden;?>">
<th><?php echo $lang->build->product;?></th>
<?php if(!empty($products)):?>
<td>
+1 -1
View File
@@ -23,7 +23,7 @@
</div>
<form class='load-indicator main-form form-ajax' method='post' id='dataform' enctype='multipart/form-data'>
<table class='table table-form'>
<tr>
<tr class="<?php echo $hidden;?>">
<th><?php echo $lang->build->product;?></th>
<td>
<?php
+1 -1
View File
@@ -311,7 +311,7 @@ tbody tr td:first-child input {display: none;}
<div class='detail-title'><?php echo $lang->build->basicInfo?></div>
<div class='detail-content'>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<tr class="<?php echo $hidden;?>">
<th><?php echo $lang->build->product;?></th>
<td><?php echo $build->productName;?></td>
</tr>
+2
View File
@@ -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;
+3 -3
View File
@@ -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'");
}
?>
<div class="input-control space w-150px"><?php echo html::select('product', $products, $product, "onchange='changeProduct(this.value)' class='form-control chosen' data-placeholder='{$lang->productCommon}'");?></div>
<div class="input-control space w-150px <?php echo $hidden;?>"><?php echo html::select('product', $products, $product, "onchange='changeProduct(this.value)' class='form-control chosen' data-placeholder='{$lang->productCommon}'");?></div>
</div>
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->execution->byQuery;?></a>
<div class="btn-toolbar pull-right">
@@ -49,7 +49,7 @@
<thead>
<tr>
<th class="c-id-sm"><?php echo $lang->build->id;?></th>
<th class="c-name w-200px text-left"><?php echo $lang->build->product;?></th>
<th class="c-name w-200px text-left <?php echo $hidden;?>"><?php echo $lang->build->product;?></th>
<th class="c-name text-left"><?php echo $lang->build->name;?></th>
<th class="c-url"><?php echo $lang->build->scmPath;?></th>
<th class="c-url"><?php echo $lang->build->filePath;?></th>
@@ -63,7 +63,7 @@
<?php foreach($builds as $index => $build):?>
<tr data-id="<?php echo $productID;?>">
<td class="c-id-sm text-muted"><?php echo html::a(helper::createLink('build', 'view', "buildID=$build->id"), sprintf('%03d', $build->id));?></td>
<td class="c-name text-left" title='<?php echo $build->productName;?>'><?php echo $build->productName;?></td>
<td class="c-name text-left <?php echo $hidden;?>" title='<?php echo $build->productName;?>'><?php echo $build->productName;?></td>
<td class="c-name">
<?php if($build->branchName) echo "<span class='label label-outline label-badge'>{$build->branchName}</span>"?>
<?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name);?>
+1
View File
@@ -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')
+6
View File
@@ -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');
}
?>
<?php if($project->hasProduct):?>
<div class="input-control space w-150px"><?php echo html::select('product', $products, $product, "onchange='changeProduct(this.value)' class='form-control chosen' data-placeholder='{$lang->productCommon}'");?></div>
<?php endif;?>
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->execution->byQuery;?></a>
</div>
<div class="btn-toolbar pull-right">
@@ -48,7 +50,9 @@
<thead>
<tr>
<th class="c-id-sm"><?php echo $lang->build->id;?></th>
<?php if($project->hasProduct):?>
<th class="c-name w-200px text-left"><?php echo $lang->build->product;?></th>
<?php endif;?>
<th class="c-name text-left"><?php echo $lang->build->name;?></th>
<th class="c-name text-left"><?php echo $lang->executionCommon;?></th>
<th class="c-url"><?php echo $lang->build->scmPath;?></th>
@@ -63,7 +67,9 @@
<?php foreach($builds as $index => $build):?>
<tr data-id="<?php echo $productID;?>">
<td class="c-id-sm text-muted"><?php echo html::a(helper::createLink('build', 'view', "buildID=$build->id"), sprintf('%03d', $build->id), '', "data-app='project'");?></td>
<?php if($project->hasProduct):?>
<td class="c-name text-left" title='<?php echo $build->productName;?>'><?php echo $build->productName;?></td>
<?php endif;?>
<td class="c-name" title='<?php echo $build->name;?>'>
<?php if($build->branchName) echo "<span class='label label-outline label-badge'>{$build->branchName}</span>"?>
<?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name, '', "data-app='project'");?>