From e661948d675737b7f131e89be2c15a36ac8b2a65 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 09:21:05 +0800 Subject: [PATCH 01/24] * Finish story #32879,#32887,#32935,#32934. --- module/common/lang/menu.php | 12 +++++++++--- module/execution/model.php | 3 +++ module/project/model.php | 9 ++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index f0027aabb1..a5effd5d81 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -291,9 +291,15 @@ $lang->waterfall->menu->design['subMenu']->ads = array('link' => "{$lang->d $lang->waterfall->menu->design['subMenu']->bysearch = array('link' => ' ' . $lang->searchAB . ''); /* Kanban project menu. */ -$lang->kanban->menu = new stdclass(); -$lang->kanban->menuOrder = array(); -$lang->kanban->dividerMenu = ''; +$lang->kanbanProject = new stdclass(); +$lang->kanbanProject->menu = new stdclass(); +$lang->kanbanProject->menu->index = array('link' => "{$lang->kanban->common}|project|index|project=%s"); +$lang->kanbanProject->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); + +$lang->kanbanProject->menuOrder = array(); +$lang->kanbanProject->menuOrder[5] = 'index'; +$lang->kanbanProject->menuOrder[10] = 'build'; +$lang->kanbanProject->dividerMenu = ''; /* Execution menu. */ $lang->execution->homeMenu = new stdclass(); diff --git a/module/execution/model.php b/module/execution/model.php index 5f8e1727b2..482348b260 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -67,6 +67,9 @@ class executionModel extends model if($execution and $execution->type == 'kanban') { $this->lang->execution->menu = new stdclass(); + $this->lang->execution->menu->kanban = array('link' => "{$this->lang->kanban->common}|execution|kanban|executionID=%s"); + $this->lang->execution->menu->build = array('link' => "{$this->lang->build->common}|execution|build|executionID=%s"); + $this->lang->execution->dividerMenu = ''; $this->lang->execution->accessDenied = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->execution->accessDenied); } diff --git a/module/project/model.php b/module/project/model.php index 86027b4422..4e2373a169 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2483,7 +2483,14 @@ class projectModel extends model $project = $this->getByID($objectID); $model = 'scrum'; - if($project) $model = $project->model; + if($project and $project->model == 'waterfall') $model = $project->model; + if($project and $project->model == 'kanban') + { + $model = $project->model . 'Project'; + + global $lang; + $lang->executionCommon = $lang->project->kanban; + } if(isset($lang->$model)) { From 6c2e9532ffd4603a06ad141fd5e6d51493905400 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 31 May 2022 13:07:14 +0800 Subject: [PATCH 02/24] * Fixed the bug of the project to which the bug belongs when merging data. --- module/upgrade/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index ba8eb07128..4f20f43d42 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -4831,7 +4831,7 @@ class upgradeModel extends model /* Project linked objects. */ $this->dao->update(TABLE_TASK)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->exec(); $this->dao->update(TABLE_BUILD)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->andWhere('project')->eq(0)->exec(); - $this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->andWhere('project')->eq(0)->exec(); + $this->dao->update(TABLE_BUG)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->exec(); $this->dao->update(TABLE_DOC)->set('project')->eq($projectID)->set('type')->eq('execution')->where("lib IN(SELECT id from " . TABLE_DOCLIB . " WHERE type = 'project' and execution " . helper::dbIN($sprintIdList) . ')')->exec(); $this->dao->update(TABLE_DOCLIB)->set('project')->eq($projectID)->where('type')->eq('execution')->andWhere('execution')->in($sprintIdList)->exec(); $this->dao->update(TABLE_TESTTASK)->set('project')->eq($projectID)->where('execution')->in($sprintIdList)->exec(); From d58008d99c1feb5b2f7b2d527cb700f1c25cc746 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:28:52 +0800 Subject: [PATCH 03/24] * Finish task #55684. --- module/build/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index 3283ec5786..b43b55adfb 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -544,10 +544,12 @@ class buildModel extends model if($type == 'browse') { $executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution; + $execution = $this->loadModel('execution')->getByID($executionID); + $testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'"; if(common::hasPriv('build', 'linkstory') and common::canBeChanged('build', $build)) $menu .= $this->buildMenu('build', 'view', "{$params}&type=story&link=true", $build, $type, 'link', '', '', '', "data-app={$tab}", $this->lang->build->linkStory); - $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', "data-app='{$tab}'"); + $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', $testtaskApp); if($tab == 'execution') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); if($tab == 'project') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='project'", $this->lang->project->bug); From 04d79592c4882f73a667b1de416955954f8ab62d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:44:05 +0800 Subject: [PATCH 04/24] * Finish task #55684. --- module/testtask/control.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/testtask/control.php b/module/testtask/control.php index d295f3639d..6130e64327 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -248,6 +248,13 @@ class testtask extends control $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID); $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); + $execution = $this->loadModel('execution')->getByID($executionID); + if(!empty($execution) and $execution->type == 'kanban') + { + global $lang; + $this->lang->testtask->execution = str_replace($lang->execution->common, $lang->kanban->common, $this->lang->testtask->execution); + } + /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); From 1b89018e2f19389c0d27b1fafa9112be9db9fa92 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 13:55:59 +0800 Subject: [PATCH 05/24] * Optimized code for task #55684, #55683. --- module/project/model.php | 4 +--- module/testtask/control.php | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index 4e2373a169..6f00881165 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2486,9 +2486,7 @@ class projectModel extends model if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { - $model = $project->model . 'Project'; - - global $lang; + $model = $project->model . 'Project'; $lang->executionCommon = $lang->project->kanban; } diff --git a/module/testtask/control.php b/module/testtask/control.php index 6130e64327..8d29af46bc 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -249,11 +249,7 @@ class testtask extends control $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); $execution = $this->loadModel('execution')->getByID($executionID); - if(!empty($execution) and $execution->type == 'kanban') - { - global $lang; - $this->lang->testtask->execution = str_replace($lang->execution->common, $lang->kanban->common, $this->lang->testtask->execution); - } + if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); /* Set menu. */ $productID = $this->product->saveState($productID, $this->products); From ad8459599203928325558cc0428bb398580ddd80 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 31 May 2022 14:00:13 +0800 Subject: [PATCH 06/24] * Optimized code for task #55683. --- module/project/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/project/model.php b/module/project/model.php index 6f00881165..54e445c67c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2486,7 +2486,8 @@ class projectModel extends model if($project and $project->model == 'waterfall') $model = $project->model; if($project and $project->model == 'kanban') { - $model = $project->model . 'Project'; + $model = $project->model . 'Project'; + $lang->executionCommon = $lang->project->kanban; } From 18ef850d706f783ad240b5b93c7e7d2181acf47f Mon Sep 17 00:00:00 2001 From: liyuchun <563917701@qq.com> Date: Tue, 31 May 2022 06:08:29 +0000 Subject: [PATCH 07/24] * Fix bug #21565. --- module/install/lang/de.php | 2 +- module/install/lang/en.php | 2 +- module/install/lang/fr.php | 2 +- module/install/lang/vi.php | 2 +- module/install/lang/zh-cn.php | 2 +- module/install/lang/zh-tw.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/install/lang/de.php b/module/install/lang/de.php index 0b5cbc09de..3c5d313576 100644 --- a/module/install/lang/de.php +++ b/module/install/lang/de.php @@ -87,7 +87,7 @@ $lang->install->sessionFail = 'Bearbeiten Sie die PHP ini Datei um den session. $lang->install->mkdirWin = '

