From bf3e8e33b3c99131a7543b68a1b5c36e63fbf405 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 30 Nov 2022 21:07:12 +0800 Subject: [PATCH] * Fix feedback #1403 . --- module/execution/js/taskkanban.js | 8 +++++--- module/execution/lang/de.php | 2 ++ module/execution/lang/en.php | 2 ++ module/execution/lang/fr.php | 2 ++ module/execution/lang/zh-cn.php | 2 ++ module/execution/lang/zh-tw.php | 2 ++ module/execution/view/taskkanban.html.php | 1 + module/kanban/model.php | 5 +++++ module/task/model.php | 10 ++++++++++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 0c02f13b2c..e7192cbed5 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -67,7 +67,8 @@ function renderUserAvatar(user, objectType, objectID, size, objectStatus) if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; var realname = user.realname ? user.realname : user.account; - return objectStatus == 'closed' ? '' : $('').avatar({user: user}); + var title = user.title ? user.title : realname; + return objectStatus == 'closed' ? '' : $('').avatar({user: user}); } /** @@ -286,8 +287,9 @@ function renderTaskItem(item, $item, col) { var priHtml = '' + item.pri + ''; var hoursHtml = scaleSize <= 1 && item.status != 'wait' ? ('' + taskLang.leftAB + ' ' + item.left + 'h') : ('' + taskLang.estimateAB + ' ' + item.estimate + 'h'); - var avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type); - + var avatarHtml = ''; + if(item.assignedTo == '' && item.mode == 'multi') avatarHtml = renderUserAvatar({title: item.assignedMembers, realname: iconTeam}, 'task', item.id, '', col.type); + else avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type); var $infos = $item.find('.infos'); if(!$infos.length) $infos = $('
'); $infos.html([priHtml, hoursHtml].join('')); diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index f57ee64420..0d0f5fbd7e 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Möchten Sie die Einstellungen des Kanbans zurücksetzen?'; $lang->kanbanSetting->optionList['0'] = 'Verstecken'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index ae355906b7..220e646a7d 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Do you want to reset Kanban?'; $lang->kanbanSetting->optionList['0'] = 'Hide'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 123c8c75ba..550fa7556d 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}"; $lang->execution->kanbanViewList['bug'] = 'Bug'; $lang->execution->kanbanViewList['task'] = 'Task'; +$lang->execution->iconTeam = 'Team'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = 'Voulez-vous réinitialiser le tableau Kanban ?'; $lang->kanbanSetting->optionList['0'] = 'Masquer'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index b748cf0623..09f48080d5 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -478,6 +478,8 @@ $lang->execution->kanbanViewList['story'] = "{$lang->SRCommon}看板"; $lang->execution->kanbanViewList['bug'] = 'Bug看板'; $lang->execution->kanbanViewList['task'] = '任务看板'; +$lang->execution->iconTeam = '团队'; + $lang->kanbanSetting = new stdclass(); $lang->kanbanSetting->noticeReset = '是否恢复看板默认设置?'; $lang->kanbanSetting->optionList['0'] = '隐藏'; diff --git a/module/execution/lang/zh-tw.php b/module/execution/lang/zh-tw.php index 3344de7b9e..05ba21bbf9 100644 --- a/module/execution/lang/zh-tw.php +++ b/module/execution/lang/zh-tw.php @@ -453,4 +453,6 @@ $lang->execution->statusColorList['doing'] = '#0BD986'; $lang->execution->statusColorList['suspended'] = '#fdc137'; $lang->execution->statusColorList['closed'] = '#838A9D'; +$lang->execution->iconTeam = '團隊'; + $lang->execution->boardColorList = array('#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#7FBB00', '#424BAC', '#66c5f8', '#EC2761'); diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index a4c48dbb19..82f91e7280 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -231,4 +231,5 @@ js::set('priv', config->minColWidth);?> config->maxColWidth);?> +execution->iconTeam);?> diff --git a/module/kanban/model.php b/module/kanban/model.php index a4a02a08c0..4e8773e766 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1511,6 +1511,11 @@ class kanbanModel extends model $cardData['status'] = $object->status; $cardData['left'] = $object->left; $cardData['estStarted'] = $object->estStarted; + $cardData['mode'] = $object->mode; + if($object->mode == 'multi') + { + $cardData['assignedMembers'] = $object->assignedMembers; + } } else { diff --git a/module/task/model.php b/module/task/model.php index 9bf08e1551..13b9baf141 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -3206,6 +3206,16 @@ class taskModel extends model $task->progress = round($task->consumed / ($task->consumed + $task->left), 2) * 100; } + if($task->mode == 'multi') + { + $assignedMembers = $this->dao->select('t1.realname')->from(TABLE_USER)->alias('t1') + ->leftJoin(TABLE_TASKTEAM)->alias('t2') + ->on('t1.account = t2.account') + ->where('t2.task')->eq($task->id) + ->fetchPairs(); + $task->assignedMembers= join(',', array_keys($assignedMembers)); + } + return $task; }