* Finish task #5443,#5442,#5441

This commit is contained in:
yfl
2019-05-05 08:38:23 +08:00
parent b61f20d071
commit 94aa0ca8a6
14 changed files with 35 additions and 35 deletions
+6
View File
@@ -129,6 +129,12 @@ $lang->action->desc->diff2 = '修改了 <strong><i>%s</i></strong>,
$lang->action->desc->diff3 = '将文件名 %s 改为 %s 。' . "\n";
$lang->action->desc->linked2bug = '$date 由 <strong>$actor</strong> 关联到版本 <strong>$extra</strong>';
/* 子任务修改父任务的历史操作记录 */
$lang->action->desc->linkchildtask = '$date, 由 <strong>$actor</strong> 关联子任务 <strong>$extra</strong>。' . "\n";
$lang->action->desc->unlinkchildrentask = '$date, 由 <strong>$actor</strong> 移除子任务 <strong>$extra</strong>。' . "\n";
$lang->action->desc->linkparenttask = '$date, 由 <strong>$actor</strong> 关联父任务 <strong>$extra</strong>。' . "\n";
/* 关联用例和移除用例时的历史操作记录。*/
$lang->action->desc->linkrelatedcase = '$date, 由 <strong>$actor</strong> 关联相关用例 <strong>$extra</strong>。' . "\n";
$lang->action->desc->unlinkrelatedcase = '$date, 由 <strong>$actor</strong> 移除相关用例 <strong>$extra</strong>。' . "\n";
+2 -2
View File
@@ -291,7 +291,7 @@ class actionModel extends model
$title = $this->dao->select('title')->from(TABLE_STORY)->where('id')->eq($action->extra)->fetch('title');
if($title) $action->extra = common::hasPriv('story', 'view') ? html::a(helper::createLink('story', 'view', "storyID=$action->extra"), "#$action->extra " . $title) : "#$action->extra " . $title;
}
elseif($actionName == 'totask')
elseif($actionName == 'totask' or $actionName == 'linkchildtask' or $actionName == 'unlinkchildrentask' or $actionName == 'linkparenttask')
{
$name = $this->dao->select('name')->from(TABLE_TASK)->where('id')->eq($action->extra)->fetch('name');
if($name) $action->extra = common::hasPriv('task', 'view') ? html::a(helper::createLink('task', 'view', "taskID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name;
@@ -365,7 +365,7 @@ class actionModel extends model
if($history->field == 'git') $history->diff = str_replace('+', '%2B', $history->diff);
}
}
$action->comment = $this->file->setImgSize($action->comment, $this->config->action->commonImgSize);
$actions[$actionID] = $action;
}
+4 -5
View File
@@ -1670,13 +1670,12 @@ class bugModel extends model
{
$datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('value DESC')->fetchAll('name');
if(!$datas) return array();
/* Judge if all product or not. */
$products = $this->session->product;
preg_match('/`product` IN \((?P<productIds>.+)\)/', $this->reportCondition(), $matchs);
if(!empty($matchs) and isset($matchs['productIds']))
{
$products = strtr($matchs['productIds'], array('\'' => ''));
}
preg_match('/`product` IN \((?P<productIdList>.+)\)/', $this->reportCondition(), $matchs);
if(!empty($matchs) and isset($matchs['productIdList'])) $products = str_replace('\'', '', $matchs['productIdList']);
$builds = $this->loadModel('build')->getProductBuildPairs($products, $branch = 0, $params = '');
/* Deal with the situation that a bug maybe associate more than one openedBuild. */
foreach($datas as $buildIDList => $data)
{
+1 -6
View File
@@ -137,14 +137,9 @@ class release extends control
$release = $this->release->getById((int)$releaseID, true);
if(!$release) die(js::error($this->lang->notFound) . js::locate('back'));
$stories = array();
/*task 5379*/
if($link == 'false')
{
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0)
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($release->stories)->andWhere('deleted')->eq(0)
->beginIF($type == 'story')->orderBy($orderBy)->fi()
->fetchAll('id');
}
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story');
$stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($release->stories)->andWhere('branch')->eq($release->branch)->fetchPairs('story', 'stage');
+2 -1
View File
@@ -2,6 +2,7 @@
.chosen-container[id^="story"] .chosen-drop {min-width: 450px !important;}
.chosen-container[id^="module"] .chosen-drop {min-width: 400px !important;}
[id^=name] {min-width: 165px;}
#mainContent .main-header h2{max-width:300px}
#batchCreateForm .input-group,
#batchCreateForm .input-group .form-control {position: static;}
@@ -18,4 +19,4 @@
.chosen-results > li.has-task,
.chosen-results > li.has-new-task {position: relative; color: #388E3C;}
.chosen-results > li.has-task.highlighted,
.chosen-results > li.has-new-task.highlighted {color: #fff;}
.chosen-results > li.has-new-task.highlighted {color: #fff;}
-5
View File
@@ -274,8 +274,3 @@ $lang->task->report->tasksPerClosedReason->graph->xAxisName = '关闭原因';
$lang->task->report->finishedTasksPerDay->type = 'bar';
$lang->task->report->finishedTasksPerDay->graph->xAxisName = '日期';
$lang->task->action = new stdclass();
$lang->task->action->batchcreate = array('main' => '$date, 由 <strong>$actor</strong> 创建子任务 。');
$lang->task->action->unlink = array('main' => '$date, 由 <strong>$actor</strong> 取消关联父任务 。');
$lang->task->action->linkto = array('main' => '$date, 由 <strong>$actor</strong> 关联到父任务 。');
+4 -5
View File
@@ -679,10 +679,9 @@ class taskModel extends model
if(isset($task->parent) and $task->parent != $oldTask->parent)
{
$comment = html::a(helper::createLink('task', 'view', 'taskID=' . $taskID), $task->name);
$this->loadModel('action')->create('task', $task->parent, 'linkTo', $comment);
$this->loadModel('action')->create('task', $oldTask->parent, 'unLink', $comment);
$this->loadModel('action')->create('task', $task->parent, 'linkChildTask', '', $taskID);
$this->loadModel('action')->create('task', $oldTask->parent, 'unLinkChildrenTask', '', $taskID);
$this->loadModel('action')->create('task', $taskID, 'linkParentTask', '', $task->parent);
}
$task = $this->loadModel('file')->processImgURL($task, $this->config->task->editor->edit['id'], $this->post->uid);
@@ -751,7 +750,7 @@ class taskModel extends model
if($oldTask->parent > 0)
{
if($task->parent == 0) $this->computeWorkingHours($oldTask->parent);
$this->updateParentStatus($taskID);
$this->updateParentStatus($taskID, false);
$this->computeBeginAndEnd($oldTask->parent);
}
+1 -1
View File
@@ -14,7 +14,7 @@
<?php include '../../common/view/datepicker.html.php';?>
<div id="mainContent" class="main-content fade">
<div class="main-header clearfix">
<h2 class="pull-left" style='max-width:300px'>
<h2 class="pull-left">
<?php if($parent):?>
<span class='pull-left'><?php echo $parentTitle . $this->lang->colon;?></span>
<?php echo $lang->task->batchCreateChildren;?>
+1 -1
View File
@@ -152,6 +152,7 @@
<?php if(!isonlybody()) echo "<div class='divider'></div>";?>
<?php if(!$task->deleted):?>
<?php
if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'treemap-alt', '', '', '', "title='{$lang->task->children}'", $lang->task->children);
common::printIcon('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $task, 'button', '', '', 'iframe', true, '', empty($task->team) ? $lang->task->assignTo : $lang->task->transfer);
common::printIcon('task', 'start', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true);
common::printIcon('task', 'restart', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true);
@@ -163,7 +164,6 @@
common::printIcon('task', 'cancel', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true);
if(!isonlybody()) echo "<div class='divider'></div>";
if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', 'treemap-alt', '', '', '', "title='{$lang->task->children}' target='__blank'", ' ');
common::printIcon('task', 'edit', "taskID=$task->id", $task, 'button', '', '', 'showinonlybody');
common::printIcon('task', 'create', "projctID={$task->project}&storyID=0&moduleID=0&taskID=$task->id", $task, 'button', 'copy');
common::printIcon('task', 'delete', "projectID=$task->project&taskID=$task->id", $task, 'button', 'trash', 'hiddenwin');
+2 -3
View File
@@ -807,16 +807,15 @@ class testcase extends control
* @access public
* @return void
*/
public function delete($caseID, $runID ,$confirm = 'no')
public function delete($caseID, $confirm = 'no')
{
if($confirm == 'no')
{
die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&runID=$runID&confirm=yes")));
die(js::confirm($this->lang->testcase->confirmDelete, inlink('delete', "caseID=$caseID&confirm=yes")));
}
else
{
$this->testcase->delete(TABLE_CASE, $caseID);
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq($runID)->exec();
/* if ajax request, send result. */
if($this->server->ajax)
{
+1 -1
View File
@@ -117,7 +117,7 @@
common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'button', 'copy');
if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module&param=$case->id", $case), "<i class='icon-copy'></i>", '', "class='btn' title='{$lang->testcase->copy}'");
common::printIcon('testcase', 'delete', "caseID=$case->id&runID=$runID", $case, 'button', 'trash', 'hiddenwin');
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin');
?>
<?php endif;?>
</div>
+9 -1
View File
@@ -499,7 +499,15 @@ class testtaskModel extends model
*/
public function getDataOfTestTaskPerRunResult($taskID)
{
$datas = $this->dao->select('lastRunResult AS name, COUNT(*) AS value')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->groupBy('name')->orderBy('value DESC')->fetchAll('name');
$datas = $this->dao->select("t1.lastRunResult AS name, COUNT('t1.*') AS value")->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')
->on('t1.case = t2.id')
->where('t1.task')->eq($taskID)
->andWhere('t2.deleted')->eq(0)
->groupBy('name')
->orderBy('value DESC')
->fetchAll('name');
if(!$datas) return array();
foreach($datas as $result => $data) $data->name = isset($this->lang->testcase->resultList[$result])? $this->lang->testcase->resultList[$result] : $this->lang->testtask->unexecuted;
+1 -1
View File
@@ -1,2 +1,2 @@
#projectModal .modal-dialog, #productModal .modal-dialog {top: auto!important; bottom: 90px;}
.body-modal #projectModal .modal-dialog, .body-modal #productModal .modal-dialog {top: auto!important; bottom: 55px;}
.body-modal #projectModal .modal-dialog, .body-modal #productModal .modal-dialog {top: auto!important; bottom: 55px;}
+1 -3
View File
@@ -243,8 +243,6 @@
<?php echo $lang->todo->thisIsPrivate;?>
<?php endif;?>
<script>
$(function(){
parent.$('body.hide-modal-close').removeClass('hide-modal-close');
})
$(function() { parent.$('body.hide-modal-close').removeClass('hide-modal-close'); })
</script>
<?php include '../../common/view/footer.html.php';?>