From b1083a768c477bbe4b4ee53dc472ca79dca6585f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 8 Feb 2023 09:53:30 +0800 Subject: [PATCH 1/2] * Finish task #83948. --- module/execution/model.php | 2 +- module/kanban/js/view.js | 6 ++++-- module/kanban/model.php | 4 ++-- module/kanban/view/importexecution.html.php | 4 ++-- module/kanban/view/viewarchivedcard.html.php | 7 ++++--- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index d4b91ec336..576270964c 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1664,7 +1664,7 @@ class executionModel extends model elseif($param === 'hasParentName') { $parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($execution->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs(); - $executions[$execution->id]->name = implode('/', $parentExecutions); + $executions[$execution->id]->title = implode('/', $parentExecutions); } else { diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 372a7b8025..b53033d2d4 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -472,6 +472,7 @@ function renderExecutionItem(item, $item) ].join('')).appendTo($item); var $titleBox = $header.children('.executionName'); + debugger if(!$titleBox.length) $titleBox = $( [ '
', @@ -480,7 +481,8 @@ function renderExecutionItem(item, $item) /* Print execution name. */ var $title = $titleBox.children('.title'); - var name = item.title ? item.title : item.name; + var name = item.name ? item.name : item.title; + var title = item.title ? item.title : name; if(!$title.length) { var icon = mode == 'ALM' ? 'run' : 'project'; @@ -492,7 +494,7 @@ function renderExecutionItem(item, $item) { $title.append('' + item.title); } - $title.attr('title', name); + $title.attr('title', title); if(item.delay) { diff --git a/module/kanban/model.php b/module/kanban/model.php index b9e6bbb158..e7ff52d15f 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1282,8 +1282,8 @@ class kanbanModel extends model $objectCard->execType = $object->type; $objectCard->progress = isset($executionProgress[$objectID]->progress) ? $executionProgress[$objectID]->progress : 0; - $parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($object->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs(); - $objectCard->name = implode('/', $parentExecutions); + $parentExecutions = $this->dao->select('id,name')->from(TABLE_EXECUTION)->where('id')->in(trim($object->path, ','))->andWhere('type')->in('stage,kanban,sprint')->orderBy('grade')->fetchPairs(); + $objectCard->title = implode('/', $parentExecutions); } $objectCard->desc = strip_tags(htmlspecialchars_decode($object->desc)); diff --git a/module/kanban/view/importexecution.html.php b/module/kanban/view/importexecution.html.php index f7986a2b18..0b0061980c 100644 --- a/module/kanban/view/importexecution.html.php +++ b/module/kanban/view/importexecution.html.php @@ -62,11 +62,11 @@ id);?> - + name;?> - name;?> + name;?> execution->statusList, $execution->status);?> PM);?> diff --git a/module/kanban/view/viewarchivedcard.html.php b/module/kanban/view/viewarchivedcard.html.php index 45ccc742be..b871d9fbb6 100644 --- a/module/kanban/view/viewarchivedcard.html.php +++ b/module/kanban/view/viewarchivedcard.html.php @@ -105,15 +105,16 @@ js::set('systemMode', $this->config->systemMode); estimate and $card->estimate != 0) echo "{$card->estimate}h";?> title) ? $card->title : $card->name; + $name = isset($card->name) ? $card->name : $card->title; + $title = isset($card->title) ? $card->title : $name; $delayed = ''; if($card->fromType == 'execution' or $card->fromType == 'ticket') { $delayed = (!empty($card->delay) or (!helper::isZeroDate($card->deadline) and helper::now() > $card->deadline)) ? "{$lang->execution->delayed}" : ''; } - if(common::hasPriv($card->fromType, 'view')) echo "
" . html::a($this->createLink($card->fromType, 'view', "id=$card->fromID"), $name, '', " title='$name'") . "$delayed
"; - if(!common::hasPriv($card->fromType, 'view')) echo "
$name
$delayed
"; + if(common::hasPriv($card->fromType, 'view')) echo "
" . html::a($this->createLink($card->fromType, 'view', "id=$card->fromID"), $name, '', " title='$title'") . "$delayed
"; + if(!common::hasPriv($card->fromType, 'view')) echo "
$name
$delayed
"; if($card->fromType == 'productplan' or $card->fromType == 'build') { echo "
$card->desc
"; From e3473f4f11724e1c034897655cfd594519282968 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 8 Feb 2023 10:02:29 +0800 Subject: [PATCH 2/2] * Fitler executions of task #83953. --- module/repo/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/repo/model.php b/module/repo/model.php index d7f440f85a..decf85ddd8 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -2206,7 +2206,7 @@ class repoModel extends model $parents = $this->dao->select('distinct parent,parent')->from(TABLE_EXECUTION)->where('type')->eq('stage')->andWhere('grade')->gt(1)->andWhere('deleted')->eq(0)->fetchPairs(); foreach($executions as $execution) { - if(!empty($parents[$execution->id])) continue; + if(!empty($parents[$execution->id]) or ($execution->type == 'stage' and in_array($execution->attribute, array('request', 'design', 'review')) !== 'false')) continue; if($execution->type == 'stage' and $execution->grade > 1) {