%s Verzeichnis muss erstellt werden.
Befehl mkdir %s zur Erstellung.

'; $lang->install->chmodWin = ' "%s" Berechtigung muss geändert werden.'; $lang->install->mkdirLinux = '

%s Verzeichnis muss erstellt werden.
Befehl mkdir -p %s zur Erstellung.

'; -$lang->install->chmodLinux = ' "%s" Berechtigung muss geändert werden.
Befehl chmod o=rwx -R %s für die Anpassung.'; +$lang->install->chmodLinux = ' "%s" Berechtigung muss geändert werden.
Befehl chmod 777 -R %s für die Anpassung.'; $lang->install->timezone = 'Set Timezone'; $lang->install->defaultLang = 'Standard Sprache'; diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 05fd01f835..ece915f469 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -116,7 +116,7 @@ $lang->install->sessionFail = 'Edit the php.ini file to set session.save_path.' $lang->install->mkdirWin = '

%s directory has to be created.
Run mkdir %s to create it.

'; $lang->install->chmodWin = ' "%s" privilege has to be changed.'; $lang->install->mkdirLinux = '

%s directory has to be created.
Run mkdir -p %s to create it.

'; -$lang->install->chmodLinux = ' "%s" permison has to be changed.
Run chmod o=rwx -R %s to change it.'; +$lang->install->chmodLinux = ' "%s" permison has to be changed.
Run chmod 777 -R %s to change it.'; $lang->install->timezone = 'Set Timezone'; $lang->install->defaultLang = 'Default Language'; diff --git a/module/install/lang/fr.php b/module/install/lang/fr.php index d84676a8bc..2ff0d5a146 100644 --- a/module/install/lang/fr.php +++ b/module/install/lang/fr.php @@ -87,7 +87,7 @@ $lang->install->sessionFail = 'Editez le fichier php.ini pour définier session $lang->install->mkdirWin = '

Le répertoire %s doit être créé.
Exécutez mkdir %s pour le créer.

'; $lang->install->chmodWin = ' "%s" privilege has to be changed.'; $lang->install->mkdirLinux = '

Le répertoire %s doit être créé.
Exécutez mkdir -p %s pour le créer.

'; -$lang->install->chmodLinux = 'Les permission de "%s" doivent être modifiées.
Exécutez chmod o=rwx -R %s pour les changer.'; +$lang->install->chmodLinux = 'Les permission de "%s" doivent être modifiées.
Exécutez chmod 777 -R %s pour les changer.'; $lang->install->timezone = 'Set Timezone'; $lang->install->defaultLang = 'Langue par défaut'; diff --git a/module/install/lang/vi.php b/module/install/lang/vi.php index 839e17700f..18d3343e75 100644 --- a/module/install/lang/vi.php +++ b/module/install/lang/vi.php @@ -87,7 +87,7 @@ $lang->install->sessionFail = 'Sửa the php.ini file to set session.save_path. $lang->install->mkdirWin = '

