From 55f6cdb651520d1d5b707f029ab0e4d0081ed6b4 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 8 Jun 2022 15:53:37 +0800 Subject: [PATCH 01/22] * Finish task #56548. --- module/execution/control.php | 8 ++++++++ module/execution/js/importtask.js | 19 +++++++++++++++++++ module/execution/view/importtask.html.php | 8 ++++++++ module/execution/view/kanban.html.php | 4 +++- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index e89d613e03..56a85eadd3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -458,6 +458,14 @@ class execution extends control if(!empty($_POST)) { $this->execution->importTask($toExecution); + + /* If link from no head then reload. */ + if(isonlybody()) + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($toExecution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + return print(js::reload('parent')); + } + return print(js::locate(inlink('importTask', "toExecution=$toExecution&fromExecution=$fromExecution"), 'parent')); } diff --git a/module/execution/js/importtask.js b/module/execution/js/importtask.js index 47b2dca33d..015260e808 100644 --- a/module/execution/js/importtask.js +++ b/module/execution/js/importtask.js @@ -3,3 +3,22 @@ function reload(toProject, fromProject) link = createLink('execution','importtask','toProject='+toProject + '&fromProject='+fromProject); location.href = link; } + +$(function() +{ + $(".preview").modalTrigger({width:1000, type:'iframe'}); + + if(isonlybody == true) parent.$('#triggerModal .modal-content .modal-header .close').hide(); +}); + + +/** + * Go back. + * + * @access public + * @return void + */ +function goback() +{ + parent.location.reload(); +} diff --git a/module/execution/view/importtask.html.php b/module/execution/view/importtask.html.php index e03a6f48d7..d56e1131ba 100644 --- a/module/execution/view/importtask.html.php +++ b/module/execution/view/importtask.html.php @@ -11,6 +11,7 @@ */ ?> + From 35a857fd38f024760c649772930fc3aec4855168 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 9 Jun 2022 10:33:39 +0800 Subject: [PATCH 03/22] * Adjust code. --- module/execution/js/importtask.js | 1 - 1 file changed, 1 deletion(-) diff --git a/module/execution/js/importtask.js b/module/execution/js/importtask.js index 015260e808..f3626b5617 100644 --- a/module/execution/js/importtask.js +++ b/module/execution/js/importtask.js @@ -11,7 +11,6 @@ $(function() if(isonlybody == true) parent.$('#triggerModal .modal-content .modal-header .close').hide(); }); - /** * Go back. * From ea746e862f61c34195a29d21cf91dbc16c368c6c Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 9 Jun 2022 03:04:12 +0000 Subject: [PATCH 04/22] * Finish task #56362. --- module/execution/js/kanban.js | 32 ++++++++++++++++++++--- module/execution/js/taskkanban.js | 32 ++++++++++++++++++++--- module/execution/view/kanban.html.php | 1 + module/execution/view/taskkanban.html.php | 1 + module/kanban/model.php | 14 +++++----- 5 files changed, 68 insertions(+), 12 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 5c143b7fc3..e5e802fe54 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -457,6 +457,32 @@ function renderDeadline(deadline, status) return $('').text(deadlineLang + ' ' + deadlineDate).addClass(textColor); } +/** + * Render estStarted + * + * @param {String|Date} estStarted EstStarted + * @param {string} status + * @access public + * @return void + */ +function renderEstStarted(estStarted, status) +{ + if(estStarted == '0000-00-00') return; + + var date = $.zui.createDate(estStarted); + var now = new Date(); + now.setHours(0); + now.setMinutes(0); + now.setSeconds(0); + now.setMilliseconds(0); + var isEarlyThanToday = date.getTime() < now.getTime(); + var estStartedDate = $.zui.formatDate(date, 'MM-dd'); + var statusList = ['wait','doing','pause']; + var textColor = isEarlyThanToday && typeof(status) != 'undefined' && statusList.indexOf(status) != -1 ? 'text-red' : 'text-muted'; + + return $('').text(estStartedLang + ' ' + estStartedDate).addClass(textColor); +} + /** * Render story item * @param {Object} item Story item object @@ -606,8 +632,7 @@ function renderTaskItem(item, $item, col) var $title = $item.find('.title'); if(!$title.length) { - $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); + $title = $('' + (scaleSize <= 1 ? ' ' : '') + '').attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); $title.appendTo($item); } var name = rdSearchValue != '' ? "" + item.name.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "" + item.name + ""; @@ -623,7 +648,8 @@ function renderTaskItem(item, $item, col) var $infos = $item.find('.infos'); if(!$infos.length) $infos = $('
'); $infos.html([priHtml, hoursHtml].join('')); - if(item.deadline && scaleSize <= 1) $infos.append(renderDeadline(item.deadline, item.status)); + if(item.deadline && scaleSize <= 1 && (item.status == 'doing' || item.status == 'pause')) $infos.append(renderDeadline(item.deadline, item.status)); + if(item.estStarted && scaleSize <= 1 && item.status == 'wait') $infos.append(renderEstStarted(item.estStarted, item.status)); $infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml); if(scaleSize <= 1) $infos.appendTo($item); diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index f59eac1f7b..f99195330a 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -73,6 +73,32 @@ function renderDeadline(deadline, status) return $('').text(deadlineLang + ' ' + deadlineDate).addClass(textColor); } +/** + * Render estStarted + * + * @param {String|Date} estStarted EstStarted + * @param {string} status + * @access public + * @return void + */ +function renderEstStarted(estStarted, status) +{ + if(estStarted == '0000-00-00') return; + + var date = $.zui.createDate(estStarted); + var now = new Date(); + now.setHours(0); + now.setMinutes(0); + now.setSeconds(0); + now.setMilliseconds(0); + var isEarlyThanToday = date.getTime() < now.getTime(); + var estStartedDate = $.zui.formatDate(date, 'MM-dd'); + var statusList = ['wait','doing','pause']; + var textColor = isEarlyThanToday && typeof(status) != 'undefined' && statusList.indexOf(status) != -1 ? 'text-red' : 'text-muted'; + + return $('').text(estStartedLang + ' ' + estStartedDate).addClass(textColor); +} + /** * Render story item * @param {Object} item Story item object @@ -218,8 +244,7 @@ function renderTaskItem(item, $item, col) var $title = $item.find('.title'); if(!$title.length) { - $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)); + $title = $('' + (scaleSize <= 1 ? ' ' : '') + '').attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)); $title.appendTo($item); } $title.attr('title', item.name).find('.text').text(item.name); @@ -234,7 +259,8 @@ function renderTaskItem(item, $item, col) var $infos = $item.find('.infos'); if(!$infos.length) $infos = $('
'); $infos.html([priHtml, hoursHtml].join('')); - if(item.deadline && scaleSize <= 1) $infos.append(renderDeadline(item.deadline, item.status)); + if(item.deadline && scaleSize <= 1 && (item.status == 'doing' || item.status == 'pause')) $infos.append(renderDeadline(item.deadline, item.status)); + if(item.estStarted && scaleSize <= 1 && item.status == 'wait') $infos.append(renderEstStarted(item.estStarted, item.status)); $infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml); if(scaleSize <= 1) $infos.appendTo($item); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index a1c1615e0a..c4b14adc91 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -52,6 +52,7 @@ js::set('vision', $this->config->vision); js::set('productCount', count($productNames)); js::set('executionID', $execution->id); js::set('reviewStoryParis', $reviewStoryParis); +js::set('estStartedLang', $lang->task->estStarted); js::set('rdSearchValue', ''); $canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1; diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 7ec69b0041..5812853dd6 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -213,4 +213,5 @@ js::set('priv', fluidBoard);?> displayCards);?> +task->estStarted);?> diff --git a/module/kanban/model.php b/module/kanban/model.php index 1ec2c65282..d12387ac96 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1304,9 +1304,10 @@ class kanbanModel extends model if($cell->type == 'task') { if($searchValue != '' and strpos($object->name, $searchValue) === false) continue; - $cardData['name'] = $object->name; - $cardData['status'] = $object->status; - $cardData['left'] = $object->left; + $cardData['name'] = $object->name; + $cardData['status'] = $object->status; + $cardData['left'] = $object->left; + $cardData['estStarted'] = $object->estStarted; } else { @@ -1415,9 +1416,10 @@ class kanbanModel extends model if($lane->type == 'task') { if($searchValue != '' and strpos($object->name, $searchValue) === false) continue; - $cardData['name'] = $object->name; - $cardData['status'] = $object->status; - $cardData['left'] = $object->left; + $cardData['name'] = $object->name; + $cardData['status'] = $object->status; + $cardData['left'] = $object->left; + $cardData['estStarted'] = $object->estStarted; } else { From acf028e0a9fb17b905cfebf62a01f642daf8ec51 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Thu, 9 Jun 2022 03:24:15 +0000 Subject: [PATCH 05/22] * Fix bug. --- module/execution/js/kanban.js | 2 +- module/kanban/css/space.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 26ecb547fd..05fbb28851 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -740,7 +740,7 @@ function renderHeaderCol($column, column, $header, kanbanData) var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP')); /* Render more menu. */ - if(column.type == 'backlog' || column.type == 'wait' || column.type == 'unconfirmed' && $actions.children('.text-primary').length == 0) + if((column.type == 'backlog' || column.type == 'wait' || column.type == 'unconfirmed') && $actions.children('.text-primary').length == 0) { var tips = productID ? '' : 'onclick="tips()"'; $actions.append([ diff --git a/module/kanban/css/space.css b/module/kanban/css/space.css index fdda9edfc4..81caf15045 100644 --- a/module/kanban/css/space.css +++ b/module/kanban/css/space.css @@ -7,7 +7,7 @@ #spaceList .spaceActions > a{margin-left: 10px;} .space .menu {margin-left: 5px; margin-right:5px;} .space .table-empty-tip {padding: 40px 10px;} -.space .spaceTitle.pull-left {overflow: hidden; white-space: nowrap; max-width: calc(100% - 255px)} +.space .spaceTitle .pull-left {overflow: hidden; white-space: nowrap; max-width: calc(100% - 255px)} .spaceName {font-size: 16px; font-weight: bold;} .spaceTitle .icon-cube {font-size: 16px;} .spaceDesc {font-size: 13px; color: #838A9D; margin: -5px 0 5px 18px;} From 3c78c49df0412819fd76471e0b54395cd1e2a936 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 9 Jun 2022 11:30:35 +0800 Subject: [PATCH 06/22] * Fix bug for lite kanban. --- extension/lite/kanban/ext/model/lite.php | 6 ++++- .../lite/project/ext/view/execution.html.php | 26 +++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/extension/lite/kanban/ext/model/lite.php b/extension/lite/kanban/ext/model/lite.php index 3406eb1c33..7d0f5b2288 100644 --- a/extension/lite/kanban/ext/model/lite.php +++ b/extension/lite/kanban/ext/model/lite.php @@ -85,7 +85,7 @@ public function getKanban4Group($executionID, $browseType, $groupBy, $searchValu $columnData[$columnID]['actions'] = $column->actions; $cardOrder = 1; - $objects = zget($cardGroup, $columnID, array()); + $objects = zget($cardGroup, $column->columnType, array()); foreach($objects as $object) { if(empty($object)) continue; @@ -104,10 +104,14 @@ public function getKanban4Group($executionID, $browseType, $groupBy, $searchValu if($browseType == 'task') { + if($searchValue != '' and strpos($object->name, $searchValue) === false) continue; $cardData['name'] = $object->name; + $cardData['status'] = $object->status; + $cardData['left'] = $object->left; } else { + if($searchValue != '' and strpos($object->name, $searchValue) === false) continue; $cardData['title'] = $object->title; } diff --git a/extension/lite/project/ext/view/execution.html.php b/extension/lite/project/ext/view/execution.html.php index b9fc5931c4..fc569b5f0d 100644 --- a/extension/lite/project/ext/view/execution.html.php +++ b/extension/lite/project/ext/view/execution.html.php @@ -37,17 +37,17 @@
- cookie->kanbanview) $kanbanview = $this->cookie->kanbanview; - + if(!common::hasPriv('execution', $kanbanview)) { - foreach (explode('|', 'kanban|task|calendar|gantt|tree|grouptask') as $view) + foreach (explode('|', 'kanban|task|calendar|gantt|tree|grouptask') as $view) { if(common::hasPriv('execution', $view)) { - $kanbanview = $view; + $kanbanview = $view; break; } } @@ -93,24 +93,24 @@