Merge branch 'master' into 'zentaopms_266_task_#77615'

# Conflicts:
#   module/bug/control.php
This commit is contained in:
王怡栋
2022-11-30 06:11:28 +00:00
21 changed files with 133 additions and 77 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1 -1
View File
@@ -226,7 +226,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> created a child task <strong>$extra</strong>。' . "\n";
+1 -1
View File
@@ -226,7 +226,7 @@ $lang->action->desc->merged = '$date, merged by <strong>$actor</st
$lang->action->desc->submitreview = '$date, submitted for review by <strong>$actor</strong>.' . "\n";
$lang->action->desc->ganttmove = '$date, sort by <strong>$actor</strong> .' . "\n";
$lang->action->desc->switchtolight = '$date, Switch from ALM mode to light mode by <strong>'. $lang->admin->system .'</strong>.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the sprints of the project from the $extra.' . "\n";
$lang->action->desc->unlinkproduct = '$date, the project is disassociated from the $extra, synchronization disassociates the ' . $lang->executionCommon . 's of the project from the $extra.' . "\n";
/* Used to describe the history of operations related to parent-child tasks. */
$lang->action->desc->createchildren = '$date, <strong>$actor</strong> a créé un sous-tâche <strong>$extra</strong>。' . "\n";
+1 -1
View File
@@ -226,7 +226,7 @@ $lang->action->desc->merged = '$date, 由 <strong>$actor</strong>
$lang->action->desc->submitreview = '$date, 由 <strong>$actor</strong> 提交评审。' . "\n";
$lang->action->desc->ganttmove = '$date, 由 <strong>$actor</strong> 排序。' . "\n";
$lang->action->desc->switchtolight = '$date, 由于 <strong>'. $lang->admin->system .'</strong> 从全生命周期管理模式切换为轻量管理模式,项目访问控制由项目集内公开调整为私有。' . "\n";
$lang->action->desc->unlinkproduct = '$date, 系统判断由于迭代所属项目与$extra取消关联,同步将迭代与$extra取消关联。' . "\n";
$lang->action->desc->unlinkproduct = '$date, 系统判断由于' . $lang->executionCommon . '所属项目与$extra取消关联,同步将' . $lang->executionCommon . '与$extra取消关联。' . "\n";
/* 用来描述和父子任务相关的操作历史记录。*/
$lang->action->desc->createchildren = '$date, 由 <strong>$actor</strong> 创建子任务 <strong>$extra</strong>。' . "\n";
+2
View File
@@ -328,11 +328,13 @@ $config->bug->datatable->fieldList['os']['title'] = 'os';
$config->bug->datatable->fieldList['os']['fixed'] = 'no';
$config->bug->datatable->fieldList['os']['width'] = '80';
$config->bug->datatable->fieldList['os']['required'] = 'no';
$config->bug->datatable->fieldList['os']['control'] = 'multiple';
$config->bug->datatable->fieldList['browser']['title'] = 'browser';
$config->bug->datatable->fieldList['browser']['fixed'] = 'no';
$config->bug->datatable->fieldList['browser']['width'] = '80';
$config->bug->datatable->fieldList['browser']['required'] = 'no';
$config->bug->datatable->fieldList['browser']['control'] = 'multiple';
$config->bug->datatable->fieldList['mailto']['title'] = 'mailto';
$config->bug->datatable->fieldList['mailto']['fixed'] = 'no';
+14 -14
View File
@@ -227,7 +227,7 @@ class bug extends control
$this->view->product = $product;
$this->view->projectProducts = $this->product->getProducts($this->projectID);
$this->view->productName = $productName;
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'withreleased');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch);
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
$this->view->moduleTree = $moduleTree;
@@ -559,13 +559,13 @@ class bug extends control
/* If executionID is setted, get builds and stories of this execution. */
if($executionID)
{
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone', $executionID, 'execution');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,deletereleased', $executionID, 'execution');
$stories = $this->story->getExecutionStoryPairs($executionID);
if(!$projectID) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
}
else
{
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,deletereleased');
$stories = $this->story->getProductStoryPairs($productID, $branch, 0, 'all','id_desc', 0, 'full', 'story', false);
}
@@ -767,7 +767,7 @@ class bug extends control
/* If executionID is setted, get builds and stories of this execution. */
if($executionID)
{
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty', $executionID, 'execution');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased', $executionID, 'execution');
$stories = $this->story->getExecutionStoryPairs($executionID);
$execution = $this->loadModel('execution')->getById($executionID);
if($execution->type == 'kanban')
@@ -787,7 +787,7 @@ class bug extends control
}
else
{
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased');
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
@@ -936,7 +936,7 @@ class bug extends control
$this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $bug->branch, '');
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'withreleased');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, 'all');
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID);
$this->view->product = $product;
@@ -1082,18 +1082,18 @@ class bug extends control
$this->view->position[] = $this->lang->bug->edit;
/* Assign. */
$allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,withreleased');
$allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty');
if($executionID)
{
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch', $executionID, 'execution');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased', $executionID, 'execution');
}
elseif($projectID)
{
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch', $projectID, 'project');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased', $projectID, 'project');
}
else
{
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch,deletereleased');
}
/* Set the openedBuilds list. */
@@ -1838,7 +1838,7 @@ class bug extends control
$this->view->assignedTo = $assignedTo;
$this->view->productBugs = $productBugs;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID, 'stagefilter');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch,deletereleased');
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->execution = isset($execution) ? $execution : '';
@@ -1938,7 +1938,7 @@ class bug extends control
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs('noclosed', $bug->resolvedBy);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty', 0, 'execution', $bug->openedBuild);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty,deletereleased', 0, 'execution', $bug->openedBuild);
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
@@ -2155,7 +2155,7 @@ class bug extends control
$this->view->bugs = $bugs;
$this->view->users = $this->user->getPairs();
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,deletereleased');
$this->display();
}
@@ -2417,7 +2417,7 @@ class bug extends control
public function ajaxGetBugFieldOptions($productID, $executionID = 0)
{
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'bug');
$builds = $this->loadModel('build')->getBuildPairs($productID, 'all', '', $executionID, 'execution');
$builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'deletereleased', $executionID, 'execution');
$type = $this->lang->bug->typeList;
$pri = $this->lang->bug->priList;
$severity = $this->lang->bug->severityList;
+42 -3
View File
@@ -309,7 +309,7 @@ function loadProductStories(productID)
function loadProductProjects(productID)
{
required = $('#project_chosen').hasClass('required');
branch = $('#branch').val();
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&branch=' + branch + '&projectID=' + oldProjectID);
$('#projectBox').load(link, function()
@@ -481,9 +481,12 @@ function loadProductBuilds(productID)
*/
function loadExecutionRelated(executionID)
{
executionID = parseInt(executionID);
executionID = parseInt(executionID);
currentProjectID = $('#project').val() == 'undefined' ? 0 : $('#project').val();
if(executionID)
{
if(currentProjectID == 0) loadProjectByExecutionID(executionID);
loadExecutionTasks(executionID);
loadExecutionStories(executionID);
loadExecutionBuilds(executionID);
@@ -492,7 +495,6 @@ function loadExecutionRelated(executionID)
}
else
{
var currentProjectID = $('#project').val() == 'undefined' ? 0 : $('#project').val();
var currentProductID = $('#product').val();
$('#taskIdBox').innerHTML = '<select id="task"></select>'; // Reset the task.
@@ -511,6 +513,43 @@ function loadExecutionRelated(executionID)
}
}
/**
* Load a project by execution id.
*
* @param executionID $executionID
* @access public
* @return void
*/
function loadProjectByExecutionID(executionID)
{
link = createLink('project', 'ajaxGetPairsByExecution', 'executionID=' + executionID, 'json');
required = $('#project_chosen').hasClass('required');
productID = $('#product').val();
$.post(link, function(data)
{
var originProject = $('#project').html();
if($('#project').find('option[value="' + data.id + '"]').length > 0)
{
$('#project').find('option[value="' + data.id + '"]').attr('selected', 'selected');
originProject = $('#project').html();
$('#project').replaceWith('<select id="project" name="project" class="form-control" onchange="loadProductExecutions(' + productID + ', this.value)">' + originProject + '</select>');
}
else
{
var newProject = '<option value="' + data.id + '" data-keys="' + data.namePinyin + '" selected="selected">' + data.name + '</option>';
$('#project').replaceWith('<select id="project" name="project" class="form-control" onchange="loadProductExecutions(' + productID + ', this.value)">' + originProject + newProject+ '</select>');
}
$('#project_chosen').remove();
$('#project').next('.picker').remove();
$('#project').chosen();
if(required) $('#project_chosen').addClass('required');
}, 'json')
}
/**
* Load execution tasks.
*
-4
View File
@@ -81,8 +81,6 @@ class bugModel extends model
->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket')
->get();
if($bug->execution != 0) $bug->project = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($bug->execution)->fetch('project');
/* Check repeat bug. */
$result = $this->loadModel('common')->removeDuplicate('bug', $bug, "product={$bug->product}");
if($result and $result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']);
@@ -219,8 +217,6 @@ class bugModel extends model
if(isset($data->lanes[$i])) $bug->laneID = $data->lanes[$i];
if($bug->execution != 0) $bug->project = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($bug->execution)->fetch('project');
/* Assign the bug to the person in charge of the module. */
if(!empty($moduleOwners[$bug->module]))
{
+10 -10
View File
@@ -393,20 +393,20 @@ class build extends control
$isJsonView = $this->app->getViewType() == 'json';
if($varName == 'openedBuild' )
{
$params = ($type == 'all') ? 'noempty,withbranch' : 'noempty,noterminate,nodone,withbranch';
$params = ($type == 'all') ? 'noempty,withbranch,deletereleased' : 'noempty,noterminate,nodone,withbranch,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName . '[]', $builds, $build, 'size=4 class=form-control multiple'));
}
if($varName == 'openedBuilds' )
{
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty', 0, 'project', $build);
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty,deletereleased', 0, 'project', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName . "[$index][]", $builds, $build, 'size=4 class=form-control multiple'));
}
if($varName == 'resolvedBuild')
{
$params = ($type == 'all') ? 'withbranch' : 'noterminate,nodone,withbranch';
$params = ($type == 'all') ? 'withbranch,deletereleased' : 'noterminate,nodone,withbranch,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control'"));
@@ -434,7 +434,7 @@ class build extends control
{
if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$params = ($type == 'all') ? 'noempty,withbranch' : 'noempty,noterminate,nodone,withbranch';
$params = ($type == 'all') ? 'noempty,withbranch,deletereleased' : 'noempty,noterminate,nodone,withbranch,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName . '[]', $builds , '', 'size=4 class=form-control multiple'));
@@ -443,7 +443,7 @@ class build extends control
{
if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$params = ($type == 'all') ? 'withbranch' : 'noterminate,nodone,withbranch';
$params = ($type == 'all') ? 'withbranch,deletereleased' : 'noterminate,nodone,withbranch,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control'"));
@@ -478,7 +478,7 @@ class build extends control
{
if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$params = ($type == 'all') ? 'noempty' : 'noempty,noterminate,nodone';
$params = ($type == 'all') ? 'noempty,deletereleased' : 'noempty,noterminate,nodone,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build);
if($isJsonView) return print(json_encode($builds));
@@ -489,7 +489,7 @@ class build extends control
{
if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty', $executionID, 'execution', $build);
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty,deletereleased', $executionID, 'execution', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName . "[$index][]", $builds , $build, 'size=4 class=form-control multiple'));
}
@@ -497,14 +497,14 @@ class build extends control
{
if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$params = ($type == 'all') ? '' : 'noterminate,nodone';
$params = ($type == 'all') ? ',deletereleased' : 'noterminate,nodone,deletereleased';
$builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build);
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control'"));
}
if($varName == 'testTaskBuild')
{
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution');
$builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution', '', false);
if($isJsonView) return print(json_encode($builds));
if(empty($builds))
@@ -543,7 +543,7 @@ class build extends control
{
$lastBuild = $this->build->getLast($executionID, $projectID);
if($lastBuild)
{
{
echo "<div class='help-block'> &nbsp; " . $this->lang->build->last . ": <a class='code label label-badge label-light' id='lastBuildBtn'>" . $lastBuild->name . "</a></div>";
}
else
+1 -1
View File
@@ -28,7 +28,7 @@ $lang->build->confirmUnlinkBug = "您确认移除该Bug吗?";
$lang->build->basicInfo = '基本信息';
$lang->build->id = 'ID';
$lang->build->product = $lang->productCommon;
$lang->build->product = '所属' . $lang->productCommon;
$lang->build->project = '所属项目';
$lang->build->branch = '平台/分支';
$lang->build->branchName = '所属%s';
+2 -2
View File
@@ -234,7 +234,7 @@ class buildModel extends model
*
* @param int|array $products
* @param string|int $branch
* @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|withreleased, can be a set of them
* @param string $params noempty|notrunk|noterminate|withbranch|hasproject|noDeleted|singled|deletereleased, can be a set of them
* @param string|int $objectID
* @param string $objectType
* @param int|array $buildIdList
@@ -329,7 +329,7 @@ class buildModel extends model
{
if(!isset($allBuilds[$buildID])) continue;
$build = $allBuilds[$buildID];
if(strpos($params, 'withreleased') === false) unset($builds[$build->date][$buildID]);
if(strpos($params, 'deletereleased') !== false) unset($builds[$build->date][$buildID]);
}
}
}
+2
View File
@@ -2365,6 +2365,8 @@ EOD;
*/
public function checkSafeFile()
{
if($this->app->isContainer()) return false;
if($this->app->getModuleName() == 'upgrade' and $this->session->upgrading) return false;
$statusFile = $this->app->getAppRoot() . 'www' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'ok.txt';
+9 -23
View File
@@ -221,34 +221,20 @@ class file extends control
$this->view->fields = $this->post->fields;
$this->view->rows = $this->post->rows;
$this->host = common::getSysURL();
$kind = $this->post->kind;
switch($this->post->kind)
foreach($this->view->rows as $row)
{
case 'task':
foreach($this->view->rows as $row)
foreach($row as &$field)
{
$row->name = html::a($this->host . $this->createLink('task', 'view', "taskID=$row->id"), $row->name);
if(empty($field)) continue;
$field = preg_replace('/ src="{([0-9]+)(\.(\w+))?}" /', ' src="' . $this->host . helper::createLink('file', 'read', "fileID=$1", "$3") . '" ', $field);
}
break;
case 'story':
foreach($this->view->rows as $row)
{
$row->title= html::a($this->host . $this->createLink('story', 'view', "storyID=$row->id"), $row->title);
}
break;
case 'bug':
foreach($this->view->rows as $row)
{
$row->title= html::a($this->host . $this->createLink('bug', 'view', "bugID=$row->id"), $row->title);
}
break;
case 'testcase':
foreach($this->view->rows as $row)
{
$row->title= html::a($this->host . $this->createLink('testcase', 'view', "caseID=$row->id"), $row->title);
}
break;
if(in_array($kind, array('story', 'bug', 'testcase'))) $row->title = html::a($this->host . $this->createLink($kind, 'view', "{$kind}ID=$row->id"), $row->title);
if($kind == 'task') $row->name = html::a($this->host . $this->createLink('task', 'view', "taskID=$row->id"), $row->name);
}
$this->view->fileName = $this->post->fileName;
$output = $this->parse('file', 'export2Html');
+27
View File
@@ -1489,6 +1489,7 @@ class project extends control
$this->view->products = $products;
$this->view->allExecutions = $allExecutions;
$this->view->executions = $executions;
$this->view->buildPairs = $this->loadModel('build')->getBuildPairs(0);
$this->view->type = $type;
$this->display();
@@ -2313,6 +2314,32 @@ class project extends control
return print(html::select('execution', $executions, $executionID, "class='form-control'"));
}
/**
* AJAX: get a project by execution id.
*
* @param string $executionID
* @access public
* @return string
*/
public function ajaxGetPairsByExecution($executionID)
{
$execution = $this->loadModel('execution')->getByID($executionID);
$projectPairs = $this->loadModel('project')->getPairsByIdList($execution->project);
if($this->app->getViewType() == 'json')
{
$project = array('id' => key($projectPairs), 'name' => reset($projectPairs));
$pinyin = common::convert2Pinyin(array(reset($projectPairs)));
$project['namePinyin'] = zget($pinyin, $project['name']);
return print(json_encode($project));
}
else
{
return print(html::select('project', $projectPairs, $execution->project, "class='form-control' onchange='loadProductExecutions({$execution->project}, this.value)'"));
}
}
/**
* Link projects and code repositories.
*
+9
View File
@@ -81,7 +81,16 @@
<td class="c-name text-left" title='<?php echo $build->productName;?>'><?php echo $build->productName;?></td>
<?php endif;?>
<?php if($project->multiple):?>
<?php if($build->execution):?>
<td class="c-name text-left" title='<?php echo $build->executionName;?>'><?php echo $build->executionName;?></td>
<?php else:?>
<td class="c-name text-left">
<?php foreach(explode(',', $build->builds) as $childBuild):?>
<?php $buildName = zget($buildPairs, $childBuild);?>
<span title="<?php echo $buildName;?>"><?php echo $buildName;?></span></br>
<?php endforeach;?>
</td>
<?php endif;?>
<?php endif;?>
<td class="c-url" title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td class="c-url" title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
+3 -4
View File
@@ -133,7 +133,7 @@ class projectrelease extends control
$this->commonAction($projectID);
/* Get the builds that can select. */
$builds = $this->build->getBuildPairs($this->view->product->id, $this->view->branch, 'notrunk,withbranch|hasproject', $projectID, 'project');
$builds = $this->build->getBuildPairs($this->view->product->id, $this->view->branch, 'notrunk|withbranch|hasproject', $projectID, 'project', '', false);
$releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID);
foreach($releasedBuilds as $build) unset($builds[$build]);
@@ -190,7 +190,7 @@ class projectrelease extends control
$bindBuilds = $this->build->getByList($release->build);
/* Get the builds that can select. */
$builds = $this->build->getBuildPairs($release->product, $release->branch, 'notrunk|withbranch|hasproject', $this->session->project, 'project', '', false);
$builds = $this->build->getBuildPairs($release->product, $release->branch, 'notrunk|withbranch|hasproject', $this->session->project, 'project', $release->build, false);
$releasedBuilds = $this->projectrelease->getReleasedBuilds($this->session->project);
foreach($releasedBuilds as $releasedBuild)
{
@@ -199,7 +199,6 @@ class projectrelease extends control
if(!isset($bindBuilds[$bindBuildID])) unset($builds[$bindBuildID]);
}
}
unset($builds['trunk']);
/* Set project menu. */
$this->project->setMenu($this->session->project);
@@ -688,7 +687,7 @@ class projectrelease extends control
$this->config->bug->search['style'] = 'simple';
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan');
$this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch, 'id_desc', $release->project);
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 0, $params = '');
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 0);
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
$searchModules = array();
+1 -1
View File
@@ -335,7 +335,7 @@
<table class='table table-data'>
<?php if($project->hasProduct):?>
<tr>
<th class='w-90px'><?php echo $lang->release->product;?></th>
<th class='w-100px'><?php echo $lang->release->product;?></th>
<td><?php echo $release->productName;?></td>
</tr>
<?php if($release->productType != 'normal'):?>
+1 -1
View File
@@ -623,7 +623,7 @@ class release extends control
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan');
$this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch);
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 'all', $params = '');
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 'all');
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values'];
$searchModules = array();
+1 -1
View File
@@ -336,7 +336,7 @@
<div class='detail-content'>
<table class='table table-data'>
<tr>
<th class='w-90px'><?php echo $lang->release->product;?></th>
<th class='w-100px'><?php echo $lang->release->product;?></th>
<td><?php echo $release->productName;?></td>
</tr>
<?php if($release->productType != 'normal'):?>
+4 -4
View File
@@ -250,7 +250,7 @@ class testtask extends control
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter');
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk', 0, 'execution', '', false);
$execution = $this->loadModel('execution')->getByID($executionID);
if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution);
@@ -822,7 +822,7 @@ class testtask extends control
$this->view->task = $task;
$this->view->project = $this->project->getByID($projectID);
$this->view->executions = $executions;
$this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution');
$this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution', $task->build, false);
$this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport);
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', $task->owner);
$this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');
@@ -1421,7 +1421,7 @@ class testtask extends control
$this->view->case = $case;
$this->view->runID = $runID;
$this->view->results = $results;
$this->view->builds = $this->loadModel('build')->getBuildPairs($case->product, $case->branch, $params = '');
$this->view->builds = $this->loadModel('build')->getBuildPairs($case->product, $case->branch);
$this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter');
$this->display();
@@ -1491,7 +1491,7 @@ class testtask extends control
$projectID = $this->app->tab == 'qa' ? 0 : $this->session->project;
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID);
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk', 0, 'execution', '', false);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->importUnitResult;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
+1 -5
View File
@@ -8,11 +8,7 @@ function loadProductRelated()
{
loadExecutions($('#product').val());
loadTestReports($('#product').val());
buildData = '<select id="build" name="build" class="form-control"></select>';
$('#build').replaceWith(buildData);
$('#build_chosen').remove();
$("#build").chosen();
$('#build').trigger("chosen:updated");
loadExecutionRelated($('#execution').val())
}
/**