From e47cb9da8e1640296377820006bb390138181786 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 21 Nov 2024 05:19:51 +0000 Subject: [PATCH] * [task#133041,doing,1h] add switcher. --- config/filter.php | 1 + module/execution/js/task.ui.js | 7 +++++++ module/execution/ui/task.html.php | 19 +++++++++++++++++++ module/task/lang/de.php | 3 +++ module/task/lang/en.php | 3 +++ module/task/lang/fr.php | 3 +++ module/task/lang/zh-cn.php | 3 +++ 7 files changed, 39 insertions(+) diff --git a/config/filter.php b/config/filter.php index 55af96c780..2b006bf57d 100755 --- a/config/filter.php +++ b/config/filter.php @@ -355,6 +355,7 @@ $filter->task->export->cookie['checkedItem'] = 'reg::checked'; $filter->task->recordestimate->cookie['taskEffortFold'] = 'reg::checked'; $filter->execution->default->cookie['kanbanview'] = 'code'; +$filter->execution->default->cookie['taskViewType'] = 'code'; $filter->execution->story->cookie['storyPreExecutionID'] = 'int'; $filter->execution->story->cookie['storyModuleParam'] = 'int'; $filter->execution->story->cookie['storyProductParam'] = 'int'; diff --git a/module/execution/js/task.ui.js b/module/execution/js/task.ui.js index f7d0271348..1939bc4218 100644 --- a/module/execution/js/task.ui.js +++ b/module/execution/js/task.ui.js @@ -176,3 +176,10 @@ window.renderCell = function(result, info) return result; } + +$(document).off('click', '.switchButton').on('click', '.switchButton', function() +{ + var taskViewType = $(this).attr('data-type'); + $.cookie.set('taskViewType', taskViewType, {expires:config.cookieLife, path:config.webRoot}); + loadCurrentPage(); +}); diff --git a/module/execution/ui/task.html.php b/module/execution/ui/task.html.php index c3d23be416..9295b9c444 100644 --- a/module/execution/ui/task.html.php +++ b/module/execution/ui/task.html.php @@ -86,8 +86,26 @@ if($config->edition == 'ipd') } } +$viewType = $this->cookie->taskViewType ? $this->cookie->taskViewType : 'tree'; toolbar ( + item(set(array + ( + 'type' => 'btnGroup', + 'items' => array(array + ( + 'icon' => 'list', + 'class' => 'btn-icon switchButton' . ($viewType == 'tiled' ? ' text-primary' : ''), + 'data-type' => 'tiled', + 'hint' => $lang->task->viewTypeList['tiled'] + ), array + ( + 'icon' => 'treeview', + 'class' => 'switchButton btn-icon' . ($viewType == 'tree' ? ' text-primary' : ''), + 'data-type' => 'tree', + 'hint' => $lang->task->viewTypeList['tree'] + )) + ))), hasPriv('task', 'report') ? item(set(array ( 'icon' => 'bar-chart', @@ -206,6 +224,7 @@ jsVar('todayLabel', $lang->today); jsVar('yesterdayLabel', $lang->yesterday); jsVar('teamLang', $lang->task->team); +if($viewType == 'tiled') $cols['name']['nestedToggle'] = false; dtable ( set::groupDivider(true), diff --git a/module/task/lang/de.php b/module/task/lang/de.php index f033d8ea7f..75a8f4e130 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -245,6 +245,9 @@ $lang->task->afterChoices['continueAdding'] = ' Weitere Aufgaben erfassen'; $lang->task->afterChoices['toTaskList'] = 'Zurück zur Aufgabenliste'; $lang->task->afterChoices['toStoryList'] = 'Zurück zur Storyliste'; +$lang->task->viewTypeList['tiled'] = 'Tiled'; +$lang->task->viewTypeList['tree'] = 'Tree'; + $lang->task->legendBasic = 'Basis Info'; $lang->task->legendEffort = 'Aufwand'; $lang->task->legendLife = 'Aufgabenentwicklung'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 934c790cb3..4377c578f0 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -245,6 +245,9 @@ $lang->task->afterChoices['continueAdding'] = ' Continue Adding Tasks'; $lang->task->afterChoices['toTaskList'] = 'Go to Task List'; $lang->task->afterChoices['toStoryList'] = 'Go to Story List'; +$lang->task->viewTypeList['tiled'] = 'Tiled'; +$lang->task->viewTypeList['tree'] = 'Tree'; + $lang->task->legendBasic = 'Basic Info'; $lang->task->legendEffort = 'Effort'; $lang->task->legendLife = 'Task Life'; diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index f511638f2d..56a8cafa6f 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -245,6 +245,9 @@ $lang->task->afterChoices['continueAdding'] = ' Continuer Ajouter Tâches'; $lang->task->afterChoices['toTaskList'] = 'Aller à la liste des Tâches'; $lang->task->afterChoices['toStoryList'] = 'Aller à la liste des Stories'; +$lang->task->viewTypeList['tiled'] = 'Tiled'; +$lang->task->viewTypeList['tree'] = 'Tree'; + $lang->task->legendBasic = 'Infos de Base'; $lang->task->legendEffort = 'Effort'; $lang->task->legendLife = 'Vie de la Tâche'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index cfb663b56c..e31e373664 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -241,6 +241,9 @@ $lang->task->editModeList['single'] = '单人任务'; $lang->task->editModeList['linear'] = '多人串行'; $lang->task->editModeList['multi'] = '多人并行'; +$lang->task->viewTypeList['tiled'] = '平铺'; +$lang->task->viewTypeList['tree'] = '树状'; + $lang->task->afterChoices['continueAdding'] = "继续为该{$lang->SRCommon}添加任务"; $lang->task->afterChoices['toTaskList'] = '返回任务列表'; $lang->task->afterChoices['toStoryList'] = "返回{$lang->SRCommon}列表";