* Finish task #72347.

This commit is contained in:
tianshujie
2022-10-19 13:46:18 +08:00
parent 2ca0f0cf0c
commit 8b2477b734
11 changed files with 105 additions and 17 deletions
+4 -2
View File
@@ -138,6 +138,7 @@ $filter->svn->cat = new stdclass();
$filter->svn->diff = new stdclass();
$filter->task->create = new stdclass();
$filter->task->export = new stdclass();
$filter->task->recordestimate = new stdclass();
$filter->execution->default = new stdclass();
$filter->execution->story = new stdclass();
$filter->testcase->default = new stdclass();
@@ -298,8 +299,9 @@ $filter->story->track->cookie['preProductID'] = 'int';
$filter->productplan->browse->cookie['viewType'] = 'code';
$filter->task->create->cookie['lastTaskModule'] = 'int';
$filter->task->export->cookie['checkedItem'] = 'reg::checked';
$filter->task->create->cookie['lastTaskModule'] = 'int';
$filter->task->export->cookie['checkedItem'] = 'reg::checked';
$filter->task->recordestimate->cookie['taskEffortFold'] = 'reg::checked';
$filter->execution->default->cookie['kanbanview'] = 'code';
$filter->execution->story->cookie['storyPreExecutionID'] = 'int';
+3 -3
View File
@@ -105,17 +105,17 @@ $config->task->datatable->fieldList['deadline']['control'] = 'date';
$config->task->datatable->fieldList['estimate']['title'] = 'estimateAB';
$config->task->datatable->fieldList['estimate']['fixed'] = 'no';
$config->task->datatable->fieldList['estimate']['width'] = '55';
$config->task->datatable->fieldList['estimate']['width'] = '65';
$config->task->datatable->fieldList['estimate']['required'] = 'no';
$config->task->datatable->fieldList['consumed']['title'] = 'consumedAB';
$config->task->datatable->fieldList['consumed']['fixed'] = 'no';
$config->task->datatable->fieldList['consumed']['width'] = '55';
$config->task->datatable->fieldList['consumed']['width'] = '65';
$config->task->datatable->fieldList['consumed']['required'] = 'no';
$config->task->datatable->fieldList['left']['title'] = 'leftAB';
$config->task->datatable->fieldList['left']['fixed'] = 'no';
$config->task->datatable->fieldList['left']['width'] = '55';
$config->task->datatable->fieldList['left']['width'] = '65';
$config->task->datatable->fieldList['left']['required'] = 'no';
$config->task->datatable->fieldList['progress']['title'] = 'progressAB';
+29 -8
View File
@@ -1219,7 +1219,7 @@ class task extends control
{
if(empty($orderBy))
{
$orderBy = 'order_asc,id';
$orderBy = 'id_desc';
}
else
{
@@ -1227,14 +1227,35 @@ class task extends control
$orderBy .= preg_replace('/(order_|date_)/', ',id_', $orderBy);
}
}
if(!$orderBy) $orderBy = 'date_asc';
$this->view->title = $this->lang->task->record;
$this->view->task = $task;
$this->view->from = $from;
$this->view->orderBy = $orderBy;
$this->view->efforts = $this->task->getTaskEstimate($taskID, '', '', $orderBy);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
if(!$orderBy) $orderBy = 'id_desc';
/* Set the fold state of the current task. */
$referer = strtolower($_SERVER['HTTP_REFERER']);
if(strpos($referer, 'recordestimate') and $this->cookie->taskEffortFold !== false)
{
$taskEffortFold = $this->cookie->taskEffortFold;
}
else
{
$taskEffortFold = 0;
$currentAccount = $this->app->user->account;
if($task->assignedTo == $currentAccount) $taskEffortFold = 1;
if(!empty($task->team))
{
$teamMember = array_column($task->team, 'account');
if(in_array($currentAccount, $teamMember)) $taskEffortFold = 1;
}
}
$this->view->title = $this->lang->task->record;
$this->view->task = $task;
$this->view->from = $from;
$this->view->orderBy = $orderBy;
$this->view->efforts = $this->task->getTaskEstimate($taskID, '', '', $orderBy);
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->taskEffortFold = $taskEffortFold;
$this->display();
}
+5
View File
@@ -21,3 +21,8 @@
.table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -7px;}
.table.has-sort-head thead>tr>th>a:hover, .table.has-sort-head thead>tr>th>a:hover:after, .table.has-sort-head thead>tr>th>a:hover:before {color: #000;}
#toggleFoldIcon:hover {cursor: pointer;}
#toggleFoldIcon .icon-border {width: 20px; height: 20px; border-radius: 8px; border: 1px solid #D5E5FF;}
#toggleFoldIcon .icon-border > .icon {color: #3785FF;}
#toggleFoldIcon .text {color: #3785FF;}
+29
View File
@@ -74,4 +74,33 @@ $(function()
{
$(this).prev().datetimepicker('show');
});
$('#toggleFoldIcon').click(function()
{
var fold = $(this).find('.icon-angle-down').length > 0;
var $icon = $(this).find('.icon-border > i');
var $text = $(this).find('.text');
$.cookie('taskEffortFold', fold ? 0 : 1);
if(fold)
{
/* Update icon and text. */
$icon.removeClass('icon-angle-down')
.addClass('icon-angle-top');
$text.text(foldEffort);
/* Show all efforts. */
$('.taskEffort > tbody > tr').removeClass('hidden');
}
else
{
$icon.removeClass('icon-angle-top')
.addClass('icon-angle-down');
$text.text(unfoldEffort);
/* Efforts whose number is greater than 3 are hidden. */
$('.taskEffort > tbody > tr').filter(':gt(2)').addClass('hidden');
}
});
})
+2
View File
@@ -60,6 +60,8 @@ $lang->task->replace = 'Replace';
$lang->task->myEffort = 'My Effort';
$lang->task->allEffort = 'Team Effort';
$lang->task->teamOrder = 'Order';
$lang->task->unfoldEffort = 'Unfold Effort';
$lang->task->foldEffort = 'Fold Effort';
$lang->task->common = 'Aufgabe';
$lang->task->id = 'ID';
+2
View File
@@ -60,6 +60,8 @@ $lang->task->replace = 'Replace';
$lang->task->myEffort = 'My Effort';
$lang->task->allEffort = 'Team Effort';
$lang->task->teamOrder = 'Order';
$lang->task->unfoldEffort = 'Unfold Effort';
$lang->task->foldEffort = 'Fold Effort';
$lang->task->common = 'Task';
$lang->task->id = 'ID';
+2
View File
@@ -60,6 +60,8 @@ $lang->task->replace = 'Replace';
$lang->task->myEffort = 'My Effort';
$lang->task->allEffort = 'Team Effort';
$lang->task->teamOrder = 'Order';
$lang->task->unfoldEffort = 'Unfold Effort';
$lang->task->foldEffort = 'Fold Effort';
$lang->task->common = 'Tâche';
$lang->task->id = 'ID';
+2
View File
@@ -60,6 +60,8 @@ $lang->task->replace = '替换';
$lang->task->myEffort = '我的日志';
$lang->task->allEffort = '团队日志';
$lang->task->teamOrder = '工序';
$lang->task->unfoldEffort = '展开日志';
$lang->task->foldEffort = '收起日志';
$lang->task->common = '任务';
$lang->task->id = '编号';
+11 -2
View File
@@ -50,7 +50,7 @@ foreach($efforts as $key => $effort)
<div class='tab-content'>
<div class='tab-pane' id='legendMyEffort'>
<?php if(!empty($myOrders)):?>
<table class='table table-bordered table-fixed table-recorded has-sort-head'>
<table class='table table-bordered table-fixed table-recorded has-sort-head taskEffort'>
<thead>
<tr class='text-center'>
<?php
@@ -69,11 +69,13 @@ foreach($efforts as $key => $effort)
</tr>
</thead>
<tbody>
<?php $i = 1;?>
<?php foreach($myOrders as $order => $count):?>
<?php $showOrder = false;?>
<?php foreach($myEfforts[$order] as $effort):?>
<?php if($effort->account != $this->app->user->account) continue;?>
<tr class="text-center">
<?php $hidden = ($taskEffortFold and $i > 3) ? 'hidden' : ''?>
<tr class="text-center <?php echo $hidden;?>">
<?php if(!$showOrder):?>
<td rowspan='<?php echo $count;?>'><?php echo $allOrders[$order];?></td>
<?php $showOrder = true;?>
@@ -93,10 +95,17 @@ foreach($efforts as $key => $effort)
?>
</td>
</tr>
<?php $i ++;?>
<?php endforeach;?>
<?php endforeach;?>
</tbody>
</table>
<div id='toggleFoldIcon'>
<?php $icon = $taskEffortFold ? 'icon-angle-down' : 'icon-angle-top'?>
<?php $iconText = $taskEffortFold ? $lang->task->unfoldEffort : $lang->task->foldEffort;?>
<span class='icon-border'><i class="icon <?php echo $icon;?>"></i></span>
<span class='text'><?php echo $iconText;?></span>
</div>
<?php endif;?>
</div>
<div class='tab-pane' id='legendAllEffort'>
+16 -2
View File
@@ -12,6 +12,9 @@
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php js::set('foldEffort', $lang->task->foldEffort);?>
<?php js::set('unfoldEffort', $lang->task->unfoldEffort);?>
<?php js::set('taskID', $task->id);?>
<?php if(!$this->task->canOperateEffort($task) and empty($myOrders)):?>
<style>#mainContent {min-height: unset;}</style>
<?php endif;?>
@@ -59,7 +62,7 @@ if(!empty($members) && $task->mode == 'linear')
<?php if(!empty($task->team) and $task->mode == 'linear'):?>
<?php include __DIR__ . '/lineareffort.html.php';?>
<?php else:?>
<table class='table table-bordered table-fixed table-recorded has-sort-head'>
<table class='table table-bordered table-fixed table-recorded has-sort-head taskEffort'>
<thead>
<tr class='text-center'>
<?php $vars = "taskID=$task->id&from=$from&orderBy=%s";?>
@@ -72,8 +75,10 @@ if(!empty($members) && $task->mode == 'linear')
</tr>
</thead>
<tbody>
<?php $i = 1;?>
<?php foreach($efforts as $effort):?>
<tr class="text-center">
<?php $hidden = ($taskEffortFold and $i > 3) ? 'hidden' : ''?>
<tr class="text-center <?php echo $hidden;?>">
<td><?php echo $effort->date;?></td>
<td><?php echo zget($users, $effort->account);?></td>
<td class="text-left" title="<?php echo $effort->work;?>"><?php echo $effort->work;?></td>
@@ -87,9 +92,18 @@ if(!empty($members) && $task->mode == 'linear')
?>
</td>
</tr>
<?php $i ++;?>
<?php endforeach;?>
</tbody>
</table>
<?php if(count($efforts) > 3):?>
<div id='toggleFoldIcon'>
<?php $icon = $taskEffortFold ? 'icon-angle-down' : 'icon-angle-top'?>
<?php $iconText = $taskEffortFold ? $lang->task->unfoldEffort : $lang->task->foldEffort;?>
<span class='icon-border'><i class="icon <?php echo $icon;?>"></i></span>
<span class='text'><?php echo $iconText;?></span>
</div>
<?php endif;?>
<?php endif;?>
<?php endif;?>
<?php if(!$this->task->canOperateEffort($task) and empty($myOrders)):?>