diff --git a/module/execution/js/executionkanban.ui.js b/module/execution/js/executionkanban.ui.js index b3629b7c8d..78dd820f31 100644 --- a/module/execution/js/executionkanban.ui.js +++ b/module/execution/js/executionkanban.ui.js @@ -28,7 +28,6 @@ window.canDrop = function(dragInfo, dropInfo) const lane = this.getLane(dropInfo.lane); if(!column || !lane) return false; - console.log(dropInfo); if(dropInfo.type == 'item') return false; if(dragInfo.item.lane != lane.name) return false; if(dragInfo.item.status == 'wait' && dropInfo.col == 'doing') return privs.canStartExecution; diff --git a/module/kanban/css/view.ui.css b/module/kanban/css/view.ui.css index 5abbe16b23..d8ec675b0d 100644 --- a/module/kanban/css/view.ui.css +++ b/module/kanban/css/view.ui.css @@ -19,3 +19,13 @@ .regionMenu li.active > a:before {background: #fff} .regionMenu li a:hover {color: rgba(var(--color-primary-500-rgb),var(--tw-text-opacity));} .regionMenu li a span {vertical-align: bottom; overflow: hidden; max-width: 6em; white-space: nowrap; display: inline-block;} +.card-suffix.label {min-width: 46px;} + +.label-wait {background-color: rgba(var(--color-gray-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-gray-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-gray-500-rgb),var(--tw-ring-opacity));} +.label-doing {background-color: rgba(var(--color-danger-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-danger-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-danger-500-rgb),var(--tw-ring-opacity));} +.label-suspended {background-color: rgba(var(--color-warning-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-warning-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-warning-500-rgb),var(--tw-ring-opacity));} +.label-future {background-color: rgba(var(--color-gray-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-gray-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-gray-500-rgb),var(--tw-ring-opacity));} +.label-done {background-color: rgba(var(--color-success-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-success-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-success-500-rgb),var(--tw-ring-opacity));} +.label-closed {background-color: rgba(var(--color-gray-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-gray-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-gray-500-rgb),var(--tw-ring-opacity));} +.label-normal {background-color: rgba(var(--color-success-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-success-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-success-500-rgb),var(--tw-ring-opacity));} +.label-deleted {background-color: rgba(var(--color-danger-100-rgb),var(--tw-bg-opacity)); color: rgba(var(--color-danger-500-rgb),var(--tw-text-opacity)); --tw-ring-color: rgba(var(--color-danger-500-rgb),var(--tw-ring-opacity));} diff --git a/module/kanban/js/view.ui.js b/module/kanban/js/view.ui.js index 7b23a3667c..92ac40114d 100644 --- a/module/kanban/js/view.ui.js +++ b/module/kanban/js/view.ui.js @@ -127,6 +127,34 @@ window.buildColActions = function(col) * Render card content. */ window.getItem = function(info) +{ + if(info.item.fromType == 'execution') + { + renderExecutionItem(info); + } + else if(info.item.fromType == 'release') + { + renderReleaseItem(info); + } + else if(info.item.fromType == 'build') + { + renderBuildItem(info); + } + else if(info.item.fromType == 'productplan') + { + renderProductplanItem(info); + } + else if(info.item.fromType == 'ticket') + { + renderTicketItem(info); + } + else + { + renderGeneralItem(info) + } +} + +window.renderGeneralItem = function(info) { let begin = info.item.begin; let end = info.item.end; @@ -160,12 +188,52 @@ window.getItem = function(info) info.item.content = {html: content}; if(info.item.color && info.item.color != '#fff') info.item.className = 'color-' + info.item.color.replace('#', ''); - if(kanban.performable == 1 && (info.item.fromType == '' || info.item.fromType == 'execution')) + if(kanban.performable == 1) { - info.item.footer = {html: "
' + info.item.progress + '%' + '
'}; + info.item.footer = {html: "
' + info.item.progress + '%' + '
'}; } } +window.renderExecutionItem = function(info) +{ + info.item.icon = 'run'; + info.item.titleUrl = $.createLink('execution', 'task', `id=${info.item.fromID}`); + info.item.titleAttrs = {'class': 'text-black clip', 'title' : info.item.title}; + console.log(info.item); + if(info.item.delay) + { + info.item.suffix = executionLang.delayed; + info.item.suffixClass = 'label danger rounded-xl'; + } + + if(info.item.deleted == '0') + { + statusBox = '' + executionLang.statusList[info.item.objectStatus] + ''; + } + else + { + statusBox = '' + executionLang.deleted + ''; + } + const date = '' + info.item.end.slice(5) + ' ' + cardLang.deadlineAB + ''; + info.item.content = {html: statusBox + date} + if(kanban.performable == 1) + { + info.item.footer = {html: "
' + info.item.progress + '%' + '
'}; + } +} +window.renderReleaseItem = function(info) +{ +} +window.renderBuildItem = function(info) +{ +} +window.renderProductplanItem = function(info) +{ +} +window.renderTicketItem = function(info) +{ +} + function renderAvatar(avatarList) { if(avatarList.length == 0) diff --git a/module/kanban/model.php b/module/kanban/model.php index cd5a3066e8..645fe4e937 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1273,22 +1273,27 @@ class kanbanModel extends model $card = zget($cards, $cardID); $item = array(); - $item['column'] = $cell->column; - $item['lane'] = $cell->lane; - $item['title'] = htmlspecialchars_decode($card->name); - $item['id'] = $card->id; - $item['name'] = $card->id; - $item['pri'] = $card->pri; - $item['begin'] = $card->begin; - $item['end'] = $card->end; - $item['group'] = $card->group; - $item['region'] = $card->region; - $item['color'] = $card->color; - $item['progress'] = $card->progress; - $item['assignedTo'] = $card->assignedTo; - $item['fromType'] = $card->fromType; - $item['avatarList'] = array(); - $item['realnames'] = ''; + $item['column'] = $cell->column; + $item['lane'] = $cell->lane; + $item['title'] = htmlspecialchars_decode($card->name); + $item['id'] = $card->id; + $item['name'] = $card->id; + $item['pri'] = $card->pri; + $item['begin'] = $card->begin; + $item['end'] = $card->end; + $item['group'] = $card->group; + $item['region'] = $card->region; + $item['color'] = $card->color; + $item['progress'] = $card->progress; + $item['assignedTo'] = $card->assignedTo; + $item['fromID'] = $card->fromID; + $item['fromType'] = $card->fromType; + $item['delay'] = !empty($card->delay) ? $card->delay : 0; + $item['status'] = !empty($card->status) ? $card->status : ''; + $item['objectStatus'] = !empty($card->objectStatus) ? $card->objectStatus : ''; + $item['deleted'] = !empty($card->deleted) ? $card->deleted : 0; + $item['avatarList'] = array(); + $item['realnames'] = ''; if($card->assignedTo) { diff --git a/module/kanban/ui/view.html.php b/module/kanban/ui/view.html.php index 963173ec43..13245d21b0 100644 --- a/module/kanban/ui/view.html.php +++ b/module/kanban/ui/view.html.php @@ -50,6 +50,7 @@ jsVar('kanbanLang', $lang->kanban); jsVar('columnLang', $lang->kanbancolumn); jsVar('laneLang', $lang->kanbanlane); jsVar('cardLang', $lang->kanbancard); +jsVar('executionLang', $lang->execution); jsVar('kanbanID', $kanban->id); jsVar('kanban', $kanban); jsVar('groupCols', $groupCols);