diff --git a/config/filter.php b/config/filter.php index c700ab2094..ac0f39bb27 100755 --- a/config/filter.php +++ b/config/filter.php @@ -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'; diff --git a/module/task/config.php b/module/task/config.php index 8a6a6a8493..f2202e1f3f 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -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'; diff --git a/module/task/control.php b/module/task/control.php index c3255549d5..f9a8a9dc9d 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -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(); } diff --git a/module/task/css/recordestimate.css b/module/task/css/recordestimate.css index 05d5323044..5ead61fb66 100644 --- a/module/task/css/recordestimate.css +++ b/module/task/css/recordestimate.css @@ -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;} diff --git a/module/task/js/recordestimate.js b/module/task/js/recordestimate.js index e10c2adf66..c539fc9fc5 100644 --- a/module/task/js/recordestimate.js +++ b/module/task/js/recordestimate.js @@ -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'); + } + }); }) diff --git a/module/task/lang/de.php b/module/task/lang/de.php index f0a1f3ad84..6c33292cb2 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -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'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index ec3982d903..9c8d69c9ee 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -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'; diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index 0b2b1eb1e2..b3fa98a347 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -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'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 506c414896..f49cab8813 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -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 = '编号'; diff --git a/module/task/view/lineareffort.html.php b/module/task/view/lineareffort.html.php index c6677f2380..8cdf788056 100644 --- a/module/task/view/lineareffort.html.php +++ b/module/task/view/lineareffort.html.php @@ -50,7 +50,7 @@ foreach($efforts as $key => $effort)
- +
$effort) + $count):?> account != $this->app->user->account) continue;?> - + 3) ? 'hidden' : ''?> + @@ -93,10 +95,17 @@ foreach($efforts as $key => $effort) ?> +
+
+ + task->unfoldEffort : $lang->task->foldEffort;?> + + +
diff --git a/module/task/view/recordestimate.html.php b/module/task/view/recordestimate.html.php index 404b281ae2..9302b6c137 100644 --- a/module/task/view/recordestimate.html.php +++ b/module/task/view/recordestimate.html.php @@ -12,6 +12,9 @@ ?> +task->foldEffort);?> +task->unfoldEffort);?> +id);?> task->canOperateEffort($task) and empty($myOrders)):?> @@ -59,7 +62,7 @@ if(!empty($members) && $task->mode == 'linear') team) and $task->mode == 'linear'):?> - +
id&from=$from&orderBy=%s";?> @@ -72,8 +75,10 @@ if(!empty($members) && $task->mode == 'linear') + - + 3) ? 'hidden' : ''?> + @@ -87,9 +92,18 @@ if(!empty($members) && $task->mode == 'linear') ?> +
date;?> account);?> work;?>
+ 3):?> +
+ + task->unfoldEffort : $lang->task->foldEffort;?> + + +
+ task->canOperateEffort($task) and empty($myOrders)):?>