* Finish task #46551.

This commit is contained in:
liyuchun
2021-12-29 10:02:25 +08:00
parent 65386f6344
commit 8e98e9831e
8 changed files with 69 additions and 38 deletions

View File

@@ -422,9 +422,10 @@
<th><?php echo $lang->bug->linkMR;?></th>
<td>
<?php
$canViewMR = common::hasPriv('mr', 'view');
foreach($bug->linkMRTitles as $MRID => $linkMRTitle)
{
echo html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") . '<br />';
echo ($canViewMR ? html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") : "#$MRID $linkMRTitle"). '<br />';
}
?>
</td>

View File

@@ -208,6 +208,7 @@ class mrModel extends model
$MR->title = $this->lang->mr->common . ' ' . $postData->RepoSrcBranch . $this->lang->mr->to . $postData->RepoDistBranch ;
$MR->repoID = $repo->id;
$MR->jobID = isset($repo->job->id) ? $repo->job->id : 0;
$MR->status = 'opened';
$MR->synced = '0';
$MR->needCI = '1';
$MR->hasNoConflict = $postData->MergeStatus ? '0' : '1';

View File

@@ -717,6 +717,7 @@ class task extends control
$taskID = (int)$taskID;
$task = $this->task->getById($taskID, true);
$task->linkMRTitles = $this->loadModel('mr')->getLinkedMRPairs($taskID, 'task');
if(!$task)
{
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));

View File

@@ -3,3 +3,4 @@
.tab-pane table {border: 1px solid #ddd; border-top: none;}
.page-title{max-width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
.pull-left{max-width: 80%;}
.MRThWidth {width: 90px !important;}

View File

@@ -160,6 +160,7 @@ $lang->task->noFinished = 'Unfinished';
$lang->task->noClosed = 'Unclosed';
$lang->task->yesterdayFinished = 'Task Finished Yesterday';
$lang->task->allTasks = 'Task';
$lang->task->linkMR = 'Related MRs';
$lang->task->statusList[''] = '';
$lang->task->statusList['wait'] = 'Waiting';
@@ -199,6 +200,7 @@ $lang->task->legendEffort = 'Effort';
$lang->task->legendLife = 'Task Life';
$lang->task->legendDesc = 'Task Description';
$lang->task->legendDetail = 'Task Detail';
$lang->task->legendMisc = 'Misc.';
$lang->task->confirmDelete = "Do you want to delete this task?";
$lang->task->confirmDeleteEstimate = "Do you want to delete it?";

View File

@@ -160,6 +160,7 @@ $lang->task->noFinished = '未完成';
$lang->task->noClosed = '未关闭';
$lang->task->yesterdayFinished = '昨日完成任务数';
$lang->task->allTasks = '总任务';
$lang->task->linkMR = '相关合并请求';
$lang->task->statusList[''] = '';
$lang->task->statusList['wait'] = '未开始';
@@ -199,6 +200,7 @@ $lang->task->legendEffort = '工时信息';
$lang->task->legendLife = '任务的一生';
$lang->task->legendDesc = '任务描述';
$lang->task->legendDetail = '任务详情';
$lang->task->legendMisc = '其他相关';
$lang->task->confirmDelete = "您确定要删除这个任务吗?";
$lang->task->confirmDeleteEstimate = "您确定要删除这个记录吗?";

View File

@@ -160,6 +160,7 @@ $lang->task->noFinished = '未完成';
$lang->task->noClosed = '未關閉';
$lang->task->yesterdayFinished = '昨日完成任務數';
$lang->task->allTasks = '總任務';
$lang->task->linkMR = '相關合并請求';
$lang->task->statusList[''] = '';
$lang->task->statusList['wait'] = '未開始';
@@ -199,6 +200,7 @@ $lang->task->legendEffort = '工時信息';
$lang->task->legendLife = '任務的一生';
$lang->task->legendDesc = '任務描述';
$lang->task->legendDetail = '任務詳情';
$lang->task->legendMisc = '其他相關';
$lang->task->confirmDelete = "您確定要刪除這個任務嗎?";
$lang->task->confirmDeleteEstimate = "您確定要刪除這個記錄嗎?";

View File

@@ -359,43 +359,64 @@
</div>
</div>
</div>
<div class='cell'>
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->task->legendEffort;?></summary>
<div class="detail-content">
<table class='table table-data'>
<tr>
<th class='effortThWidth'><?php echo $lang->task->estimate;?></th>
<td><?php echo $task->estimate . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->consumed;?></th>
<td><?php echo round($task->consumed, 2) . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->left;?></th>
<td><?php echo $task->left . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->estStarted;?></th>
<td><?php echo $task->estStarted;?></td>
</tr>
<tr>
<th><?php echo $lang->task->realStarted;?></th>
<td><?php echo helper::isZeroDate($task->realStarted) ? '' : $task->realStarted; ?> </td>
</tr>
<tr>
<th><?php echo $lang->task->deadline;?></th>
<td>
<?php
echo $task->deadline;
if(isset($task->delay)) printf($lang->task->delayWarning, $task->delay);
?>
</td>
</tr>
</table>
<div class="cell">
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a href='#legendEffort' data-toggle='tab'><?php echo $lang->task->legendEffort;?></a></li>
<li><a href='#legendMisc' data-toggle='tab'><?php echo $lang->task->legendMisc;?></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='legendEffort'>
<table class="table table-data">
<tr>
<th class='effortThWidth'><?php echo $lang->task->estimate;?></th>
<td><?php echo $task->estimate . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->consumed;?></th>
<td><?php echo round($task->consumed, 2) . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->left;?></th>
<td><?php echo $task->left . $lang->workingHour;?></td>
</tr>
<tr>
<th><?php echo $lang->task->estStarted;?></th>
<td><?php echo $task->estStarted;?></td>
</tr>
<tr>
<th><?php echo $lang->task->realStarted;?></th>
<td><?php echo helper::isZeroDate($task->realStarted) ? '' : $task->realStarted; ?> </td>
</tr>
<tr>
<th><?php echo $lang->task->deadline;?></th>
<td>
<?php
echo $task->deadline;
if(isset($task->delay)) printf($lang->task->delayWarning, $task->delay);
?>
</td>
</tr>
</table>
</div>
<div class='tab-pane' id='legendMisc'>
<table class="table table-data">
<tr>
<th class='MRThWidth'><?php echo $lang->task->linkMR;?></th>
<td>
<?php
$canViewMR = common::hasPriv('mr', 'view');
foreach($task->linkMRTitles as $MRID => $linkMRTitle)
{
echo ($canViewMR ? html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") : "#$MRID $linkMRTitle"). '<br />';
}
?>
</td>
</tr>
</table>
</div>
</div>
</details>
</div>
</div>
<?php $this->printExtendFields($task, 'div', "position=right&inForm=0&inCell=1");?>
</div>