%s directory has to be created.
Run mkdir %s to create it.

'; $lang->install->chmodWin = ' "%s" privilege has to be changed.'; $lang->install->mkdirLinux = '

%s directory has to be created.
Run mkdir -p %s to create it.

'; -$lang->install->chmodLinux = ' "%s" permison has to be changed.
Run chmod o=rwx -R %s to change it.'; +$lang->install->chmodLinux = ' "%s" permison has to be changed.
Run chmod 777 -R %s to change it.'; $lang->install->timezone = 'Thiết lập Timezone'; $lang->install->defaultLang = 'Ngôn ngữ mặc định'; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 0830887beb..41978c0ac3 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -116,7 +116,7 @@ $lang->install->sessionFail = '修改PHP配置文件,设置session.save_path $lang->install->mkdirWin = '

需要创建目录%s。命令为:
mkdir %s

'; $lang->install->chmodWin = '需要修改目录 "%s" 的权限。'; $lang->install->mkdirLinux = '

需要创建目录%s。
命令为:
mkdir -p %s

'; -$lang->install->chmodLinux = '需要修改目录 "%s" 的权限。
命令为:
chmod o=rwx -R %s'; +$lang->install->chmodLinux = '需要修改目录 "%s" 的权限。
命令为:
chmod 777 -R %s'; $lang->install->timezone = '时区设置'; $lang->install->defaultLang = '默认语言'; diff --git a/module/install/lang/zh-tw.php b/module/install/lang/zh-tw.php index 13f8f4288f..8203e2fe47 100644 --- a/module/install/lang/zh-tw.php +++ b/module/install/lang/zh-tw.php @@ -116,7 +116,7 @@ $lang->install->sessionFail = '修改PHP配置檔案,設置session.save_path $lang->install->mkdirWin = '

需要創建目錄%s。命令為:
mkdir %s

'; $lang->install->chmodWin = '需要修改目錄 "%s" 的權限。'; $lang->install->mkdirLinux = '

需要創建目錄%s。
命令為:
mkdir -p %s

