* Fix the problem of the build under the project.

This commit is contained in:
tianshujie98
2021-03-22 16:04:50 +08:00
parent 754bb25a0d
commit 77a5d0a200
5 changed files with 27 additions and 31 deletions
+18 -23
View File
@@ -38,17 +38,14 @@ class build extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('build', 'view', "buildID=$buildID")));
}
/* Set menu. */
if($this->app->openApp == 'project')
{
$model = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch('model');
$this->lang->project->menu = $this->lang->$model->menu;
$this->lang->project->menuOrder = $this->lang->$model->menuOrder;
commonModel::setMenuVars('project', $projectID);
$this->loadModel('project')->setMenu($projectID);
$executions = $this->execution->getPairs($projectID);
$executionID = isset($executions[$this->session->executionID]) ? $this->session->executionID : key($executions);
$this->session->set('executionID', 0);
$this->session->set('PRJ', $projectID);
$this->session->set('project', $projectID);
}
elseif($this->app->openApp == 'execution')
{
@@ -110,16 +107,15 @@ class build extends control
$this->loadModel('product');
$build = $this->build->getById((int)$buildID);
/* Set menu. */
if($this->app->openApp == 'project')
{
$model = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($build->project)->fetch('model');
$this->lang->project->menu = $this->lang->$model->menu;
$this->lang->project->menuOrder = $this->lang->$model->menuOrder;
commonModel::setMenuVars('project', $build->project);
$this->loadModel('project')->setMenu($build->project);
}
elseif($this->app->openApp == 'exectuion')
{
$this->execution->setMenu($this->execution->getPairs($build->project), $build->execution);
}
/* Set menu. */
$this->execution->setMenu($this->execution->getPairs($build->project), $build->execution);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
@@ -179,19 +175,10 @@ class build extends control
*/
public function view($buildID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
$build = $this->build->getByID((int)$buildID, true);
if(!$build) die(js::error($this->lang->notFound) . js::locate('back'));
$this->session->project = $build->project;
if($this->app->openApp == 'project')
{
$model = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($build->project)->fetch('model');
$this->lang->project->menu = $this->lang->$model->menu;
$this->lang->project->menuOrder = $this->lang->$model->menuOrder;
commonModel::setMenuVars('project', $build->project);
}
/* Set session and load modules. */
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true));
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true));
@@ -223,7 +210,15 @@ class build extends control
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
/* Set menu. */
commonModel::setMenuVars('execution', $build->execution);
if($this->app->openApp == 'project')
{
$this->loadModel('project')->setMenu($build->project);
}
elseif($this->app->openApp == 'execution')
{
$this->loadModel('execution')->setMenu($build->execution);
}
$executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty');
$this->view->title = "BUILD #$build->id $build->name - " . $executions[$build->execution];
+1 -1
View File
@@ -129,7 +129,7 @@ tbody tr td:first-child input {display: none;}
if($canBeChanged and common::hasPriv('build', 'unlinkStory'))
{
$unlinkURL = inlink('unlinkStory', "buildID=$build->id&story=$story->id");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn btn-icon' title='{$lang->build->unlinkStory}'");
echo html::a("###", '<i class="icon-unlink"></i>', '', "onclick='ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)' class='btn' title='{$lang->build->unlinkStory}'");
}
?>
</td>
+1 -1
View File
@@ -77,7 +77,7 @@
{
echo html::a($this->createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "<i class='icon icon-link'></i>", '', "class='btn' title='{$lang->build->linkStory}' data-app='project'");
}
common::printIcon('testtask', 'create', "product=$build->product&executionID={$build->execution}&build=$build->id&projectID=$projectID", $build, 'list', 'bullhorn', '', '', '', "data-app='execution'");
common::printIcon('testtask', 'create', "product=$build->product&executionID={$build->execution}&build=$build->id&projectID=$projectID", $build, 'list', 'bullhorn', '', '', '', "data-app='project'");
$lang->project->bug = $lang->execution->viewBug;
common::printIcon('build', 'view', "buildID=$build->id&type=generatedBug", $build, 'list', 'bug', '', '', '', "data-app='project'");
common::printIcon('build', 'edit', "buildID=$build->id", $build, 'list');
+6 -5
View File
@@ -212,11 +212,12 @@ class testtask extends control
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->create;
$this->view->executions = $executions;
$this->view->productID = $productID;
$this->view->builds = $builds;
$this->view->build = $build;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted');
$this->view->executionID = $executionID;
$this->view->executions = $executions;
$this->view->productID = $productID;
$this->view->builds = $builds;
$this->view->build = $build;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted');
$this->display();
}
+1 -1
View File
@@ -35,7 +35,7 @@
<?php endif;?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->execution;?></th>
<td class='w-p35-f'><?php echo html::select('execution', $executions, '', "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?></td><td></td>
<td class='w-p35-f'><?php echo html::select('execution', $executions, $executionID, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?></td><td></td>
</tr>
<tr>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>