* [task#133222,doing,0.5h] add delay tip in execution::task.
This commit is contained in:
@@ -108,6 +108,7 @@ window.renderCell = function(result, info)
|
||||
if(info.col.name == 'name' && result)
|
||||
{
|
||||
let html = '';
|
||||
if(typeof result[0] == 'object') result[0].props.className = 'overflow-hidden';
|
||||
|
||||
const module = this.options.modules[info.row.data.module];
|
||||
if(module) html += '<span class="label gray-pale rounded-full mr-1 whitespace-nowrap">' + module + '</span>'; // 添加模块标签
|
||||
@@ -122,6 +123,8 @@ window.renderCell = function(result, info)
|
||||
}
|
||||
if(task.color) result[0].props.style = 'color: ' + task.color;
|
||||
if(html) result.unshift({html});
|
||||
if(typeof task.delay != 'undefined' && task.delay) result[result.length] = {html:'<span class="label danger-pale ml-1 flex-none nowrap">' + delayWarning.replace('%s', task.delay) + '</span>', className: 'flex items-end', style:{flexDirection:"column"}};
|
||||
|
||||
|
||||
if(task.fromBug > 0)
|
||||
{
|
||||
|
||||
@@ -1931,11 +1931,23 @@ class executionModel extends model
|
||||
$taskIdList = array_unique($taskIdList);
|
||||
$teamGroups = $this->dao->select('id,task,account,status')->from(TABLE_TASKTEAM)->where('task')->in($taskIdList)->fetchGroup('task', 'id');
|
||||
|
||||
$today = helper::today();
|
||||
foreach($executionTasks as $tasks)
|
||||
{
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if(isset($teamGroups[$task->id])) $task->team = $teamGroups[$task->id];
|
||||
|
||||
/* Delayed or not?. */
|
||||
if(!empty($task->deadline) and !helper::isZeroDate($task->deadline))
|
||||
{
|
||||
$endDate = $today;
|
||||
if(($task->status == 'done' || $task->status == 'closed') && !helper::isZeroDate($task->finishedDate)) $endDate = substr($task->finishedDate, 0, 10);
|
||||
|
||||
$actualDays = $this->loadModel('holiday')->getActualWorkingDays($task->deadline, $endDate);
|
||||
$delay = count($actualDays) - 1;
|
||||
if($delay > 0) $task->delay = $delay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,6 +204,7 @@ jsVar('childrenAB', $lang->task->childrenAB);
|
||||
jsVar('todayLabel', $lang->today);
|
||||
jsVar('yesterdayLabel', $lang->yesterday);
|
||||
jsVar('teamLang', $lang->task->team);
|
||||
jsVar('delayWarning', $lang->task->delayWarning);
|
||||
|
||||
dtable
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user