'; -$lang->install->chmodLinux = '需要修改目錄 "%s" 的權限。
命令為:
chmod o=rwx -R %s'; +$lang->install->chmodLinux = '需要修改目錄 "%s" 的權限。
命令為:
chmod 777 -R %s'; $lang->install->timezone = '時區設置'; $lang->install->defaultLang = '預設語言'; From 0665817eb8a59a42295efe9bddd17875c94835dd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 31 May 2022 17:20:22 +0800 Subject: [PATCH 08/24] * Finish task #55675. --- module/execution/control.php | 17 ++++++++++++----- module/execution/js/kanban.js | 21 +++++++++++---------- module/execution/js/taskkanban.js | 3 ++- module/execution/view/kanban.html.php | 8 ++++++-- module/kanban/control.php | 16 ++++++++++------ module/kanban/model.php | 19 ++++++++++++++++++- module/story/control.php | 27 ++++++++++++++++----------- 7 files changed, 75 insertions(+), 36 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index dd82569951..2c228fe1ba 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2115,8 +2115,10 @@ class execution extends control $this->loadModel('story'); if(empty($groupBy)) $groupBy = 'default'; + /* Set Session. */ $this->session->set('execLaneType', $browseType); + $this->session->set('execGroupBy', $groupBy); $this->session->set('storyList', $this->app->getURI(true), 'execution'); $this->lang->execution->menu = new stdclass(); @@ -2853,8 +2855,10 @@ class execution extends control { if($this->app->tab == 'execution' and $object->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($objectID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($objectID, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)")); } @@ -3656,10 +3660,11 @@ class execution extends control * @param int $productID * @param string $fromMethod * @param string $extra + * @param string $param * @access public * @return void */ - public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story', $extra = '') + public function importPlanStories($executionID, $planID, $productID = 0, $fromMethod = 'story', $extra = '', $param = '') { $planStories = $planProducts = array(); $planStory = $this->loadModel('story')->getPlanStories($planID); @@ -3687,7 +3692,8 @@ class execution extends control } $moduleName = 'execution'; - $param = "executionID=$executionID"; + if(empty($param)) $param = "executionID=$executionID"; + if(!empty($param)) $param = str_replace(array(',', ' '), array('&', ''), $param); if($execution->type == 'project') { $moduleName = 'projectstory'; @@ -3700,7 +3706,8 @@ class execution extends control $lang->executionCommon = $lang->execution->kanban; include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; } - if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, in_array($execution->type, array('sprint','project')) ? 'story' : 'kanban', $param)); + + if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate($this->createLink($moduleName, $fromMethod, $param)); return print(js::locate(helper::createLink($moduleName, $fromMethod, $param))); } diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index d15df83a39..f3cf82656a 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -180,7 +180,7 @@ function changeKanbanScaleSize(newScaleSize) } else { - var kanban = $('#kanban').data('zui.kanban'); + var kanban = $('#kanban' + executionID).data('zui.kanban'); if(!kanban) return; kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()}); } @@ -272,7 +272,7 @@ function createColumnCreateMenu(options) var col = $col.data('col'); var items = []; var laneID = col.$kanbanData.lanes[0].id ? col.$kanbanData.lanes[0].id : 0; - var regionID = col.$kanbanData.region; + var regionID = col.$kanbanData.region == undefined ? 0 : col.$kanbanData.region; if(col.type == 'backlog') { @@ -690,8 +690,6 @@ function renderCount($count, count, column) */ function renderHeaderCol($column, column, $header, kanbanData) { - if(groupBy != 'default') return; - /* Render group header. */ var privs = kanbanData.actions; var columnPrivs = kanbanData.columns[0].actions; @@ -703,7 +701,7 @@ function renderHeaderCol($column, column, $header, kanbanData) $actions = $column.children('.actions'); } - if(privs.includes('sortGroup')) + if(groupBy == 'default' && privs.includes('sortGroup')) { var groups = regions[column.region].groups; if($header.closest('.kanban').data('zui.kanban')) @@ -784,7 +782,8 @@ function updateRegion(regionID, regionData = []) if(!$region.length) return false; if(!regionData) regionData = regions[regionID]; - $region.data('zui.kanban').render(regionData.groups); + var data = groupBy == 'default' ? regionData.groups : regionData; + $region.data('zui.kanban').render(data); resetRegionHeight('open'); return true; } @@ -1053,7 +1052,7 @@ function updateKanban(kanbanData, regionID = 0) setTimeout(function() { $.zui.closeModal(); - if(regionID) + if(regionID && groupBy == 'default') { updateRegion(regionID, kanbanData[regionID]); } @@ -1062,7 +1061,8 @@ function updateKanban(kanbanData, regionID = 0) $('#kanban').children('.region').children("div[id^='kanban']").each(function() { var regionID = $(this).attr('data-id'); - updateRegion(regionID, kanbanData[regionID]); + var data = groupBy == 'default' ? kanbanData[regionID] : kanbanData[groupBy] + updateRegion(regionID, data); }); } }, 200); @@ -1317,8 +1317,9 @@ $(function() var planID = $('#plan').val(); if(planID) { - var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : ''; - location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban' + vars); + var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : ''; + var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy; + location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban' + vars + param); $.closeModal(); } }); diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index e952b470f0..5d8211a1a6 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -1141,7 +1141,8 @@ $(function() var planID = $('#plan').val(); if(planID) { - location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=kanban'); + var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy; + location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0&fromMethod=taskKanban&extra=' + param); } }); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index ec45f38420..dc1becccfa 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -232,8 +232,12 @@ js::set('hasTaskButton', $hasTaskButton);
-
-
+
+
+
+
+
+
diff --git a/module/kanban/control.php b/module/kanban/control.php index 782af7f301..da91c5fb76 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1508,9 +1508,11 @@ class kanban extends control if($from == 'RDKanban') { if(dao::isError()) return $this->sendError(dao::getError()); - $regionID = $column->region; - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = $column->region; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)")); } @@ -1589,9 +1591,11 @@ class kanban extends control if($from == 'RDKanban') { if(dao::isError()) return $this->sendError(dao::getError()); - $regionID = $column->region; - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = $column->region; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)")); } diff --git a/module/kanban/model.php b/module/kanban/model.php index 6ab2b71c5c..e28cbb4dfc 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1454,13 +1454,21 @@ class kanbanModel extends model $lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList); if(empty($lanes)) return array(); - $columns = $this->dao->select('t1.*, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1') + $columns = $this->dao->select('t1.*, GROUP_CONCAT(t1.cards) as cards, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1') ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.`column` = t2.id') + ->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t2.group = t3.group') + ->leftJoin(TABLE_KANBANREGION)->alias('t4')->on('t1.kanban = t4.kanban') ->where('t1.kanban')->eq($executionID) ->andWhere('t1.`type`')->eq($browseType) + ->andWhere('t3.deleted')->eq(0) + ->andWhere('t4.deleted')->eq(0) + ->groupBy('columnType') + ->orderBy('column_asc') ->fetchAll('columnType'); $cardGroup = array(); + $actions = array('setColumn', 'setWIP'); + foreach($columns as $column) { if(empty($column->cards)) continue; @@ -1492,6 +1500,14 @@ class kanbanModel extends model if(in_array($column->columnType, array('testing', 'tested'))) $parentColumn = 'test'; if(in_array($column->columnType, array('fixing', 'fixed'))) $parentColumn = 'resolving'; + /* Judge column action priv. */ + $column->actions = array(); + foreach($actions as $action) + { + if($this->isClickable($column, $action)) $column->actions[] = $action; + } + + $columnData[$column->column]['id'] = $column->column; $columnData[$column->column]['type'] = $column->columnType; $columnData[$column->column]['name'] = $column->columnName; @@ -1500,6 +1516,7 @@ class kanbanModel extends model $columnData[$column->column]['laneType'] = $browseType; $columnData[$column->column]['asParent'] = in_array($column->columnType, array('develop', 'test', 'resolving')) ? true : false; $columnData[$column->column]['parentType'] = $parentColumn; + $columnData[$column->column]['actions'] = $column->actions; $cardOrder = 1; $objects = zget($cardGroup, $column->columnType, array()); diff --git a/module/story/control.php b/module/story/control.php index a191e64875..bb5c1ceac5 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -80,7 +80,7 @@ class story extends control { $this->loadModel('kanban'); $regionPairs = $this->kanban->getRegionPairs($execution->id, 0, 'execution'); - $regionID = isset($output['regionID']) ? $output['regionID'] : key($regionPairs); + $regionID = !empty($output['regionID']) ? $output['regionID'] : key($regionPairs); $lanePairs = $this->kanban->getLanePairsByRegion($regionID, 'story'); $laneID = isset($output['laneID']) ? $output['laneID'] : key($lanePairs); @@ -680,9 +680,9 @@ class story extends control if(isonlybody()) { $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution' and $execution->type == 'kanban' and $kanbanGroup == 'default') + if($this->app->tab == 'execution' and $execution->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -1052,10 +1052,12 @@ class story extends control if(isonlybody()) { $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution' and $execution->type == 'kanban' and $this->app->tab == 'execution') + if($this->app->tab == 'execution' and $execution->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } @@ -1358,8 +1360,10 @@ class story extends control if($this->app->tab == 'execution' and $execution->type == 'kanban') { $this->loadModel('kanban')->updateLane($this->session->execution, 'story', $storyID); - $kanbanData = $this->kanban->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } @@ -1707,10 +1711,11 @@ class story extends control if(isonlybody()) { $execution = $this->execution->getByID($this->session->execution); - if($this->app->tab == 'execution' and $execution->type == 'kanban' and $kanbanGroup == 'default') + if($this->app->tab == 'execution' and $execution->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $execLaneType, 'id_desc', 0, $kanbanGroup); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } From c3af29cbee8083b4d935d8f302f15ff1f761adfc Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 1 Jun 2022 10:47:20 +0800 Subject: [PATCH 09/24] * Fix bug #23124. --- module/build/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index b43b55adfb..b84a606a5f 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -551,8 +551,8 @@ class buildModel extends model $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', $testtaskApp); - if($tab == 'execution') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); - if($tab == 'project') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='project'", $this->lang->project->bug); + if($tab == 'execution' and !empty($execution->type) and $execution->type != 'kanban') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); + if($tab == 'project' or empty($execution->type) or $execution->type == 'kanban') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='$tab'", $this->lang->project->bug); $menu .= $this->buildMenu('build', 'edit', $params, $build, $type); $menu .= $this->buildMenu('build', 'delete', $params, $build, $type, 'trash', 'hiddenwin'); From 2f1b1fc74ff1d2d61d81b14e0e5f215863c4d140 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 1 Jun 2022 10:48:30 +0800 Subject: [PATCH 10/24] * Fix bug #23124. --- module/build/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index b84a606a5f..a0e965c109 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -552,7 +552,7 @@ class buildModel extends model $menu .= $this->buildMenu('testtask', 'create', "product=$build->product&execution={$executionID}&build=$build->id", $build, $type, 'bullhorn', '', '', '', $testtaskApp); if($tab == 'execution' and !empty($execution->type) and $execution->type != 'kanban') $menu .= $this->buildMenu('execution', 'bug', "execution={$extraParams['executionID']}&productID={$extraParams['productID']}&orderBy=status&build=$build->id", $build, $type, '', '', '', '', $this->lang->execution->viewBug); - if($tab == 'project' or empty($execution->type) or $execution->type == 'kanban') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='$tab'", $this->lang->project->bug); + if($tab == 'project' or empty($execution->type) or $execution->type == 'kanban') $menu .= $this->buildMenu('build', 'view', "{$params}&type=generatedBug", $build, $type, 'bug', '', '', '', "data-app='$tab'", $this->lang->project->bug); $menu .= $this->buildMenu('build', 'edit', $params, $build, $type); $menu .= $this->buildMenu('build', 'delete', $params, $build, $type, 'trash', 'hiddenwin'); From 2fb1cc00323612de7d294ea37c83ca458ae0145e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 1 Jun 2022 10:57:07 +0800 Subject: [PATCH 11/24] * Finish task #55675. --- module/execution/js/kanban.js | 14 +++--- module/kanban/control.php | 19 ++++++-- module/kanban/model.php | 24 ++++++++-- module/task/control.php | 86 +++++++++++++++++++++-------------- 4 files changed, 97 insertions(+), 46 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index f3cf82656a..95fee6f6f1 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -816,7 +816,7 @@ function handleDropTask($element, event, kanban) var cardID = $card.data().id; var fromColType = $oldCol.data('type'); var toColType = $newCol.data('type'); - var regionID = $card.closest('.region').data().id; + var regionID = groupBy == 'default' ? $card.closest('.region').data().id : executionID; changeCardColType(cardID, oldCol.id, newCol.id, oldLane.id, newLane.id, cardType, fromColType, toColType, regionID); } @@ -831,8 +831,6 @@ var kanbanActionHandlers = */ function handleKanbanAction(action, $element, event, kanban) { - if(groupBy && groupBy != 'default') return false; - $('.kanban').attr('data-action-enabled', action); var handler = kanbanActionHandlers[action]; if(handler) handler($element, event, kanban); @@ -988,7 +986,8 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car url: link, success: function(data) { - updateRegion(regionID, data[regionID]); + data = groupBy == 'default' ? data[regionID] : data[groupBy]; + updateRegion(regionID, data); }, error: function(xhr, status, error) { @@ -1017,6 +1016,8 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car function deleteCard(objectType, objectID, regionID) { $.zui.ContextMenu.hide(); + + regionID = regionID ? regionID : 0; setTimeout(function() { var objectLang = objectType + 'Lang'; @@ -1033,7 +1034,8 @@ function deleteCard(objectType, objectID, regionID) url: url, success: function(data) { - updateRegion(regionID, data[regionID]); + data = groupBy == 'default' ? data[regionID] : data[groupBy]; + updateRegion(regionID, data); } }); }, 200) @@ -1230,7 +1232,7 @@ function initKanban($kanban) onRenderLaneName: renderLaneName, onRenderHeaderCol: renderHeaderCol, onRenderCount: renderCount, - droppable: groupBy == 'default' ? {target: findDropColumns, finish:handleFinishDrop} : false, + droppable: {target: findDropColumns, finish:handleFinishDrop}, virtualize: true, virtualCardList: true }); diff --git a/module/kanban/control.php b/module/kanban/control.php index da91c5fb76..6654116088 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1479,9 +1479,10 @@ class kanban extends control $this->loadModel($objectType)->delete(constant($table), $objectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $kanbanID = $this->kanban->getKanbanIDByregion($regionID); + $kanbanID = $regionID ? $this->kanban->getKanbanIDByregion($regionID) : $this->session->execution; $browseType = $this->config->vision == 'lite' ? 'task' : $this->session->execLaneType; - $kanbanGroup = $this->kanban->getRDKanban($kanbanID, $browseType); + $groupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanGroup = $this->kanban->getRDKanban($kanbanID, $browseType, 'id_desc', 0, $groupBy); return print(json_encode($kanbanGroup)); } @@ -1715,12 +1716,22 @@ class kanban extends control */ public function ajaxMoveCard($cardID = 0, $fromColID = 0, $toColID = 0, $fromLaneID = 0, $toLaneID = 0, $executionID = 0, $browseType = 'all', $groupBy = '', $regionID = 0, $orderBy = '') { - $fromCell = $this->dao->select('id, cards')->from(TABLE_KANBANCELL) + $fromCell = $this->dao->select('id, cards, lane')->from(TABLE_KANBANCELL) ->where('kanban')->eq($executionID) - ->andWhere('lane')->eq($fromLaneID) ->andWhere('`column`')->eq($fromColID) + ->beginIF(!$groupBy or $groupBy == 'default')->andWhere('lane')->eq($fromLaneID)->fi() + ->beginIF($groupBy and $groupBy != 'default') + ->andWhere('type')->eq($browseType) + ->andWhere('cards')->like("%,$cardID,%") + ->fi() ->fetch(); + if($groupBy and $groupBy != 'default') + { + $fromLaneID = $fromCell->lane; + $toLaneID = $fromCell->lane; + } + $toCell = $this->dao->select('id, cards')->from(TABLE_KANBANCELL) ->where('kanban')->eq($executionID) ->andWhere('lane')->eq($toLaneID) diff --git a/module/kanban/model.php b/module/kanban/model.php index e28cbb4dfc..05a625e814 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1456,7 +1456,7 @@ class kanbanModel extends model $columns = $this->dao->select('t1.*, GROUP_CONCAT(t1.cards) as cards, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1') ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.`column` = t2.id') - ->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t2.group = t3.group') + ->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t1.lane = t3.id') ->leftJoin(TABLE_KANBANREGION)->alias('t4')->on('t1.kanban = t4.kanban') ->where('t1.kanban')->eq($executionID) ->andWhere('t1.`type`')->eq($browseType) @@ -1490,6 +1490,7 @@ class kanbanModel extends model $laneData['name'] = (($groupBy == 'pri' or $groupBy == 'severity') and $laneID) ? $this->lang->$browseType->$groupBy . ':' . $lane->name : $lane->name; $laneData['color'] = $lane->color; $laneData['order'] = $lane->order; + $laneData['type'] = $browseType; $laneData['defaultCardType'] = $browseType; /* Construct kanban column data. */ @@ -1507,7 +1508,6 @@ class kanbanModel extends model if($this->isClickable($column, $action)) $column->actions[] = $action; } - $columnData[$column->column]['id'] = $column->column; $columnData[$column->column]['type'] = $column->columnType; $columnData[$column->column]['name'] = $column->columnName; @@ -1621,6 +1621,7 @@ class kanbanModel extends model foreach($objectPairs as $objectID => $objectName) { if(!isset($groupByList[$objectID]) and $objectID) continue; + if($browseType == 'task' and $groupBy == 'type' and !$objectID) continue; $lane = new stdclass(); $lane->id = $groupBy . $objectID; @@ -3132,7 +3133,24 @@ class kanbanModel extends model */ public function moveCard($cardID, $fromColID, $toColID, $fromLaneID, $toLaneID, $kanbanID = 0) { - $fromCellCards = $this->dao->select('cards')->from(TABLE_KANBANCELL)->where('lane')->eq($fromLaneID)->andWhere('`column`')->eq($fromColID)->fetch('cards'); + $groupBy = $this->session->execGroupBy ? $this->session->execGroupBy : ''; + + $fromCell = $this->dao->select('cards, lane')->from(TABLE_KANBANCELL) + ->where('`column`')->eq($fromColID) + ->beginIF(!$groupBy or $groupBy == 'default')->andWhere('lane')->eq($fromLaneID)->fi() + ->beginIF($groupBy and $groupBy != 'default') + ->andWhere('type')->eq($this->session->execLaneType) + ->andWhere('cards')->like("%,$cardID,%") + ->fi() + ->fetch(); + + if($groupBy and $groupBy != 'default') + { + $fromLaneID = $fromCell->lane; + $toLaneID = $fromCell->lane; + } + + $fromCellCards = $fromCell->cards; $toCell = $this->dao->select('*')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch(); $toCellCards = $this->dao->select('cards')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch('cards'); diff --git a/module/task/control.php b/module/task/control.php index 387200148c..babc3b8ff2 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -90,7 +90,7 @@ class task extends control if($execution->type == 'kanban') { $regionPairs = $this->kanban->getRegionPairs($execution->id, 0, 'execution'); - $regionID = isset($output['regionID']) ? $output['regionID'] : key($regionPairs); + $regionID = !empty($output['regionID']) ? $output['regionID'] : key($regionPairs); $lanePairs = $this->kanban->getLanePairsByRegion($regionID, 'task'); $laneID = isset($output['laneID']) ? $output['laneID'] : key($lanePairs); @@ -139,7 +139,7 @@ class task extends control /* if status is exists then this task has exists not new create. */ if($taskID['status'] == 'exists') continue; - $taskID = $taskID['id']; + $taskID = $taskID['id']; $this->action->create('task', $taskID, 'Opened', ''); } @@ -173,8 +173,10 @@ class task extends control { if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->kanban->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); } @@ -347,8 +349,10 @@ class task extends control { if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, 0)")); } @@ -397,7 +401,7 @@ class task extends control $this->loadModel('kanban'); $regionPairs = $this->kanban->getRegionPairs($executionID, 0, 'execution'); - $regionID = isset($output['regionID']) ? $output['regionID'] : key($regionPairs); + $regionID = !empty($output['regionID']) ? $output['regionID'] : key($regionPairs); $lanePairs = $this->kanban->getLanePairsByRegion($regionID, 'task'); $laneID = isset($output['laneID']) ? $output['laneID'] : key($lanePairs); @@ -503,9 +507,9 @@ class task extends control if(isonlybody()) { $execution = $this->execution->getByID($task->execution); - if($execution->type == 'kanban' and $this->app->tab == 'execution' and $kanbanGroup == 'default') + if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -738,9 +742,9 @@ class task extends control { $task = $this->task->getById($taskID); $execution = $this->execution->getByID($task->execution); - if($execution->type == 'kanban' and $this->app->tab == 'execution' and $kanbanGroup == 'default') + if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', 0, $kanbanGroup); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -988,9 +992,11 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } @@ -1050,8 +1056,10 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } @@ -1184,9 +1192,11 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } @@ -1272,9 +1282,11 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } @@ -1328,8 +1340,10 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } @@ -1399,9 +1413,11 @@ class task extends control if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } @@ -1562,9 +1578,11 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } @@ -1618,9 +1636,11 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); - $kanbanData = json_encode($kanbanData); + $regionID = !empty($output['regionID']) ? $output['regionID'] : 0; + $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; + $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', $regionID, $execGroupBy); + $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } From b9a37d04a2302e0e30a7f80af1cd75ed10b2d633 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 1 Jun 2022 11:08:51 +0800 Subject: [PATCH 12/24] * Finish task #55675. --- module/execution/control.php | 6 +++--- module/kanban/model.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 2c228fe1ba..eb95a9f98a 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2199,16 +2199,16 @@ class execution extends control * @access public * @return void */ - public function taskKanban($executionID, $browseType = '', $orderBy = 'order_asc', $groupBy = '') + public function taskKanban($executionID, $browseType = 'all', $orderBy = 'order_asc', $groupBy = '') { - if(empty($browseType)) $browseType = $this->session->kanbanType ? $this->session->kanbanType : 'all'; if(empty($groupBy)) $groupBy = 'default'; /* Save to session. */ $uri = $this->app->getURI(true); $this->app->session->set('taskList', $uri, 'execution'); $this->app->session->set('bugList', $uri, 'qa'); - $this->app->session->set('kanbanType', $browseType, 'execution'); + $this->app->session->set('execLaneType', $browseType); + $this->app->session->set('execGroupBy', $groupBy); /* Load language. */ $this->app->loadLang('task'); diff --git a/module/kanban/model.php b/module/kanban/model.php index 05a625e814..afff540da2 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1454,14 +1454,18 @@ class kanbanModel extends model $lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList); if(empty($lanes)) return array(); + $execution = $this->loadModel('execution')->getByID($executionID); + $columns = $this->dao->select('t1.*, GROUP_CONCAT(t1.cards) as cards, t2.`type` as columnType, t2.limit, t2.name as columnName, t2.color')->from(TABLE_KANBANCELL)->alias('t1') ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.`column` = t2.id') ->leftJoin(TABLE_KANBANLANE)->alias('t3')->on('t1.lane = t3.id') ->leftJoin(TABLE_KANBANREGION)->alias('t4')->on('t1.kanban = t4.kanban') ->where('t1.kanban')->eq($executionID) ->andWhere('t1.`type`')->eq($browseType) + ->beginIF(isset($execution->type) and $execution->type == 'kanban') ->andWhere('t3.deleted')->eq(0) ->andWhere('t4.deleted')->eq(0) + ->fi() ->groupBy('columnType') ->orderBy('column_asc') ->fetchAll('columnType'); From 5d62ed59009ab0e83b4d00af8f93c37b9d303afd Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 1 Jun 2022 13:06:26 +0800 Subject: [PATCH 13/24] * Finish task #55675. --- module/execution/js/kanban.js | 16 ++++++++++------ module/execution/view/kanban.html.php | 7 ++++--- module/kanban/model.php | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 95fee6f6f1..ae5b282606 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -370,19 +370,22 @@ function findDropColumns($element, $root) if(!kanbanRules) return $root.find('.kanban-lane-col:not([data-type="' + col.type + '"])'); - var colRules = kanbanRules[col.type]; - var groupID = $col.closest('.kanban-board').data().id; + var colRules = kanbanRules[col.type]; + var groupID = $col.closest('.kanban-board').data().id; + var oldLaneID = $col.closest('.kanban-lane').data().id; return $root.find('.kanban-lane-col').filter(function() { if(!colRules) return false; if(colRules === true) return true; if($.cookie('isFullScreen') == 1) return false; - var $newCol = $(this); - var newCol = $newCol.data(); - var newGroupID = $newCol.closest('.kanban-board').data().id; + var $newCol = $(this); + var newCol = $newCol.data(); + var newGroupID = $newCol.closest('.kanban-board').data().id; + var newLaneID = $newCol.closest('.kanban-lane').data().id; var canDropHere = colRules.indexOf(newCol.type) > -1 && newGroupID === groupID; + if(groupBy && groupBy != 'default' && canDropHere) canDropHere = oldLaneID === newLaneID; if(canDropHere) $newCol.addClass('can-drop-here'); return canDropHere; }); @@ -1034,7 +1037,8 @@ function deleteCard(objectType, objectID, regionID) url: url, success: function(data) { - data = groupBy == 'default' ? data[regionID] : data[groupBy]; + data = groupBy == 'default' ? data[regionID] : data[groupBy]; + regionID = groupBy == 'default' ? regionID : executionID; updateRegion(regionID, data); } }); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index dc1becccfa..81d1ddb848 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -138,15 +138,16 @@ js::set('hasTaskButton', $hasTaskButton);
" . $lang->kanban->fullScreen, '', "class='btn btn-link'"); - $actions = ''; - $printSettingBtn = (common::hasPriv('kanban', 'createRegion') or (common::hasPriv('kanban', 'setLaneHeight')) or (common::hasPriv('kanban', 'setColumnWidth')) or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); + $actions = ''; + $printCreateRegion = (common::hasPriv('kanban', 'createRegion') and $groupBy == 'default'); + $printSettingBtn = ($printCreateRegion or (common::hasPriv('kanban', 'setLaneHeight')) or (common::hasPriv('kanban', 'setColumnWidth')) or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); if($printSettingBtn) { $actions .= html::a('javascript:;', "" . $lang->kanban->setting, '', "data-toggle='dropdown' class='btn btn-link'"); $actions .= "
'>
+
+ +

@@ -172,25 +175,44 @@

-
- -
- + moduleName . ucfirst($this->methodName); + $useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable'); + $vars = "executionID={$execution->id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; + + if($useDatatable) include '../../common/view/datatable.html.php'; + $setting = $this->datatable->getSetting('execution'); + $widths = $this->datatable->setFixedFieldWidth($setting); + $columns = 0; + + $checkObject = new stdclass(); + $checkObject->execution = $execution->id; + + $totalEstimate = 0; + $canBatchEdit = common::hasPriv('story', 'batchEdit'); + $canBatchClose = common::hasPriv('story', 'batchClose'); + $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); + $canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); + $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject); + $canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); + ?> + ';?> +
' id='storyList' data-fixed-left-width='' data-fixed-right-width=''> execution = $execution->id; - - $totalEstimate = 0; - $canBatchEdit = common::hasPriv('story', 'batchEdit'); - $canBatchClose = common::hasPriv('story', 'batchClose'); - $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); - $canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); - $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject); - $canBatchAction = ($canBeChanged and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); + foreach($setting as $key => $value) + { + if($value->show) + { + $this->datatable->printHead($value, $orderBy, $vars, $canBatchAction); + $columns ++; + } + } ?> - id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> + + $story):?> @@ -223,6 +246,12 @@ $totalEstimate += $story->estimate; ?> + $value) + { + $this->story->printCell($value, $story, $users, '', $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', '', $execution, $showBranch, $productID); + } + ?> +
+ ';?>