From 954221334bfaa3982f8b29ce03514d2f252a5010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 9 Nov 2021 10:38:09 +0800 Subject: [PATCH] * Finish task #43955. --- module/execution/js/kanban.js | 31 +++++++++++---------------- module/execution/view/kanban.html.php | 1 + 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 204d6504d3..23bcad2369 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -11,25 +11,20 @@ function changeView(view) */ function renderUserAvatar(user, objectType, objectID) { + if(objectType == 'task') var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); + if(objectType == 'story') var link = createLink('story', 'assignto', 'id=' + objectID, '', true); + if(objectType == 'bug') var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); + + if(!user) return $(''); + if(typeof user === 'string') user = {account: user}; if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account]; var $noPrivAvatar = $('
').avatar({user: user}); - if(objectType == 'task') - { - if(!priv.canAssignTask) return $noPrivAvatar; - var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID, '', true); - } - else if(objectType == 'story') - { - if(!priv.canAssignStory) return $noPrivAvatar; - var link = createLink('story', 'assignto', 'id=' + objectID, '', true); - } - else if(objectType == 'bug') - { - if(!priv.canAssignBug) return $noPrivAvatar; - var link = createLink('bug', 'assignto', 'id=' + objectID, '', true); - } + if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar; + if(objectType == 'task' && !priv.canAssignStory) return $noPrivAvatar; + if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar; + return $('').avatar({user: user}); } @@ -84,7 +79,7 @@ function renderStoryItem(item, $item, col) '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', ].join('')); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'story', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'story', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) @@ -133,7 +128,7 @@ function renderBugItem(item, $item, col) '' + item.pri + '', ].join('')); if(item.deadline) $infos.append(renderDeadline(item.deadline)); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'bug', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'bug', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) @@ -182,7 +177,7 @@ function renderTaskItem(item, $item, col) item.estimate ? '' + item.estimate + 'h' : '', ].join('')); if(item.deadline) $infos.append(renderDeadline(item.deadline)); - if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo, 'task', item.id)); + $infos.append(renderUserAvatar(item.assignedTo, 'task', item.id)); var $actions = $item.find('.actions'); if(!$actions.length && item.menus.length) diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 422ae7163a..8fffbce417 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -149,5 +149,6 @@ js::set('priv', execution->sortColumn);?> kanban);?> task->deadlineAB);?> +task->noAssigned);?>