From 795d691e8d046de9fc8ff65ee3090e126204461e Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 20 Jan 2022 15:00:16 +0800 Subject: [PATCH 01/31] * Fix bug#18792. --- module/task/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/control.php b/module/task/control.php index 45dc885341..c8fecaf9dd 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -235,7 +235,7 @@ class task extends control $this->view->position = $position; $this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('execution', 'task', "executionID=$executionID") : ''; $this->view->execution = $execution; - $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'all', 0, true); + $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'undone', 0, true); $this->view->task = $task; $this->view->users = $users; $this->view->storyID = $storyID; From 25ee419afc307c43dc6bb2c0f3b9348598fe7a9e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 20 Jan 2022 15:31:10 +0800 Subject: [PATCH 02/31] * Implement the partial refresh function of the task card. --- module/execution/control.php | 1 + module/execution/js/kanban.js | 12 +- module/task/control.php | 215 +++++++++++++++++++++++++++++--- module/task/view/start.html.php | 2 +- 4 files changed, 206 insertions(+), 24 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 5f19561985..5f5cfa6b66 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1969,6 +1969,7 @@ class execution extends control $this->app->loadLang('bug'); $this->app->loadLang('story'); if(empty($groupBy)) $groupBy = 'default'; + $this->session->set('execLaneType', $browseType); $this->lang->execution->menu = new stdclass(); $execution = $this->commonAction($executionID); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 3be5ff584c..80123e4e93 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -788,7 +788,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'developing' && priv.canPauseTask) { - var link = createLink('task', 'pause', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('task', 'pause', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -796,12 +796,12 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if((fromColType == 'pause' || fromColType == 'canceled' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask) { - var link = createLink('task', 'activate', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('task', 'activate', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } if(fromColType == 'wait' && priv.canStartTask) { - var link = createLink('task', 'start', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('task', 'start', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -809,7 +809,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if((fromColType == 'developing' || fromColType == 'wait' || fromColType == 'pause') && priv.canCancelTask) { - var link = createLink('task', 'cancel', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('task', 'cancel', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -817,7 +817,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if((fromColType == 'developed' || fromColType == 'canceled') && priv.canCloseTask) { - var link = createLink('task', 'close', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('task', 'close', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -911,7 +911,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car * @access public * @return void */ -function updateKanban(kanbanData, regionID) +function updateKanban(kanbanData, regionID = 0) { setTimeout(function() { diff --git a/module/task/control.php b/module/task/control.php index 45dc885341..26d81763cd 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -146,7 +146,20 @@ class task extends control if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $taskID)); /* If link from no head then reload. */ - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + if(isonlybody()) + { + if($execution->type == 'kanban') + { + $kanbanData = $this->kanban->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); + } + else + { + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + } /* Locate the browser. */ if($this->app->getViewType() == 'xhtml') @@ -309,7 +322,20 @@ class task extends control if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $taskIDList)); /* If link from no head then reload. */ - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + if(isonlybody()) + { + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); + } + else + { + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + } return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink)); } @@ -424,7 +450,22 @@ class task extends control } } - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent.parent')); + } + } + if(defined('RUN_MODE') && RUN_MODE == 'api') { return $this->send(array('status' => 'success', 'data' => $taskID)); @@ -622,7 +663,22 @@ class task extends control $this->executeHooks($taskID); if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success')); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } @@ -809,6 +865,9 @@ class task extends control { $this->commonAction($taskID); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + $task = $this->task->getById($taskID); if(!empty($_POST)) @@ -848,7 +907,23 @@ class task extends control } if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'success')); - if(isonlybody()) die(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + + if(isonlybody()) + { + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + } + } die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } @@ -895,8 +970,22 @@ class task extends control } } - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->session->set('estimateList', $this->app->getURI(true), 'execution'); @@ -1019,8 +1108,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban') { - $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, 'all', 'id_desc', $regionID); + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc'); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); @@ -1083,6 +1171,9 @@ class task extends control { $this->commonAction($taskID); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(!empty($_POST)) { $this->loadModel('action'); @@ -1097,8 +1188,25 @@ class task extends control $this->executeHooks($taskID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->pause; @@ -1136,8 +1244,23 @@ class task extends control $this->executeHooks($taskID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->task->restart; @@ -1161,6 +1284,9 @@ class task extends control { $this->commonAction($taskID); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(!empty($_POST)) { $this->loadModel('action'); @@ -1176,7 +1302,24 @@ class task extends control $this->executeHooks($taskID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + return print(js::closeModal('parent.parent', 'this', "function(){parent.parent.location.reload();}")); + } + } + if(defined('RUN_MODE') && RUN_MODE == 'api') { return $this->send(array('status' => 'success', 'data' => $taskID)); @@ -1293,6 +1436,9 @@ class task extends control { $this->commonAction($taskID); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(!empty($_POST)) { $this->loadModel('action'); @@ -1307,7 +1453,23 @@ class task extends control $this->executeHooks($taskID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } @@ -1330,6 +1492,9 @@ class task extends control { $this->commonAction($taskID); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(!empty($_POST)) { $this->loadModel('action'); @@ -1344,8 +1509,24 @@ class task extends control $this->executeHooks($taskID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + if(isonlybody()) + { + $task = $this->task->getById($taskID); + $execution = $this->execution->getByID($task->execution); + if($execution->type == 'kanban') + { + $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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } if(!empty($this->view->task->team)) diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index 7067c50679..741c5e4bb2 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -37,7 +37,7 @@ -
+ rawMethod == 'start') echo "onsubmit='return checkLeft();'"?>> From bd99d3def9695318458a368d8c710acac0b5c92e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 20 Jan 2022 17:35:49 +0800 Subject: [PATCH 03/31] * Realize the partial refresh function of the story card. --- module/execution/control.php | 22 +++++-- module/story/control.php | 120 ++++++++++++++++++++++++++++++----- module/story/model.php | 7 +- module/testcase/control.php | 15 ++++- 4 files changed, 140 insertions(+), 24 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 5f5cfa6b66..bf3528b314 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2659,7 +2659,7 @@ class execution extends control if(empty($products)) { echo js::alert($this->lang->execution->errorNoLinkedProducts); - die(js::locate($this->createLink('execution', 'manageproducts', "executionID=$objectID"))); + return print(js::locate($this->createLink('execution', 'manageproducts', "executionID=$objectID"))); } if(!empty($_POST)) @@ -2667,8 +2667,22 @@ class execution extends control $this->execution->linkStory($objectID, array(), array(), $extra); if($object->type != 'project' and $object->project != 0) $this->execution->linkStory($object->project); - if(isonlybody()) die(js::reload('parent')); - die(js::locate($browseLink)); + if(isonlybody()) + { + 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); + + return print(js::closeModal('parent', '', "parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent')); + } + } + + return print(js::locate($browseLink)); } if($object->type == 'project') @@ -3442,7 +3456,7 @@ class execution extends control 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, $execution->type == 'sprint' ? 'story' : 'kanban', $param)); - die(js::locate(helper::createLink($moduleName, $fromMethod, $param))); + return print(js::locate(helper::createLink($moduleName, $fromMethod, $param))); } /** diff --git a/module/story/control.php b/module/story/control.php index 04d12eb0f6..4823d8cb2c 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -157,7 +157,21 @@ class story extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $storyID)); /* If link from no head then reload. */ - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); + } + else + { + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + } if($this->post->newStory) { @@ -398,13 +412,13 @@ class story extends control if($storyID) { $story = $this->story->getById($storyID); - if($story->status != 'active' or $story->stage != 'wait' or $story->parent > 0) die(js::alert($this->lang->story->errorNotSubdivide) . js::locate('back')); + if($story->status != 'active' or $story->stage != 'wait' or $story->parent > 0) return print(js::alert($this->lang->story->errorNotSubdivide) . js::locate('back')); } if(!empty($_POST)) { $mails = $this->story->batchCreate($productID, $branch, $type); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); $stories = array(); foreach($mails as $mail) $stories[] = $mail->storyID; @@ -426,11 +440,25 @@ class story extends control } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $stories)); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } if($storyID) { - die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); + return print(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } elseif($executionID) { @@ -438,13 +466,13 @@ class story extends control $moduleName = $execution->type == 'project' ? 'projectstory' : 'execution'; $param = $execution->type == 'project' ? "projectID=$executionID&productID=$productID" : "executionID=$executionID&orderBy=id_desc&browseType=unclosed"; $link = $this->createLink($moduleName, 'story', $param); - die(js::locate($link, 'parent')); + return print(js::locate($link, 'parent')); } else { setcookie('storyModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $locateLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID=$productID&branch=$branch&browseType=unclosed&queryID=0&type=$type"); - die(js::locate($locateLink, 'parent')); + return print(js::locate($locateLink, 'parent')); } } @@ -921,9 +949,24 @@ class story extends control $module = $this->app->tab == 'project' ? 'projectstory' : 'story'; - if(isonlybody()) die(js::reload('parent.parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent.parent')); + } + } + if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); - die(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent')); + return print(js::locate($this->createLink($module, 'view', "storyID=$storyID"), 'parent')); } $this->commonAction($storyID); @@ -974,8 +1017,22 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + return print(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); } $this->commonAction($storyID); @@ -1243,7 +1300,7 @@ class story extends control if(!empty($_POST)) { $changes = $this->story->close($storyID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) return print(js::error(dao::getError())); if($changes) { @@ -1253,14 +1310,29 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } + if(defined('RUN_MODE') && RUN_MODE == 'api') { - die(array('status' => 'success', 'data' => $storyID)); + return print(array('status' => 'success', 'data' => $storyID)); } else { - die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); + return print(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } } @@ -1586,8 +1658,22 @@ class story extends control $this->executeHooks($storyID); - if(isonlybody()) die(js::closeModal('parent.parent', 'this', 'function(){parent.parent.$(\'[data-ride="searchList"]\').searchList();}')); - die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->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); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent', 'this', 'function(){parent.parent.$(\'[data-ride="searchList"]\').searchList();}')); + } + } + return print(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent')); } /* Get story and product. */ diff --git a/module/story/model.php b/module/story/model.php index 388842e6a6..6d4c9572aa 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2142,6 +2142,12 @@ class storyModel extends model $releases = $this->dao->select('*')->from(TABLE_RELEASE)->where("CONCAT(',', stories, ',')")->like("%,$storyID,%")->andWhere('deleted')->eq(0)->fetchPairs('branch', 'branch'); foreach($releases as $branch) $stages[$branch] = 'released'; + $currentStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch(); + foreach($executions as $executionID => $branch) + { + $this->kanban->updateLane($executionID, 'story', $storyID); + } + if(empty($stages)) return; if($hasBranch) { @@ -2173,7 +2179,6 @@ class storyModel extends model $this->dao->update(TABLE_STORY)->set('stage')->eq(current($stages))->where('id')->eq($storyID)->exec(); } - $currentStory = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch(); if($story->stage != $currentStory->stage) { foreach($executions as $executionID => $branch) diff --git a/module/testcase/control.php b/module/testcase/control.php index 826589dd02..d92d09151c 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -517,8 +517,19 @@ class testcase extends control if(!empty($_POST)) { $caseIDList = $this->testcase->batchCreate($productID, $branch, $storyID); - if(dao::isError()) die(js::error(dao::getError())); - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + if(dao::isError()) return print(js::error(dao::getError())); + if(isonlybody()) + { + $execution = $this->execution->getByID($this->session->execution); + if($this->app->tab == 'execution' and $execution->type == 'kanban') + { + return print(js::closeModal('parent.parent', '')); + } + else + { + return print(js::closeModal('parent.parent', 'this')); + } + } if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $caseIDList)); From 7b0694844cd92b8973a3fedb693f7a825ae6fd53 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 21 Jan 2022 08:32:21 +0800 Subject: [PATCH 04/31] * Finish task #47998. --- db/update16.2.sql | 3 ++- module/group/lang/resource.php | 2 ++ module/kanban/control.php | 20 ++++++++++++++++ module/kanban/js/view.js | 44 ++++++++++++++++++++++++++++++++-- module/kanban/lang/en.php | 2 ++ module/kanban/lang/zh-cn.php | 2 ++ module/kanban/model.php | 2 +- 7 files changed, 71 insertions(+), 4 deletions(-) diff --git a/db/update16.2.sql b/db/update16.2.sql index 75c4536ef7..c6ffc46d79 100644 --- a/db/update16.2.sql +++ b/db/update16.2.sql @@ -1,6 +1,7 @@ ALTER TABLE `zt_kanbanspace` ADD `type` varchar(50) NOT NULL AFTER `name`; UPDATE `zt_kanbanspace` SET `type` = 'cooperation'; ALTER TABLE `zt_kanban` ADD `performable` enum ('0', '1') NOT NULL DEFAULT '0' AFTER `archived`; +ALTER TABLE `zt_kanbancard` ADD `status` enum ('doing', 'done') NOT NULL DEFAULT 'doing' AFTER `name`; ALTER TABLE `zt_job` ADD `sonarqubeServer` mediumint(8) unsigned NOT NULL AFTER `triggerType`; -ALTER TABLE `zt_job` ADD `projectKey` varchar(255) NOT NULL AFTER `sonarqubeServer`; \ No newline at end of file +ALTER TABLE `zt_job` ADD `projectKey` varchar(255) NOT NULL AFTER `sonarqubeServer`; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 0a0706d26a..dabeb585e3 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -644,6 +644,7 @@ $lang->resource->kanban->close = 'close'; $lang->resource->kanban->delete = 'delete'; $lang->resource->kanban->createRegion = 'createRegion'; $lang->resource->kanban->editRegion = 'editRegion'; +$lang->resource->kanban->setDoneFunction = 'setDoneFunction'; $lang->resource->kanban->sortRegion = 'sortRegion'; $lang->resource->kanban->sortGroup = 'sortGroup'; $lang->resource->kanban->deleteRegion = 'deleteRegion'; @@ -668,6 +669,7 @@ $lang->resource->kanban->assigntoCard = 'assigntoCard'; //$lang->resource->kanban->copyCard = 'copyCard'; $lang->resource->kanban->deleteCard = 'deleteCard'; $lang->resource->kanban->moveCard = 'moveCard'; +$lang->resource->kanban->editCardStatus = 'editCardStatus'; $lang->resource->kanban->setCardColor = 'setCardColor'; $lang->resource->kanban->laneMove = 'laneMove'; $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn'; diff --git a/module/kanban/control.php b/module/kanban/control.php index 0e2ce2cccd..b30c9c46ea 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -732,6 +732,26 @@ class kanban extends control $this->display(); } + /** + * Update card status. + * + * @param int $cardID + * @param int $kanbanID + * @access public + * @return void + */ + public function editCardStatus($cardID, $kanbanID) + { + $card = $this->kanban->getCardByID($cardID); + $card->status = $card->status == 'doing' ? 'done' : 'doing'; + + $this->dao->update(TABLE_KANBANCARD)->set('status')->eq($card->status)->where('id')->eq($cardID)->exec(); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $kanbanGroup = $this->kanban->getKanbanData($kanbanID); + return print(json_encode($kanbanGroup)); + } + /** * View a card. * diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 246d4696c6..6254102e2c 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -257,7 +257,7 @@ function renderKanbanItem(item, $item) { var $title = $item.children('.title'); var privs = item.actions; - var printMoreBtn = (privs.includes('editCard') || privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); + var printMoreBtn = (privs.includes('editCard') || privs.includes('editCardStatus') ||privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); if(privs.includes('sortCard')) $item.parent().addClass('sort'); if(!$title.length) @@ -437,7 +437,6 @@ function setCardColor(cardID, color, kanbanID, regionID) url: url, success: function(data) { - regions = data; updateRegion(regionID, data[regionID]); }, error: function(xhr, status, error) @@ -447,6 +446,30 @@ function setCardColor(cardID, color, kanbanID, regionID) }); } +/** + * Update card status. + * + * @param int $cardID + * @param int $kanbanID + * @access public + * @return void + */ +function editCardStatus(cardID, kanbanID, regionID) +{ + if(!cardID) return false; + var url = createLink('kanban', 'editCardStatus', 'cardID=' + cardID + '&kanbanID=' + kanbanID); + return $.ajax( + { + method: 'post', + dataType: 'json', + url: url, + success: function(data) + { + updateRegion(regionID, data[regionID]); + } + }); +} + /** * Update a region. * @@ -699,6 +722,23 @@ function createCardMenu(options) var items = []; if(privs.includes('editCard')) items.push({label: kanbanLang.editCard, icon: 'edit', url: createLink('kanban', 'editCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(privs.includes('editCardStatus') && kanban.performable == 1) + { + var statusLang = ''; + var statusIcon = ''; + if(card.status == 'doing') + { + statusLang = kanbanLang.finishCard; + statusIcon = 'checked'; + } + else + { + statusLang = kanbanLang.activeCard; + statusIcon = 'magic'; + } + + items.push({label: statusLang, icon: statusIcon, onClick: function(){editCardStatus(card.id, card.kanban, card.region);}}); + } if(privs.includes('archiveCard') && kanban.archived == '1') items.push({label: kanbanLang.archiveCard, icon: 'card-archive', url: createLink('kanban', 'archiveCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('copyCard')) items.push({label: kanbanLang.copyCard, icon: 'copy', url: createLink('kanban', 'copyCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}}); if(privs.includes('deleteCard')) items.push({label: kanbanLang.deleteCard, icon: 'trash', url: createLink('kanban', 'deleteCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}}); diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 8570d1359f..2cc8d684f4 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -27,6 +27,8 @@ $lang->kanban->sortColumn = 'Sort Column'; $lang->kanban->deleteColumn = 'Delete Column'; $lang->kanban->createCard = 'Create Card'; $lang->kanban->editCard = 'Edit Card'; +$lang->kanban->finishCard = 'Finish Card'; +$lang->kanban->activeCard = 'Active Card'; $lang->kanban->viewCard = 'View Card'; $lang->kanban->archiveCard = 'Archive Card'; $lang->kanban->sortCard = 'Sort Card'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 048e6a91fb..88abfbd07a 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -27,6 +27,8 @@ $lang->kanban->sortColumn = '看板列排序'; $lang->kanban->deleteColumn = '删除看板列'; $lang->kanban->createCard = '创建卡片'; $lang->kanban->editCard = '编辑卡片'; +$lang->kanban->finishCard = '完成卡片'; +$lang->kanban->activeCard = '激活卡片'; $lang->kanban->viewCard = '查看卡片'; $lang->kanban->archiveCard = '归档卡片'; $lang->kanban->sortCard = '卡片排序'; diff --git a/module/kanban/model.php b/module/kanban/model.php index b24674dfb9..b653ea8bd7 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -872,7 +872,7 @@ class kanbanModel extends model ->andWhere('type')->eq('common') ->fetchAll(); - $actions = array('editCard', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); + $actions = array('editCard', 'editCardStatus', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); $cardGroup = array(); foreach($cellList as $cell) { From 04f89dd9bab6f4960ae392655d74c4f162c6993b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 21 Jan 2022 08:44:11 +0800 Subject: [PATCH 05/31] * Fix bug for edit kanban. --- module/kanban/control.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index 17bd52d4e3..e23c360571 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -168,7 +168,7 @@ class kanban extends control unset($this->lang->kanbanspace->featureBar['involved']); $space = $this->kanban->getSpaceById($spaceID); - $spaceUsers = $space->owner . $space->team . $space->whitelist; + $spaceUsers = trim($space->owner) . ',' . trim($space->team). ',' . trim($space->whitelist); $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); $this->view->users = $users; @@ -202,10 +202,12 @@ class kanban extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } - $kanban = $this->kanban->getByID($kanbanID); - $space = $this->kanban->getSpaceById($kanban->space); + $kanban = $this->kanban->getByID($kanbanID); + $space = $this->kanban->getSpaceById($kanban->space); + $spaceUsers = trim($space->owner) . ',' . trim($space->team). ',' . trim($space->whitelist); + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); - $this->view->users = $this->loadModel('user')->getPairs('noclosed'); + $this->view->users = $users; $this->view->spacePairs = array(0 => '') + $this->kanban->getSpacePairs($space->type); $this->view->kanban = $kanban; $this->view->type = $space->type; From d980d5132d87c1de9deec98c7561fa42093de568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=A2=A6=E8=89=BA?= Date: Fri, 21 Jan 2022 00:46:28 +0000 Subject: [PATCH 06/31] Update control.php --- module/kanban/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index e23c360571..04de5ea5f5 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -168,7 +168,7 @@ class kanban extends control unset($this->lang->kanbanspace->featureBar['involved']); $space = $this->kanban->getSpaceById($spaceID); - $spaceUsers = trim($space->owner) . ',' . trim($space->team). ',' . trim($space->whitelist); + $spaceUsers = trim($space->owner) . ',' . trim($space->team) . ',' . trim($space->whitelist); $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); $this->view->users = $users; @@ -204,7 +204,7 @@ class kanban extends control $kanban = $this->kanban->getByID($kanbanID); $space = $this->kanban->getSpaceById($kanban->space); - $spaceUsers = trim($space->owner) . ',' . trim($space->team). ',' . trim($space->whitelist); + $spaceUsers = trim($space->owner) . ',' . trim($space->team) . ',' . trim($space->whitelist); $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); $this->view->users = $users; From c3ca6cf37047e1e889618eba2a3c44d4828e5939 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 21 Jan 2022 08:48:59 +0800 Subject: [PATCH 07/31] * Remove useless code. --- module/task/control.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 26d81763cd..3a530bb1f3 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1108,10 +1108,10 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); } else { From d38bb533b95d896ce8389ab23b68075ece6ec136 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 21 Jan 2022 09:02:16 +0800 Subject: [PATCH 08/31] * Restore code. --- module/task/control.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 3a530bb1f3..cf4cf8a9f3 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1108,10 +1108,12 @@ class task extends control $execution = $this->execution->getByID($task->execution); if($execution->type == 'kanban') { - $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, 'all', 'id_desc', $regionID); + $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } else { From d19df00d0b9f735c2ddd70ab9af391f7ae267da7 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Fri, 21 Jan 2022 09:07:28 +0800 Subject: [PATCH 09/31] *Finish task #47958. --- module/project/lang/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/lang/en.php b/module/project/lang/en.php index bfc4d4f1f1..7678fff0d4 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -187,7 +187,7 @@ $lang->project->tenThousand = ''; $lang->project->unitList['CNY'] = 'RMB'; $lang->project->unitList['USD'] = 'USD'; $lang->project->unitList['HKD'] = 'HKD'; -$lang->project->unitList['NTD'] = 'NTW'; +$lang->project->unitList['NTD'] = 'NTD'; $lang->project->unitList['EUR'] = 'EUR'; $lang->project->unitList['DEM'] = 'DEM'; $lang->project->unitList['CHF'] = 'CHF'; From 1993f8ec278a0c081241217e8a0338e313c36160 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 21 Jan 2022 09:08:45 +0800 Subject: [PATCH 10/31] *Report lang. --- module/testreport/lang/de.php | 2 +- module/testreport/lang/en.php | 2 +- module/testreport/lang/fr.php | 2 +- module/testreport/lang/vi.php | 2 +- module/testtask/lang/de.php | 2 +- module/testtask/lang/en.php | 2 +- module/testtask/lang/fr.php | 2 +- module/testtask/lang/vi.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/testreport/lang/de.php b/module/testreport/lang/de.php index 54686b680b..d61b8ba0c0 100644 --- a/module/testreport/lang/de.php +++ b/module/testreport/lang/de.php @@ -58,7 +58,7 @@ $lang->testreport->bugOpenedByGroups = 'Nach Ersteller'; $lang->testreport->bugResolvedByGroups = 'Nach Löser'; $lang->testreport->bugResolutionGroups = 'Nach Lösung'; $lang->testreport->bugModuleGroups = 'Nach Modul'; -$lang->testreport->bugStageGroups = 'Bug Priority distribution'; +$lang->testreport->bugStageGroups = 'Bug Priority Distribution'; $lang->testreport->bugHandleGroups = 'Distribution of daily bug processing'; $lang->testreport->legacyBugs = 'Legacy Bugs'; $lang->testreport->bugConfirmedRate = 'Bestätigte Bugs Rate (Lösung ist gelöst oder verschoben / Status ist gelöst oder Geschlossen)'; diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php index 0b1ad805f7..7919e6550f 100644 --- a/module/testreport/lang/en.php +++ b/module/testreport/lang/en.php @@ -59,7 +59,7 @@ $lang->testreport->bugOpenedByGroups = 'Bug ReportedBy Distribution'; $lang->testreport->bugResolvedByGroups = 'Bug ResolvedBy Distribution'; $lang->testreport->bugResolutionGroups = 'Bug Resolution Distribution'; $lang->testreport->bugModuleGroups = 'Bug Module Distribution'; -$lang->testreport->bugStageGroups = 'Bug Priority distribution'; +$lang->testreport->bugStageGroups = 'Bug Priority Distribution'; $lang->testreport->bugHandleGroups = 'Distribution of daily bug processing'; $lang->testreport->legacyBugs = 'Left Bugs'; $lang->testreport->bugConfirmedRate = 'Confirmed-Bug Rate (Resolution is fixed or postponed / status is resolved or closed)'; diff --git a/module/testreport/lang/fr.php b/module/testreport/lang/fr.php index 6fa0074fe7..c3c5c00b48 100644 --- a/module/testreport/lang/fr.php +++ b/module/testreport/lang/fr.php @@ -58,7 +58,7 @@ $lang->testreport->bugOpenedByGroups = 'Distribution Bug Signalé par'; $lang->testreport->bugResolvedByGroups = 'Distribution Bug Résolu par'; $lang->testreport->bugResolutionGroups = 'Distribution Bug Résolution'; $lang->testreport->bugModuleGroups = 'Distribution Bug Module'; -$lang->testreport->bugStageGroups = 'Bug Priority distribution'; +$lang->testreport->bugStageGroups = 'Bug Priority Distribution'; $lang->testreport->bugHandleGroups = 'Distribution of daily bug processing'; $lang->testreport->legacyBugs = 'Bugs Restants'; $lang->testreport->bugConfirmedRate = 'Taux de Bugs confirmés (Résolution est corrigée ou reportée / statut est résolu ou fermé)'; diff --git a/module/testreport/lang/vi.php b/module/testreport/lang/vi.php index d047eb4432..d1540b9aca 100644 --- a/module/testreport/lang/vi.php +++ b/module/testreport/lang/vi.php @@ -58,7 +58,7 @@ $lang->testreport->bugOpenedByGroups = 'Phân chia người báo cáo Bug'; $lang->testreport->bugResolvedByGroups = 'Phân chia người giải quyết Bug'; $lang->testreport->bugResolutionGroups = 'Phân chia giải pháp Bug'; $lang->testreport->bugModuleGroups = 'Phân chia Module Bug'; -$lang->testreport->bugStageGroups = 'Bug Priority distribution'; +$lang->testreport->bugStageGroups = 'Bug Priority Distribution'; $lang->testreport->bugHandleGroups = 'Distribution of daily bug processing'; $lang->testreport->legacyBugs = 'Bug còn lại'; $lang->testreport->bugConfirmedRate = 'Đánh giá Bug đã xác nhận (Nghị quyết đã ban hành hoặc tạm hoãn / tình trạng được giải quyết hoặc đóng)'; diff --git a/module/testtask/lang/de.php b/module/testtask/lang/de.php index 23ab812256..8cf6a39b58 100644 --- a/module/testtask/lang/de.php +++ b/module/testtask/lang/de.php @@ -179,7 +179,7 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Bugersteller Bericht' $lang->testtask->report->charts['bugResolvedByGroups'] = 'Gelöst von Bericht'; $lang->testtask->report->charts['bugResolutionGroups'] = 'Lösungsbersicht'; $lang->testtask->report->charts['bugModuleGroups'] = 'Bug Modul Bericht'; -$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority distribution'; +$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority Distribution'; $lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing'; $lang->testtask->report->options = new stdclass(); diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 2051aeaba3..388b51c750 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -189,7 +189,7 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Bug ReportedBy Distri $lang->testtask->report->charts['bugResolvedByGroups'] = 'Bug ResolvedBy Distribution'; $lang->testtask->report->charts['bugResolutionGroups'] = 'Bug Resolution Distribution'; $lang->testtask->report->charts['bugModuleGroups'] = 'Bug Module Distribution'; -$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority distribution'; +$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority Distribution'; $lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing'; $lang->testtask->report->options = new stdclass(); diff --git a/module/testtask/lang/fr.php b/module/testtask/lang/fr.php index c9eabd8ac3..0fce2fdb2b 100644 --- a/module/testtask/lang/fr.php +++ b/module/testtask/lang/fr.php @@ -179,7 +179,7 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Distribution signalem $lang->testtask->report->charts['bugResolvedByGroups'] = 'Distribution Résolus par'; $lang->testtask->report->charts['bugResolutionGroups'] = 'Distribution Résolution'; $lang->testtask->report->charts['bugModuleGroups'] = 'Distribution Bug Module'; -$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority distribution'; +$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority Distribution'; $lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing'; $lang->testtask->report->options = new stdclass(); diff --git a/module/testtask/lang/vi.php b/module/testtask/lang/vi.php index 7daac797f2..1bca2d5054 100644 --- a/module/testtask/lang/vi.php +++ b/module/testtask/lang/vi.php @@ -179,7 +179,7 @@ $lang->testtask->report->charts['bugOpenedByGroups'] = 'Phân chia người b $lang->testtask->report->charts['bugResolvedByGroups'] = 'Phân chia người giải quyết Bug'; $lang->testtask->report->charts['bugResolutionGroups'] = 'Phân chia giải pháp Bug'; $lang->testtask->report->charts['bugModuleGroups'] = 'Phân chia Module Bug'; -$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority distribution'; +$lang->testtask->report->charts['bugStageGroups'] = 'Bug Priority Distribution'; $lang->testtask->report->charts['bugHandleGroups'] = 'Distribution of daily bug processing'; $lang->testtask->report->options = new stdclass(); From 9da1c180f21f32e1ff29a95f6f7a973d89c4435d Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Fri, 21 Jan 2022 09:21:16 +0800 Subject: [PATCH 11/31] *Xuanxuan lang. --- xuanxuan/module/setting/ext/lang/en/xuanxuan.php | 12 ++++++++---- xuanxuan/module/setting/ext/lang/zh-cn/xuanxuan.php | 9 ++++++--- xuanxuan/module/setting/ext/view/xuanxuan.html.php | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/xuanxuan/module/setting/ext/lang/en/xuanxuan.php b/xuanxuan/module/setting/ext/lang/en/xuanxuan.php index 39e4051ab0..b70f36c6c9 100644 --- a/xuanxuan/module/setting/ext/lang/en/xuanxuan.php +++ b/xuanxuan/module/setting/ext/lang/en/xuanxuan.php @@ -1,4 +1,8 @@ -setting->common = 'Settings'; -$lang->setting->xuanxuan = 'Client'; -$lang->setting->downloadXXD = 'Download XXD'; +setting->common = 'Settings'; +$lang->setting->xuanxuan = 'Client'; +$lang->setting->downloadXXD = 'Download XXD'; +$lang->setting->langs['zh-cn'] = 'Simplified Chinese'; +$lang->setting->langs['zh-tw'] = 'Traditional Chinese'; +$lang->setting->langs['en'] = 'English'; + diff --git a/xuanxuan/module/setting/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/module/setting/ext/lang/zh-cn/xuanxuan.php index f6289f4ea4..de73c4ff45 100644 --- a/xuanxuan/module/setting/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/module/setting/ext/lang/zh-cn/xuanxuan.php @@ -1,4 +1,7 @@ setting->common = '设置'; -$lang->setting->xuanxuan = '客户端集成'; -$lang->setting->downloadXXD = '下载喧喧服务端'; +$lang->setting->common = '设置'; +$lang->setting->xuanxuan = '客户端集成'; +$lang->setting->downloadXXD = '下载喧喧服务端'; +$lang->setting->langs['zh-cn'] = '简体'; +$lang->setting->langs['zh-tw'] = '繁體'; +$lang->setting->langs['en'] = 'English'; diff --git a/xuanxuan/module/setting/ext/view/xuanxuan.html.php b/xuanxuan/module/setting/ext/view/xuanxuan.html.php index f70c93174f..35ed76abeb 100644 --- a/xuanxuan/module/setting/ext/view/xuanxuan.html.php +++ b/xuanxuan/module/setting/ext/view/xuanxuan.html.php @@ -44,7 +44,7 @@ - + From ac00d73a20a7f254de17a55df40a126dcdef4374 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 21 Jan 2022 01:23:30 +0000 Subject: [PATCH 12/31] Finish task #47982. --- module/group/lang/resource.php | 2 + module/kanban/config.php | 2 + module/kanban/control.php | 28 +++++++++ module/kanban/js/view.js | 30 +++++++-- module/kanban/lang/en.php | 1 + module/kanban/lang/zh-cn.php | 1 + module/kanban/model.php | 70 ++++++++++++++++++++- module/kanban/view/batchcreatecard.html.php | 68 ++++++++++++++++++++ module/kanban/view/createcard.html.php | 2 +- 9 files changed, 198 insertions(+), 6 deletions(-) create mode 100644 module/kanban/view/batchcreatecard.html.php diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index e72e4e7126..9c6ef73c7d 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -675,6 +675,7 @@ $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn'; $lang->resource->kanban->viewArchivedCard = 'viewArchivedCard'; $lang->resource->kanban->restoreCard = 'restoreCard'; $lang->resource->kanban->setLaneHeight = 'setLaneHeight'; +$lang->resource->kanban->batchCreateCard = 'batchCreateCard'; $lang->kanban->methodOrder[5] = 'space'; $lang->kanban->methodOrder[10] = 'createSpace'; @@ -720,6 +721,7 @@ $lang->kanban->methodorder[200] = 'viewArchivedCard'; $lang->kanban->methodorder[205] = 'archiveColumn'; $lang->kanban->methodorder[210] = 'restoreCard'; $lang->kanban->methodorder[215] = 'setLaneHeight'; +$lang->kanban->methodOrder[220] = 'batchCreateCard'; /* Execution. */ $lang->resource->execution = new stdclass(); diff --git a/module/kanban/config.php b/module/kanban/config.php index 8ce2018009..8c8339cdae 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -102,3 +102,5 @@ $config->kanban->taskColumnStatusList['closed'] = 'closed'; $config->kanban->laneColorList = array('#7ec5ff', '#333', '#2b529c', '#e48600', '#d2323d', '#229f24', '#777', '#d2691e', '#008b8b', '#2e8b57', '#4169e1', '#4b0082', '#fa8072', '#ba55d3', '#6b8e23'); $config->kanban->columnColorList = array('#333', '#2b519c', '#e48610', '#d2313d', '#2a9f23', '#777', '#d2691e', '#2e8b8b', '#2f8b58', '#4168e0', '#4b0082', '#f58072', '#ba55d3', '#6a8e22'); $config->kanban->cardColorList = array('#fff', '#b10b0b', '#cfa227', '#2a5f29'); + +$config->kanban->batchCreate = 10; diff --git a/module/kanban/control.php b/module/kanban/control.php index 89bb9f9c97..78d08fd0df 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -691,6 +691,34 @@ class kanban extends control $this->display(); } + /** + * Batch create cards. + * + * @param int $kanbanID + * @param int $regionID + * @param int $groupID + * @param int $laneID + * @param int $columnID + * @access public + * @return void + */ + public function batchCreateCard($kanbanID = 0, $regionID = 0, $groupID = 0, $laneID = 0, $columnID = 0) + { + $backLink = $this->createLink('kanban', 'view', "kanbanID=$kanbanID"); + + if($_POST) + { + $this->kanban->batchCreateCard($kanbanID, $regionID, $groupID, $columnID); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $backLink)); + } + + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID); + + $this->display(); + } + /** * Edit a card. * diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index f5d6bf9f11..6692495780 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -142,15 +142,14 @@ function renderHeaderCol($column, column, $header, kanbanData) if(!$column.children('.actions').length) $column.append('
'); var $actions = $column.children('.actions'); - if(columnPrivs.includes('createCard') && column.parent != -1) { - var cardUrl = createLink('kanban', 'createCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&laneID=' + laneID + '&columnID=' + columnID); - addItemBtn = ['', '', ''].join(''); + addItemBtn = ['', '', ''].join(''); } var moreAction = ' '; $actions.html(addItemBtn + moreAction); + } } @@ -766,6 +765,28 @@ function createColumnMenu(options) return items; } +/** + * Create create menu for column. + * + * @param object $options + * @access public + * @return object + */ +function createColumnCreateMenu(options) +{ + var col = options.$trigger.closest('.kanban-col').data('col'); + var privs = col.actions; + var items = []; + var regionID = col.region; + var groupID = col.group; + var laneID = col.$kanbanData.lanes[0].id ? col.$kanbanData.lanes[0].id : 0; + var columnID = col.id; + + if(privs.includes('createCard')) items.push({label: kanbanLang.createCard, url: $.createLink('kanban', 'createCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&laneID=' + laneID + '&columnID=' + columnID), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); + if(privs.includes('batchCreateCard')) items.push({label: kanbanLang.batchCreateCard, url: $.createLink('kanban', 'batchCreateCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&laneID=' + laneID + '&columnID=' + columnID), attrs: {'data-width': '80%'}}); + return items; +} + /** Calculate column height */ function calcColHeight(col, lane, colCards, colHeight, kanban) { @@ -785,7 +806,8 @@ window.menuCreators = { card: createCardMenu, lane: createLaneMenu, - column: createColumnMenu + column: createColumnMenu, + columnCreate: createColumnCreateMenu }; /** diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 5f841b2d1c..00b4edad8f 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -55,6 +55,7 @@ $lang->kanban->restoreColumn = 'Restore Column'; $lang->kanban->restoreCard = 'Restore Card'; $lang->kanban->restore = 'Restore'; $lang->kanban->child = 'Child'; +$lang->kanban->batchCreateCard = 'Batchcreate Card'; /* Fields. */ $lang->kanban->space = 'Space'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 49cb9059ed..ffc83297a3 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -55,6 +55,7 @@ $lang->kanban->restoreColumn = '还原看板列'; $lang->kanban->restoreCard = '还原卡片'; $lang->kanban->restore = '还原'; $lang->kanban->child = '子'; +$lang->kanban->batchCreateCard = '批量创建卡片'; /* Fields. */ $lang->kanban->space = '所属空间'; diff --git a/module/kanban/model.php b/module/kanban/model.php index aeee70f5ec..cabb5c866e 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -468,6 +468,74 @@ class kanbanModel extends model return false; } + /** + * Batch create kanban cards. + * + * @param int $kanbanID + * @param int $regionID + * @param int $groupID + * @param int $columnID + * @access public + * @return void + */ + public function batchCreateCard($kanbanID, $regionID, $groupID, $columnID) + { + $cards = fixer::input('post')->get(); + + $now = helper::now(); + $data = array(); + $lanes = array(); + + foreach($cards->name as $i => $name) + { + if(empty($cards->name[$i])) continue; + $data[$i] = new stdclass(); + $data[$i]->name = trim($cards->name[$i]); + $data[$i]->begin = $cards->begin[$i]; + $data[$i]->end = $cards->end[$i]; + $data[$i]->assignedTo = $cards->assignedTo[$i]; + $data[$i]->desc = nl2br($cards->desc[$i]); + $data[$i]->pri = $cards->pri[$i]; + $data[$i]->kanban = $kanbanID; + $data[$i]->region = $regionID; + $data[$i]->group = $groupID; + $data[$i]->createdBy = $this->app->user->account; + $data[$i]->createdDate = $now; + $data[$i]->assignedDate = $now; + $data[$i]->color = '#fff'; + $data[$i]->estimate = is_numeric($cards->estimate[$i]) ? (float)$cards->estimate[$i] : $cards->estimate[$i]; + + $lanes[$i] = $cards->lane[$i]; + } + + foreach($data as $i => $card) + { + $this->dao->insert(TABLE_KANBANCARD)->data($card)->autoCheck() + ->checkIF($card->estimate != '', 'estimate', 'float') + ->batchCheck($this->config->kanban->createcard->requiredFields, 'notempty') + ->exec(); + + if($card->estimate < 0) + { + dao::$errors[] = $this->lang->kanbancard->error->recordMinus; + return false; + } + if($card->end && $card->begin > $card->end) + { + dao::$errors[] = $this->lang->kanbancard->error->endSmall; + return false; + } + + if(!dao::isError()) + { + $cardID = $this->dao->lastInsertID(); + $lane = $lanes[$i]; + $this->addKanbanCell($kanbanID, $lane, $columnID, 'common', $cardID); + $this->loadModel('action')->create('kanbancard', $cardID, 'created'); + } + } + } + /** * Get kanban by id. * @@ -805,7 +873,7 @@ class kanbanModel extends model ->orderBy($order) ->fetchGroup('group'); - $actions = array('createColumn', 'setColumn', 'setWIP', 'archiveColumn', 'restoreColumn', 'deleteColumn', 'createCard', 'splitColumn'); + $actions = array('createColumn', 'setColumn', 'setWIP', 'archiveColumn', 'restoreColumn', 'deleteColumn', 'createCard', 'batchCreateCard', 'splitColumn'); /* Group by parent. */ $parentColumnGroup = array(); diff --git a/module/kanban/view/batchcreatecard.html.php b/module/kanban/view/batchcreatecard.html.php new file mode 100644 index 0000000000..cd0534afae --- /dev/null +++ b/module/kanban/view/batchcreatecard.html.php @@ -0,0 +1,68 @@ + + * @package kanban + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+

+ kanban->batchCreateCard;?> +

+
+ +
+
task->assignedTo;?>
im->backendLang;?>langs, $config->xuanxuan->backendLang, "class='form-control'") : zget($config->langs, $config->xuanxuan->backendLang, '');?>langs, $config->xuanxuan->backendLang, "class='form-control'") : zget($lang->setting->langs, $config->xuanxuan->backendLang, '');?>
+ + + + + + + + + + + + + + kanban->batchCreate; $i++):?> + + + + + + + + + + + + + + + + + + +
idAB;?>kanban->name?>kanbancard->lane;?>kanbancard->assignedTo;?>kanbancard->estimate;?>kanbancard->beginAndEnd;?>kanbancard->desc;?>kanbancard->pri;?>
user->account, "class='form-control chosen'");?> +
+ kanbancard->begin}'");?> + ~ + kanbancard->end}'");?> +
+
kanbancard->priList, $pri, 'class=form-control');?>
+ + +
+ +
+ + diff --git a/module/kanban/view/createcard.html.php b/module/kanban/view/createcard.html.php index 25e52efe3d..2580cd8e5c 100644 --- a/module/kanban/view/createcard.html.php +++ b/module/kanban/view/createcard.html.php @@ -5,7 +5,7 @@ * @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPL (http://zpl.pub/page/zplv12.html) * @author Shujie Tian - * @package kanban + * @package kanban * @version $Id: createcard.html.php 5090 2021-12-13 13:49:24Z tainshujie@cnezsoft.com $ * @link https://www.zentao.net */ From 19be4266e877f5b24daf3cc55791025cce5f3b20 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 21 Jan 2022 01:30:39 +0000 Subject: [PATCH 13/31] Fix lang. --- module/kanban/view/batchcreatecard.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/view/batchcreatecard.html.php b/module/kanban/view/batchcreatecard.html.php index cd0534afae..1db3829291 100644 --- a/module/kanban/view/batchcreatecard.html.php +++ b/module/kanban/view/batchcreatecard.html.php @@ -23,7 +23,7 @@ idAB;?> - kanban->name?> + kanbancard->name?> kanbancard->lane;?> kanbancard->assignedTo;?> kanbancard->estimate;?> From 02c47ead7c30dace84321b090a9bef77bf47f572 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 21 Jan 2022 10:39:54 +0800 Subject: [PATCH 14/31] * Finish task #48012. --- module/bug/control.php | 88 ++++++++++++++++++++++++++--------- module/execution/js/kanban.js | 8 ++-- 2 files changed, 71 insertions(+), 25 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index bb2fc3a067..04a704f28a 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -699,7 +699,7 @@ class bug extends control { $this->loadModel('kanban'); $column = $this->kanban->getColumnByID($output['columnID']); - $kanbanData = $this->kanban->getRDKanban($output['executionID'], 'all', 'id_desc', $column->region); + $kanbanData = $this->kanban->getRDKanban($executionID, 'all', 'id_desc', $column->region); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $column->region)")); @@ -1374,6 +1374,7 @@ class bug extends control */ public function confirmBug($bugID, $extra = '') { + $bug = $this->bug->getById($bugID); if(!empty($_POST)) { $changes = $this->bug->confirm($bugID, $extra); @@ -1385,20 +1386,25 @@ class bug extends control $extra = str_replace(array(',', ' '), array('&', ''), $extra); parse_str($extra, $output); - if(isset($output['fromLaneID']) and isset($output['fromColID']) and isset($output['executionID']) and isonlybody()) + if(isonlybody()) { - $this->loadModel('kanban'); - $column = $this->kanban->getColumnByID($output['fromColID']); - $kanbanData = $this->kanban->getRDKanban($output['executionID'], 'all', 'id_desc', $column->region); - $kanbanData = json_encode($kanbanData); + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') + { + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $column->region)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent')); + } } - if(isonlybody()) return print(js::closeModal('parent.parent')); return print(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } - $bug = $this->bug->getById($bugID); $productID = $bug->product; $this->bug->checkBugExecutionPriv($bug); $this->qa->setMenu($this->products, $productID, $bug->branch); @@ -1441,6 +1447,7 @@ class bug extends control */ public function resolve($bugID, $extra = '') { + $bug = $this->bug->getById($bugID); if(!empty($_POST)) { $changes = $this->bug->resolve($bugID, $extra); @@ -1470,16 +1477,22 @@ class bug extends control $extra = str_replace(array(',', ' '), array('&', ''), $extra); parse_str($extra, $output); - if(isset($output['fromLaneID']) and isset($output['fromColID']) and isset($output['executionID']) and isonlybody()) + if(isonlybody()) { - $this->loadModel('kanban'); - $column = $this->kanban->getColumnByID($output['fromColID']); - $kanbanData = $this->kanban->getRDKanban($output['executionID'], 'all', 'id_desc', $column->region); - $kanbanData = json_encode($kanbanData); + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') + { + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $column->region)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent')); + } } - if(isonlybody()) die(js::reload('parent.parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') { die(array('status' => 'success', 'data' => $bugID)); @@ -1491,7 +1504,6 @@ class bug extends control } $projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : 0; - $bug = $this->bug->getById($bugID); $productID = $bug->product; $users = $this->user->getPairs('noclosed'); $assignedTo = $bug->openedBy; @@ -1547,6 +1559,7 @@ class bug extends control */ public function activate($bugID, $extra = '') { + $bug = $this->bug->getById($bugID); if(!empty($_POST)) { $changes = $this->bug->activate($bugID, $extra); @@ -1559,11 +1572,27 @@ class bug extends control $this->executeHooks($bugID); - if(isonlybody()) die(js::closeModal('parent.parent')); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(isonlybody()) + { + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') + { + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent')); + } + } die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } - $bug = $this->bug->getById($bugID); $productID = $bug->product; $this->bug->checkBugExecutionPriv($bug); $this->qa->setMenu($this->products, $productID, $bug->branch); @@ -1590,6 +1619,7 @@ class bug extends control */ public function close($bugID, $extra = '') { + $bug = $this->bug->getById($bugID); if(!empty($_POST)) { $changes = $this->bug->close($bugID, $extra); @@ -1600,7 +1630,24 @@ class bug extends control $this->executeHooks($bugID); - if(isonlybody()) die(js::closeModal('parent.parent')); + $extra = str_replace(array(',', ' '), array('&', ''), $extra); + parse_str($extra, $output); + if(isonlybody()) + { + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') + { + $regionID = isset($output['regionID']) ? $output['regionID'] : 0; + $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent')); + } + } if(defined('RUN_MODE') && RUN_MODE == 'api') { die(array('status' => 'success', 'data' => $bugID)); @@ -1611,7 +1658,6 @@ class bug extends control } } - $bug = $this->bug->getById($bugID); $productID = $bug->product; $this->bug->checkBugExecutionPriv($bug); $this->qa->setMenu($this->products, $productID, $bug->branch); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 0913cd307b..24ae212486 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -832,7 +832,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'unconfirmed' && priv.canConfirmBug) { - var link = createLink('bug', 'confirmBug', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',executionID=' + executionID, '', true); + var link = createLink('bug', 'confirmBug', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -841,7 +841,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car if(fromColType == 'confirmed' || fromColType == 'unconfirmed') moveCard = true; if((fromColType == 'closed' || fromColType == 'fixed' || fromColType == 'testing' || fromColType == 'tested') && priv.canActivateBug) { - var link = createLink('bug', 'activate', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',executionID=' + executionID, '', true); + var link = createLink('bug', 'activate', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -849,7 +849,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'fixing' || fromColType == 'confirmed' || fromColType == 'unconfirmed') { - var link = createLink('bug', 'resolve', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',executionID=' + executionID, '', true); + var link = createLink('bug', 'resolve', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } @@ -865,7 +865,7 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car { if(fromColType == 'testing' || fromColType == 'tested') { - var link = createLink('bug', 'close', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID, '', true); + var link = createLink('bug', 'close', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true); showIframe = true; } } From 7cb49dd86bd24f9426f7d3097ae8eea2b975981c Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 21 Jan 2022 02:46:05 +0000 Subject: [PATCH 15/31] Fix bug. --- module/kanban/js/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 6692495780..6dc62f3687 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -142,7 +142,7 @@ function renderHeaderCol($column, column, $header, kanbanData) if(!$column.children('.actions').length) $column.append('
'); var $actions = $column.children('.actions'); - if(columnPrivs.includes('createCard') && column.parent != -1) + if(column.parent != -1) { addItemBtn = ['', '', ''].join(''); } From 039437a7413ddcb6f7b91710b13022a44c26c63f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 21 Jan 2022 10:49:54 +0800 Subject: [PATCH 16/31] * Modify bug smooth refresh variable. --- module/bug/control.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 04a704f28a..3c879d0bf1 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1392,7 +1392,7 @@ class bug extends control if($execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -1483,7 +1483,7 @@ class bug extends control if($execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -1580,7 +1580,7 @@ class bug extends control if($execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); @@ -1638,7 +1638,7 @@ class bug extends control if($execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($this->session->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); From d0739e40e37d5b725315663f11c434148b1d71bd Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 21 Jan 2022 12:16:16 +0800 Subject: [PATCH 17/31] * Fix bug for task #47976. --- module/action/lang/en.php | 2 +- module/action/lang/zh-cn.php | 2 +- module/action/model.php | 5 +++++ module/kanban/control.php | 2 +- module/kanban/js/create.js | 5 +++-- module/kanban/model.php | 3 ++- module/kanban/view/create.html.php | 5 +++-- module/kanban/view/createspace.html.php | 2 +- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/module/action/lang/en.php b/module/action/lang/en.php index bde1c19b3d..4c1e7b54e7 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -622,7 +622,7 @@ $lang->action->label->issue = 'Issue|issue|view|issueID=%s'; $lang->action->label->design = 'Design|design|view|designID=%s'; $lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s'; $lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s'; -$lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=all'; +$lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s'; $lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s'; $lang->action->label->kanbancolumn = 'Kanban Column|execution|kanban|execution=%s'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 98679d3045..4442e8c448 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -622,7 +622,7 @@ $lang->action->label->issue = '问题|issue|view|issueID=%s'; $lang->action->label->design = '设计|design|view|designID=%s'; $lang->action->label->stakeholder = '干系人|stakeholder|view|userID=%s'; $lang->action->label->api = '接口|api|index|libID=%s&moduleID=%s&apiID=%s'; -$lang->action->label->kanbanspace = '看板空间|kanban|space|browseType=all'; +$lang->action->label->kanbanspace = '看板空间|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = '看板区域|kanban|view|kanbanID=%s'; $lang->action->label->kanban = '看板|kanban|view|kanbanID=%s'; $lang->action->label->kanbancolumn = '看板列|execution|kanban|execution=%s'; diff --git a/module/action/model.php b/module/action/model.php index 5aaabd6619..594e839a21 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1289,6 +1289,11 @@ class actionModel extends model { $params = sprintf($vars, trim($action->product, ',')); } + elseif($action->objectType == 'kanbanspace') + { + $kanbanSpace = $this->dao->select('type')->from(TABLE_KANBANSPACE)->where('id')->eq($action->objectID)->fetch(); + $params = sprintf($vars, $kanbanSpace->type); + } elseif($action->objectType == 'kanbancolumn' or $action->objectType == 'kanbanlane') { $params = sprintf($vars, $action->extra); diff --git a/module/kanban/control.php b/module/kanban/control.php index 04de5ea5f5..2ad001cfd7 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -168,7 +168,7 @@ class kanban extends control unset($this->lang->kanbanspace->featureBar['involved']); $space = $this->kanban->getSpaceById($spaceID); - $spaceUsers = trim($space->owner) . ',' . trim($space->team) . ',' . trim($space->whitelist); + $spaceUsers = $spaceID == 0 ? ',' : trim($space->owner) . ',' . trim($space->team) . ',' . trim($space->whitelist); $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); $this->view->users = $users; diff --git a/module/kanban/js/create.js b/module/kanban/js/create.js index 97ea9a50ec..d9b1116fbc 100644 --- a/module/kanban/js/create.js +++ b/module/kanban/js/create.js @@ -1,13 +1,14 @@ /** - * When type change. + * When space type or space value change. * * @oaram int spaceID * @param string type * @access public * @return void */ -function changeType(spaceID, type) +function changeValue(spaceID, type = '') { + if(type == '') type = spaceType; location.href = createLink('kanban', 'create', 'spaceID=' + spaceID + '&type=' + type); } diff --git a/module/kanban/model.php b/module/kanban/model.php index 5a45356b04..37b386a1e2 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1448,7 +1448,6 @@ class kanbanModel extends model ->setDefault('createdBy', $account) ->setDefault('createdDate', helper::now()) ->setdefault('team', '') - ->setdefault('owner', $account) ->setdefault('whitelist', '') ->join('whitelist', ',') ->join('team', ',') @@ -1456,6 +1455,8 @@ class kanbanModel extends model ->remove('uid,contactListMenu') ->get(); + if($space->type == 'private') $space->owner = $account; + if(strpos(",{$space->team},", ",$account,") === false and $space->owner != $account) $space->team .= ",$account"; $space = $this->loadModel('file')->processImgURL($space, $this->config->kanban->editor->createspace['id'], $this->post->uid); diff --git a/module/kanban/view/create.html.php b/module/kanban/view/create.html.php index ee0b35ad5f..801a74ab6a 100644 --- a/module/kanban/view/create.html.php +++ b/module/kanban/view/create.html.php @@ -12,6 +12,7 @@ ?> +

kanban->create;?>

@@ -20,12 +21,12 @@ - + - + diff --git a/module/kanban/view/createspace.html.php b/module/kanban/view/createspace.html.php index 20ea198c50..464e2c6319 100644 --- a/module/kanban/view/createspace.html.php +++ b/module/kanban/view/createspace.html.php @@ -20,7 +20,7 @@
kanbanspace->type;?>
kanban->space;?>
- + From fe23db621876f654f0d59866ae2b3f5dbe64d73d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 21 Jan 2022 12:23:38 +0800 Subject: [PATCH 18/31] * Finish task #48012. --- module/bug/control.php | 94 +++++++++++++++++++++++------------ module/execution/js/kanban.js | 2 + module/task/control.php | 2 +- www/js/zui/kanban/min.js | 4 +- 4 files changed, 66 insertions(+), 36 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 3c879d0bf1..51d54e8a23 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -402,17 +402,23 @@ class bug extends control if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $bugID)); /* If link from no head then reload. */ - if(isset($output['laneID']) and isset($output['columnID']) and isset($output['executionID']) and isonlybody()) + if(isset($output['executionID']) and isonlybody()) { - $this->loadModel('kanban'); - $column = $this->kanban->getColumnByID($output['columnID']); - $kanbanData = $this->kanban->getRDKanban($output['executionID'], 'all', 'id_desc', $column->region); - $kanbanData = json_encode($kanbanData); - - return $this->send(array('result' => 'success', 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $column->region)")); + $executionID = $this->post->execution ? $this->post->execution : $output['executionID']; + if($executionID == $output['executionID']) + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + $callback = '"callback" => "parent.updateKanban($kanbanData, 0)"'; + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); + } + else + { + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); + } } - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'data' => $bugID)); if($this->app->tab == 'execution') @@ -694,16 +700,23 @@ class bug extends control $extra = str_replace(array(',', ' '), array('&', ''), $extra); parse_str($extra, $output); - /* If link from no head then reload. */ - if(isset($output['laneID']) and isset($output['columnID']) and isonlybody()) - { - $this->loadModel('kanban'); - $column = $this->kanban->getColumnByID($output['columnID']); - $kanbanData = $this->kanban->getRDKanban($executionID, 'all', 'id_desc', $column->region); - $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $column->region)")); + /* If link from no head then reload. */ + if(isonlybody() and $executionID) + { + $execution = $this->loadModel('execution')->getByID($executionID); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::reload('parent.parent')); + } } + if(isonlybody()) return print(js::reload('parent.parent')); return print(js::locate($this->createLink('bug', 'browse', "productID={$productID}&branch=$branch&browseType=unclosed¶m=0&orderBy=id_desc"), 'parent')); } @@ -1200,7 +1213,22 @@ class bug extends control $this->executeHooks($bugID); - if(isonlybody()) return print(js::closeModal('parent.parent')); + if(isonlybody()) + { + $bug = $this->bug->getById($bugID); + $execution = $this->loadModel('execution')->getByID($bug->execution); + if($execution->type == 'kanban') + { + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); + + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + } + else + { + return print(js::closeModal('parent.parent')); + } + } return print(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } @@ -1389,13 +1417,13 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban') + if(isset($execution->type) and $execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } else { @@ -1480,13 +1508,13 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban') + if(isset($execution->type) and $execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } else { @@ -1495,11 +1523,11 @@ class bug extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') { - die(array('status' => 'success', 'data' => $bugID)); + return print(array('status' => 'success', 'data' => $bugID)); } else { - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + return print(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } } @@ -1577,13 +1605,13 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban') + if(isset($execution->type) and $execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } else { @@ -1635,13 +1663,13 @@ class bug extends control if(isonlybody()) { $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban') + if(isset($execution->type) and $execution->type == 'kanban') { $regionID = isset($output['regionID']) ? $output['regionID'] : 0; - $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); - return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData)")); + return print(js::closeModal('parent.parent', '', "parent.parent.updateKanban($kanbanData, $regionID)")); } else { @@ -1650,11 +1678,11 @@ class bug extends control } if(defined('RUN_MODE') && RUN_MODE == 'api') { - die(array('status' => 'success', 'data' => $bugID)); + return print(array('status' => 'success', 'data' => $bugID)); } else { - die(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); + return print(js::locate($this->createLink('bug', 'view', "bugID=$bugID"), 'parent')); } } diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 77120f7d19..559b36355e 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1046,6 +1046,8 @@ function initKanban($kanban) */ $(function() { + if($.cookie('isFullScreen') == 1) $.cookie('isFullScreen', 0); + window.kanbanScaleSize = +$.zui.store.get('executionKanbanScaleSize', 1); $('#kanbanScaleSize').text(window.kanbanScaleSize); $('#kanbanScaleControl .btn[data-type="+"]').attr('disabled', window.kanbanScaleSize >= 4 ? 'disabled' : null); diff --git a/module/task/control.php b/module/task/control.php index cf4cf8a9f3..018abe8f79 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -679,7 +679,7 @@ class task extends control return print(js::closeModal('parent.parent', 'this')); } } - die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); + return print(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } $members = $this->loadModel('user')->getTeamMemberPairs($executionID, 'execution', 'nodeleted'); diff --git a/www/js/zui/kanban/min.js b/www/js/zui/kanban/min.js index faeef53a1c..8997017883 100644 --- a/www/js/zui/kanban/min.js +++ b/www/js/zui/kanban/min.js @@ -1,7 +1,7 @@ /*! - * ZUI: ZUI Kanban View - v1.10.0 - 2022-01-20 + * ZUI: ZUI Kanban View - v1.10.0 - 2022-01-21 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2022 cnezsoft.com; Licensed MIT */ -!function(){"use strict";function a(a,e){return n&&!e?requestAnimationFrame(a):setTimeout(a,e||0)}function e(a){return n?cancelAnimationFrame(a):void clearTimeout(a)}var n="function"==typeof window.requestAnimationFrame;$.zui({asap:a,clearAsap:e})}(),function(a){"use strict";function e(e,n){"string"==typeof e&&(e=a(e)),e instanceof a&&(e=e[0]);var t=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth;if(n)return t.left>=0&&t.top>=0&&t.left+t.width<=d&&t.top+t.height<=r;var i=t.top<=r&&t.top+t.height>=0,o=t.left<=d&&t.left+t.width>=0;return i&&o}var n="zui.virtualRender",t=function(e,r){"function"==typeof r&&(r={render:r});var d=this;d.name=n,d.$=a(e),d.options=r=a.extend({},t.DEFAULTS,this.$.data(),r),d.rendered=!1;var i=r.container;"function"==typeof i&&(i=i(d));var o=a(i?i:window);d.tryRender()||(d.$container=o,d.scrollListener=d.tryRender.bind(d),r.pendingClass&&d.$.addClass(r.pendingClass),o.on("scroll",d.scrollListener))};t.prototype.tryRender=function(){var n=this;return!(n.rendered||!e(n.$))&&(n.renderTaskID&&a.zui.clearAsap(n.renderTaskID),n.renderTaskID=a.zui.asap(function(){n.renderTaskID=null;var a=n.options.render(n.$);a!==!1&&(n.rendered=!0,n.destroy())},n.options.delay),!0)},t.prototype.destroy=function(){var e=this;e.renderTaskID&&a.zui.clearAsap(e.renderTaskID),e.scrollListener&&(e.$container.off("scroll",e.scrollListener),e.scrollListener=null);var t=e.options.pendingClass;t&&e.$.removeClass(t),e.$.removeData(n)},t.DEFAULTS={pendingClass:"virtual-pending"},a.fn.virtualRender=function(e){return this.each(function(){var r=a(this),d=r.data(n);if(d){if("string"==typeof e)return d[e]();d.destroy()}r.data(n,d=new t(this,e))})},a.zui.isElementInViewport=e}(jQuery),function(a){"use strict";var e="zui.kanban",n="object"==typeof CSS&&CSS.supports("display","flex"),t=function(n,r){var d=this;if(d.name=e,d.$=a(n).addClass("kanban"),r=d.setOptions(a.extend({},t.DEFAULTS,this.$.data(),r)),r.onAction){var i=function(e){var n=a(this);r.onAction(n.data("action"),n,e,d)};d.$.on("click",".action",i).on("dblclick",".action-dbc",i)}if("auto"===r.droppable&&(r.droppable=!r.readonly),r.droppable){var o=0,s={dropOnMouseleave:!0,selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof r.droppable?r.droppable(a):r.onAction&&r.onAction("dropItem",a.element,a,d)},start:function(e){d.$.addClass("kanban-dragging"),o&&clearTimeout(o),o=setTimeout(function(){a(e.shadowElement).addClass("in"),o=0},50)},always:function(){d.$.removeClass("kanban-dragging"),o&&(clearTimeout(o),o=0)}};"object"==typeof r.droppable&&a.extend(s,r.droppable),d.$.droppable(s)}r.onCreate&&r.onCreate(d)};t.prototype.setOptions=function(e){var t=this,r=a.extend({},t.options,{data:t.data},e);t.options=r,r.useFlex&&!n&&(r.useFlex=!1),t.$.toggleClass("no-flex",!r.useFlex).toggleClass("use-flex",!!r.useFlex);var d=!!a.fn.virtualRender&&r.virtualize;return d&&("object"!=typeof d&&(d={lane:!0}),t.virtualize=a.extend({},d)),t.data=r.data||[],t.render(t.data),r},t.prototype.render=function(a){var e=this;a&&(e.data=a),e.data&&!Array.isArray(e.data)&&(e.data=[e.data]);var n=e.data||[];e.options.beforeRender&&e.options.beforeRender(e,n),e.$.toggleClass("kanban-readonly",!!e.options.readonly).toggleClass("kanban-no-lane-name",!!e.options.noLaneName),e.$.children(".kanban-board").addClass("kanban-expired");for(var t=0;t0&&t.subLaneSpace&&(k.$height+=t.subLaneSpace)}}else for(var y=k.items||k.cards||{},g=0;g-1){var r=n.data[t];e=a.extend(r,e),n.data[t]=e}else n.data.push(e)}e.id||(e.id=a.zui.uuid());var d=e.id,i=n.options,o=n.$,s=o.children('.kanban-board[data-id="'+d+'"]');s.length?s.removeClass("kanban-expired"):s=a('
').appendTo(o),n.layoutKanban(e,s),n.renderKanbanHeader(e,s),s.children(".kanban-lane").addClass("kanban-expired");for(var l=e.lanes||[],c=0;c
').prependTo(n),r.useFlex||i.addClass("clearfix")),i.css("height",(d?2:1)*r.headerHeight).toggleClass("kanban-header-has-parent",!!d);var o=i.children(".kanban-cols");o.css("left",e.$layout.laneNameWidth).children(".kanban-col").addClass("kanban-expired");for(var s=e.columns,l=e.$layout.columnsMap||{},c=null,p=null,u=0;u.kanban-col").addClass("kanban-expired"):o=a(['
','
','
','','',i.showCount?'':"","
","
",'
',"
","
"].join("")),s&&s.length?s.after(o):n.prepend(o),o.data("col",e).attr("data-type",e.type);var l=r.$layout.columnWidth;i.useFlex?o.css("flex",e.subs.length+" "+e.subs.length+" "+l*e.subs.length+"%"):o.css({width:l*e.subs.length+"%",left:e.$index*l+"%"});var c=o.children(".kanban-header-col");c.find(".title>.icon").attr("class","icon icon-"+(e.icon||""));var p=c.find(".title>.text").text(e.name).attr("title",e.name);if(e.color&&p.css("color",e.color),i.showCount){var u=void 0!==e.count?e.count:e.$cardsCount;i.showZeroCount||u||(u="");var h=c.find(".title>.count").text(u);i.onRenderCount&&i.onRenderCount(h,u,e,d)}i.onRenderHeaderCol&&i.onRenderHeaderCol(o,e,n,r)},t.prototype.renderHeaderCol=function(e,n,t,r,d){var i=this,o=i.options;if(e.parentType&&t){var s=n.children('.kanban-header-parent-col[data-id="'+t.id+'"]');n=s.children(".kanban-header-sub-cols")}var l=n.children('.kanban-header-col[data-id="'+e.id+'"]'),c=r?n.children('.kanban-header-col[data-id="'+r.id+'"]:not(.kanban-expired)'):null;l.length?l.removeClass("kanban-expired"):l=a(['
','
','','',o.showCount?'':"","
",'
',"
"].join("")),c&&c.length?c.after(l):n.prepend(l),l.data("col",e).attr("data-type",e.type);var p=t?100/t.subs.length:d.$layout.columnWidth;o.useFlex?l.css("flex","1 1 "+p+"%"):l.css({left:(t?e.$subIndex:e.$index)*p+"%",width:p+"%"}),l.find(".title>.icon").attr("class","icon icon-"+(e.icon||""));var u=l.find(".title>.text").text(e.name).attr("title",e.name);if(e.color&&u.css("color",e.color),o.showCount){var h=void 0!==e.count?e.count:e.$cardsCount;o.showZeroCount||h||(h="");var b=l.find(".title>.count").text(h);o.onRenderCount&&o.onRenderCount(b,h,e,i)}o.onRenderHeaderCol&&o.onRenderHeaderCol(l,e,n,d)},t.prototype.renderLane=function(e,t,r,d){var i=this,o=i.options;r=r||i.$.children('.kanban-board[data-id="'+e.kanban+'"]');var s=r.children('.kanban-lane[data-id="'+e.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(r),n||s.addClass("clearfix"));var l=e.subLanes?e.subLanes.length:0;s.attr("data-index",e.$index).data("lane",e).toggleClass("has-sub-lane",l>0).css({height:e.$height||"auto"}),i.virtualizeRender(d,"lane",s,function(){if(!o.noLaneName){var n=s.children('.kanban-lane-name[data-id="'+e.id+'"]');n.length||(n=a('
').prependTo(s)),n.empty().css("width",o.laneNameWidth).attr("title",e.name).append(a('').text(e.name)),e.color&&n.css("background-color",e.color),o.onRenderLaneName&&o.onRenderLaneName(n,e,r,t,d)}s.children(".kanban-cols,.kanban-sub-lanes").addClass("kanban-expired");var l;l=e.subLanes?i.renderSubLanes(e,t,s,d):i.renderLaneCols(t,e.items||e.cards||{},s,e,d),o.useFlex||l.css("left",d.$layout.laneNameWidth),s.children(".kanban-expired").remove()},{lane:e,columns:t,kanban:d})},t.prototype.virtualizeRender=function(e,n,t,r,d){var i=this,o=i.virtualize,s=o?o[n]:null;return s?("function"==typeof s&&(s=s(d,t)),"number"==typeof s&&t.height(s),void t.virtualRender(a.extend({render:r},i.options.virtualRenderOptions))):r()},t.prototype.renderSubLanes=function(e,n,t,r){var d=this,i=t.children(".kanban-sub-lanes");i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(r),n||o.addClass("clearfix")),o.attr("data-index",i).data("lane",e).css({height:e.$height||"auto"}),o.children(".kanban-col").addClass("kanban-expired");var s=e.items||e.cards;s&&this.renderLaneCols(t,s,o,e,d),o.children(".kanban-expired").remove()},t.prototype.renderLaneCols=function(e,n,t,r,d){var i=this,o=t.children(".kanban-cols");o.length?o.removeClass("kanban-expired"):o=a('
').appendTo(t),o.children(".kanban-col").addClass("kanban-expired");for(var s=null,l=0;l1).attr("data-cards-per-row",s),d.children(".kanban-expired").remove()},t.prototype.renderLaneCol=function(e,n,t){var r=this,d=r.options,i=n.children('.kanban-lane-col[data-id="'+e.id+'"]'),o=t?n.children('.kanban-lane-col[data-id="'+t.id+'"]:not(.kanban-expired)'):null;i.length?i.removeClass("kanban-expired"):(i=a(['
','
',"
"].join("")),r.options.readonly||i.append(['
','","
"].join("")),d.laneItemsClass&&i.find(".kanban-lane-items").addClass(d.laneItemsClass),d.laneColClass&&i.addClass(d.laneColClass)),o&&o.length?o.after(i):n.prepend(i),i.attr({"data-parent":e.parentType?e.parentType:null,"data-type":e.type}).data("col",e);var s=e.$kanbanData.$layout.columnWidth;return d.useFlex?i.css("flex","1 1 "+s+"%"):i.css({left:e.$index*s+"%",width:s+"%"}),i},t.prototype.renderCard=function(e,n,t,r,d){var i=this.options,o=n.children('.kanban-item[data-id="'+e.id+'"]');o.length?o.removeClass("kanban-expired"):(o=a('
').appendTo(n),i.wrapCard&&o.append('
'));var s=t.cardsPerRow||r.cardsPerRow||d.cardsPerRow||i.cardsPerRow;o.data("item",e).css({padding:i.cardSpace/2,width:s>1?100/s+"%":""});var l=i.wrapCard?o.children(".kanban-card"):o;l.css("height",i.cardHeight);var c=i.cardRender||i.itemRender;if(c)c(e,l,t,r,d);else{var p=l.find(".title");p.length||(p=a('
').appendTo(l)),p.text(e.name||e.title)}return l},t.DEFAULTS={minColWidth:100,maxColHeight:400,minColHeight:90,minSubColHeight:40,subLaneSpace:2,laneNameWidth:20,headerHeight:32,cardHeight:40,cardSpace:10,cardsPerRow:1,wrapCard:!0,fluidBoardWidth:!0,addItemText:"添加条目",createColumnText:"添加看板列",useFlex:!0,droppable:"auto",laneColClass:"",showCount:!0},a.fn.kanban=function(n){return this.each(function(){var r=a(this),d=r.data(e),i="object"==typeof n&&n;d||r.data(e,d=new t(this,i)),"string"==typeof n&&d[n]()})},t.NAME=e,a.fn.kanban.Constructor=t}(jQuery); \ No newline at end of file +!function(){"use strict";function a(a,e){return n&&!e?requestAnimationFrame(a):setTimeout(a,e||0)}function e(a){return n?cancelAnimationFrame(a):void clearTimeout(a)}var n="function"==typeof window.requestAnimationFrame;$.zui({asap:a,clearAsap:e})}(),function(a){"use strict";function e(e,n){"string"==typeof e&&(e=a(e)),e instanceof a&&(e=e[0]);var t=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth;if(n)return t.left>=0&&t.top>=0&&t.left+t.width<=d&&t.top+t.height<=r;var i=t.top<=r&&t.top+t.height>=0,o=t.left<=d&&t.left+t.width>=0;return i&&o}var n="zui.virtualRender",t=function(e,r){"function"==typeof r&&(r={render:r});var d=this;d.name=n,d.$=a(e),d.options=r=a.extend({},t.DEFAULTS,this.$.data(),r),d.rendered=!1;var i=r.container;"function"==typeof i&&(i=i(d));var o=a(i?i:window);d.tryRender()||(d.$container=o,d.scrollListener=d.tryRender.bind(d),r.pendingClass&&d.$.addClass(r.pendingClass),o.on("scroll",d.scrollListener))};t.prototype.tryRender=function(){var n=this;return!(n.rendered||!e(n.$))&&(n.renderTaskID&&a.zui.clearAsap(n.renderTaskID),n.renderTaskID=a.zui.asap(function(){n.renderTaskID=null;var a=n.options.render(n.$);a!==!1&&(n.rendered=!0,n.destroy())},n.options.delay),!0)},t.prototype.destroy=function(){var e=this;e.renderTaskID&&a.zui.clearAsap(e.renderTaskID),e.scrollListener&&(e.$container.off("scroll",e.scrollListener),e.scrollListener=null);var t=e.options.pendingClass;t&&e.$.removeClass(t),e.$.removeData(n)},t.DEFAULTS={pendingClass:"virtual-pending"},a.fn.virtualRender=function(e){return this.each(function(){var r=a(this),d=r.data(n);if(d){if("string"==typeof e)return d[e]();d.destroy()}r.data(n,d=new t(this,e))})},a.zui.isElementInViewport=e}(jQuery),function(a){"use strict";var e="zui.kanban",n="object"==typeof CSS&&CSS.supports("display","flex"),t=function(n,r){var d=this;if(d.name=e,d.$=a(n).addClass("kanban"),r=d.setOptions(a.extend({},t.DEFAULTS,this.$.data(),r)),r.onAction){var i=function(e){var n=a(this);r.onAction(n.data("action"),n,e,d)};d.$.on("click",".action",i).on("dblclick",".action-dbc",i)}if("auto"===r.droppable&&(r.droppable=!r.readonly),r.droppable){var o=0,s={dropOnMouseleave:!0,selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof r.droppable?r.droppable(a):r.onAction&&r.onAction("dropItem",a.element,a,d)},start:function(e){d.$.addClass("kanban-dragging"),o&&clearTimeout(o),o=setTimeout(function(){a(e.shadowElement).addClass("in"),o=0},50)},always:function(){d.$.removeClass("kanban-dragging"),o&&(clearTimeout(o),o=0)}};"object"==typeof r.droppable&&a.extend(s,r.droppable),d.$.droppable(s)}r.onCreate&&r.onCreate(d)};t.prototype.setOptions=function(e){var t=this,r=a.extend({},t.options,{data:t.data},e);t.options=r,r.useFlex&&!n&&(r.useFlex=!1),t.$.toggleClass("no-flex",!r.useFlex).toggleClass("use-flex",!!r.useFlex);var d=!!a.fn.virtualRender&&r.virtualize;return d&&("object"!=typeof d&&(d={lane:!0}),t.virtualize=a.extend({},d)),t.data=r.data||[],t.render(t.data),r},t.prototype.render=function(a){var e=this;a&&(e.data=a),e.data&&!Array.isArray(e.data)&&(e.data=[e.data]);var n=e.data||[];e.options.beforeRender&&e.options.beforeRender(e,n),e.$.toggleClass("kanban-readonly",!!e.options.readonly).toggleClass("kanban-no-lane-name",!!e.options.noLaneName),e.$.children(".kanban-board").addClass("kanban-expired");for(var t=0;t0&&t.subLaneSpace&&(k.$height+=t.subLaneSpace)}}else for(var y=k.items||k.cards||{},g=0;g-1){var r=n.data[t];e=a.extend(r,e),n.data[t]=e}else n.data.push(e)}e.id||(e.id=a.zui.uuid());var d=e.id,i=n.options,o=n.$,s=o.children('.kanban-board[data-id="'+d+'"]');s.length?s.removeClass("kanban-expired"):s=a('
').appendTo(o),n.layoutKanban(e,s),n.renderKanbanHeader(e,s),s.children(".kanban-lane").addClass("kanban-expired");for(var l=e.lanes||[],c=0;c
').prependTo(n),r.useFlex||i.addClass("clearfix")),i.css("height",(d?2:1)*r.headerHeight).toggleClass("kanban-header-has-parent",!!d);var o=i.children(".kanban-cols");o.css("left",e.$layout.laneNameWidth).children(".kanban-col").addClass("kanban-expired");for(var s=e.columns,l=e.$layout.columnsMap||{},c=null,p=null,u=0;u.kanban-col").addClass("kanban-expired"):o=a(['
','
','
','','',i.showCount?'':"","
","
",'
',"
","
"].join("")),s&&s.length?s.after(o):n.prepend(o),o.data("col",e).attr("data-type",e.type);var l=r.$layout.columnWidth;i.useFlex?o.css("flex",e.subs.length+" "+e.subs.length+" "+l*e.subs.length+"%"):o.css({width:l*e.subs.length+"%",left:e.$index*l+"%"});var c=o.children(".kanban-header-col");c.find(".title>.icon").attr("class","icon icon-"+(e.icon||""));var p=c.find(".title>.text").text(e.name).attr("title",e.name);if(e.color&&p.css("color",e.color),i.showCount){var u=void 0!==e.count?e.count:e.$cardsCount;i.showZeroCount||u||(u="");var h=c.find(".title>.count").text(u);i.onRenderCount&&i.onRenderCount(h,u,e,d)}i.onRenderHeaderCol&&i.onRenderHeaderCol(o,e,n,r)},t.prototype.renderHeaderCol=function(e,n,t,r,d){var i=this,o=i.options;if(e.parentType&&t){var s=n.children('.kanban-header-parent-col[data-id="'+t.id+'"]');n=s.children(".kanban-header-sub-cols")}var l=n.children('.kanban-header-col[data-id="'+e.id+'"]'),c=r?n.children('.kanban-header-col[data-id="'+r.id+'"]:not(.kanban-expired)'):null;l.length?l.removeClass("kanban-expired"):l=a(['
','
','','',o.showCount?'':"","
",'
',"
"].join("")),c&&c.length?c.after(l):n.prepend(l),l.data("col",e).attr("data-type",e.type);var p=t?100/t.subs.length:d.$layout.columnWidth;o.useFlex?l.css("flex","1 1 "+p+"%"):l.css({left:(t?e.$subIndex:e.$index)*p+"%",width:p+"%"}),l.find(".title>.icon").attr("class","icon icon-"+(e.icon||""));var u=l.find(".title>.text").text(e.name).attr("title",e.name);if(e.color&&u.css("color",e.color),o.showCount){var h=void 0!==e.count?e.count:e.$cardsCount;o.showZeroCount||h||(h="");var b=l.find(".title>.count").text(h);o.onRenderCount&&o.onRenderCount(b,h,e,i)}o.onRenderHeaderCol&&o.onRenderHeaderCol(l,e,n,d)},t.prototype.renderLane=function(e,t,r,d){var i=this,o=i.options;r=r||i.$.children('.kanban-board[data-id="'+e.kanban+'"]');var s=r.children('.kanban-lane[data-id="'+e.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(r),n||s.addClass("clearfix"));var l=e.subLanes?e.subLanes.length:0;s.attr("data-index",e.$index).data("lane",e).toggleClass("has-sub-lane",l>0).css({height:e.$height||"auto"}),i.virtualizeRender(d,"lane",s,function(){if(!o.noLaneName){var n=s.children('.kanban-lane-name[data-id="'+e.id+'"]');n.length||(n=a('
').prependTo(s)),n.empty().css("width",o.laneNameWidth).attr("title",e.name).append(a('').text(e.name)),e.color&&n.css("background-color",e.color),o.onRenderLaneName&&o.onRenderLaneName(n,e,r,t,d)}s.children(".kanban-cols,.kanban-sub-lanes").addClass("kanban-expired");var l;l=e.subLanes?i.renderSubLanes(e,t,s,d):i.renderLaneCols(t,e.items||e.cards||{},s,e,d),o.useFlex||l.css("left",d.$layout.laneNameWidth),s.children(".kanban-expired").remove()},{lane:e,columns:t,kanban:d})},t.prototype.virtualizeRender=function(e,n,t,r,d){var i=this,o=i.virtualize,s=o?o[n]:null;return s?("function"==typeof s&&(s=s(d,t)),"number"==typeof s&&t.height(s),void t.virtualRender(a.extend({render:r},i.options.virtualRenderOptions))):r()},t.prototype.renderSubLanes=function(e,n,t,r){var d=this,i=t.children(".kanban-sub-lanes");i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var o=0;o').appendTo(r),n||o.addClass("clearfix")),o.attr("data-index",i).data("lane",e).css({height:e.$height||"auto"}),o.children(".kanban-col").addClass("kanban-expired");var s=e.items||e.cards;s&&this.renderLaneCols(t,s,o,e,d),o.children(".kanban-expired").remove()},t.prototype.renderLaneCols=function(e,n,t,r,d){var i=this,o=t.children(".kanban-cols");o.length?o.removeClass("kanban-expired"):o=a('
').appendTo(t),o.children(".kanban-col").addClass("kanban-expired");for(var s=null,l=0;l0?e[i-1]:null;o.$index=i,o.$col=a,o.$lane=t,this.renderCard(o,d,s,a,t,r)}var l=a.cardsPerRow||t.cardsPerRow||r.cardsPerRow||this.options.cardsPerRow;d.css("padding",this.options.cardSpace/2).toggleClass("kanban-items-grid",l>1).attr("data-cards-per-row",l),d.children(".kanban-expired").remove()},t.prototype.renderLaneCol=function(e,n,t){var r=this,d=r.options,i=n.children('.kanban-lane-col[data-id="'+e.id+'"]'),o=t?n.children('.kanban-lane-col[data-id="'+t.id+'"]:not(.kanban-expired)'):null;i.length?i.removeClass("kanban-expired"):(i=a(['
','
',"
"].join("")),r.options.readonly||i.append(['
','","
"].join("")),d.laneItemsClass&&i.find(".kanban-lane-items").addClass(d.laneItemsClass),d.laneColClass&&i.addClass(d.laneColClass)),o&&o.length?o.after(i):n.prepend(i),i.attr({"data-parent":e.parentType?e.parentType:null,"data-type":e.type}).data("col",e);var s=e.$kanbanData.$layout.columnWidth;return d.useFlex?i.css("flex","1 1 "+s+"%"):i.css({left:e.$index*s+"%",width:s+"%"}),i},t.prototype.renderCard=function(e,n,t,r,d,i){var o=this.options,s=n.children('.kanban-item[data-id="'+e.id+'"]'),l=t?n.children('.kanban-item[data-id="'+t.id+'"]:not(.kanban-expired)'):null;s.length?s.removeClass("kanban-expired"):(s=a('
'),o.wrapCard&&s.append('
')),l&&l.length?l.after(s):n.prepend(s);var c=r.cardsPerRow||d.cardsPerRow||i.cardsPerRow||o.cardsPerRow;s.data("item",e).css({padding:o.cardSpace/2,width:c>1?100/c+"%":""});var p=o.wrapCard?s.children(".kanban-card"):s;p.css("height",o.cardHeight);var u=o.cardRender||o.itemRender;if(u)u(e,p,r,d,i);else{var h=p.find(".title");h.length||(h=a('
').appendTo(p)),h.text(e.name||e.title)}return p},t.DEFAULTS={minColWidth:100,maxColHeight:400,minColHeight:90,minSubColHeight:40,subLaneSpace:2,laneNameWidth:20,headerHeight:32,cardHeight:40,cardSpace:10,cardsPerRow:1,wrapCard:!0,fluidBoardWidth:!0,addItemText:"添加条目",createColumnText:"添加看板列",useFlex:!0,droppable:"auto",laneColClass:"",showCount:!0},a.fn.kanban=function(n){return this.each(function(){var r=a(this),d=r.data(e),i="object"==typeof n&&n;d||r.data(e,d=new t(this,i)),"string"==typeof n&&d[n]()})},t.NAME=e,a.fn.kanban.Constructor=t}(jQuery); \ No newline at end of file From dfddd4e48be837b9ea25cf398f39be5c96fa2a22 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 21 Jan 2022 13:19:02 +0800 Subject: [PATCH 19/31] * Modify the code. --- module/bug/control.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 51d54e8a23..6a4e674351 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -407,9 +407,8 @@ class bug extends control $executionID = $this->post->execution ? $this->post->execution : $output['executionID']; if($executionID == $output['executionID']) { - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); - $kanbanData = json_encode($kanbanData); - $callback = '"callback" => "parent.updateKanban($kanbanData, 0)"'; + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all'); + $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, 0)")); } else @@ -1217,7 +1216,7 @@ class bug extends control { $bug = $this->bug->getById($bugID); $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban') + if(isset($execution->type) and $execution->type == 'kanban') { $kanbanData = $this->loadModel('kanban')->getRDKanban($bug->execution, $this->session->execLaneType ? $this->session->execLaneType : 'all'); $kanbanData = json_encode($kanbanData); From aaaefa509ce9228c7d82782d09ee358e16555185 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 21 Jan 2022 13:32:58 +0800 Subject: [PATCH 20/31] * Optimize code. --- db/update16.2.sql | 2 +- module/group/lang/resource.php | 3 +- module/kanban/control.php | 30 +++++++++++++---- module/kanban/js/view.js | 48 ++++++++++++++++++++-------- module/kanban/model.php | 2 +- module/kanban/view/viewcard.html.php | 9 +++++- 6 files changed, 70 insertions(+), 24 deletions(-) diff --git a/db/update16.2.sql b/db/update16.2.sql index c6ffc46d79..150331a5bf 100644 --- a/db/update16.2.sql +++ b/db/update16.2.sql @@ -1,7 +1,7 @@ ALTER TABLE `zt_kanbanspace` ADD `type` varchar(50) NOT NULL AFTER `name`; UPDATE `zt_kanbanspace` SET `type` = 'cooperation'; ALTER TABLE `zt_kanban` ADD `performable` enum ('0', '1') NOT NULL DEFAULT '0' AFTER `archived`; -ALTER TABLE `zt_kanbancard` ADD `status` enum ('doing', 'done') NOT NULL DEFAULT 'doing' AFTER `name`; +ALTER TABLE `zt_kanbancard` ADD `status` varchar(30) NOT NULL AFTER `name`; ALTER TABLE `zt_job` ADD `sonarqubeServer` mediumint(8) unsigned NOT NULL AFTER `triggerType`; ALTER TABLE `zt_job` ADD `projectKey` varchar(255) NOT NULL AFTER `sonarqubeServer`; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index dabeb585e3..e0a6e1816f 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -669,7 +669,8 @@ $lang->resource->kanban->assigntoCard = 'assigntoCard'; //$lang->resource->kanban->copyCard = 'copyCard'; $lang->resource->kanban->deleteCard = 'deleteCard'; $lang->resource->kanban->moveCard = 'moveCard'; -$lang->resource->kanban->editCardStatus = 'editCardStatus'; +$lang->resource->kanban->finishCard = 'finishCard'; +$lang->resource->kanban->activeCard = 'activeCard'; $lang->resource->kanban->setCardColor = 'setCardColor'; $lang->resource->kanban->laneMove = 'laneMove'; $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn'; diff --git a/module/kanban/control.php b/module/kanban/control.php index b30c9c46ea..bde75c8692 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -733,21 +733,39 @@ class kanban extends control } /** - * Update card status. + * Finish a card. * * @param int $cardID * @param int $kanbanID * @access public * @return void */ - public function editCardStatus($cardID, $kanbanID) + public function finishCard($cardID, $kanbanID) { - $card = $this->kanban->getCardByID($cardID); - $card->status = $card->status == 'doing' ? 'done' : 'doing'; - - $this->dao->update(TABLE_KANBANCARD)->set('status')->eq($card->status)->where('id')->eq($cardID)->exec(); + $this->dao->update(TABLE_KANBANCARD)->set('status')->eq('done')->where('id')->eq($cardID)->exec(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(isonlybody()) return print(js::reload('parent.parent')); + + $kanbanGroup = $this->kanban->getKanbanData($kanbanID); + return print(json_encode($kanbanGroup)); + } + + /** + * Active a card. + * + * @param int $cardID + * @param int $kanbanID + * @access public + * @return void + */ + public function activeCard($cardID, $kanbanID) + { + $this->dao->update(TABLE_KANBANCARD)->set('status')->eq('doing')->where('id')->eq($cardID)->exec(); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + if(isonlybody()) return print(js::reload('parent.parent')); + $kanbanGroup = $this->kanban->getKanbanData($kanbanID); return print(json_encode($kanbanGroup)); } diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 6254102e2c..5e298ae439 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -257,7 +257,7 @@ function renderKanbanItem(item, $item) { var $title = $item.children('.title'); var privs = item.actions; - var printMoreBtn = (privs.includes('editCard') || privs.includes('editCardStatus') ||privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); + var printMoreBtn = (privs.includes('editCard') || privs.includes('finishCard') || privs.includes('activeCard') ||privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); if(privs.includes('sortCard')) $item.parent().addClass('sort'); if(!$title.length) @@ -447,17 +447,43 @@ function setCardColor(cardID, color, kanbanID, regionID) } /** - * Update card status. + * Finish a card. * * @param int $cardID * @param int $kanbanID + * @param int $regionID * @access public * @return void */ -function editCardStatus(cardID, kanbanID, regionID) +function finishCard(cardID, kanbanID, regionID) { if(!cardID) return false; - var url = createLink('kanban', 'editCardStatus', 'cardID=' + cardID + '&kanbanID=' + kanbanID); + var url = createLink('kanban', 'finishCard', 'cardID=' + cardID + '&kanbanID=' + kanbanID); + return $.ajax( + { + method: 'post', + dataType: 'json', + url: url, + success: function(data) + { + updateRegion(regionID, data[regionID]); + } + }); +} + +/** + * Active a card. + * + * @param int $cardID + * @param int $kanbanID + * @param int $regionID + * @access public + * @return void + */ +function activeCard(cardID, kanbanID, regionID) +{ + if(!cardID) return false; + var url = createLink('kanban', 'activeCard', 'cardID=' + cardID + '&kanbanID=' + kanbanID); return $.ajax( { method: 'post', @@ -722,22 +748,16 @@ function createCardMenu(options) var items = []; if(privs.includes('editCard')) items.push({label: kanbanLang.editCard, icon: 'edit', url: createLink('kanban', 'editCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); - if(privs.includes('editCardStatus') && kanban.performable == 1) + if(kanban.performable == 1) { - var statusLang = ''; - var statusIcon = ''; - if(card.status == 'doing') + if(privs.includes('activeCard') && card.status != 'doing') { - statusLang = kanbanLang.finishCard; - statusIcon = 'checked'; + items.push({label: kanbanLang.activeCard, icon: 'magic', onClick: function(){activeCard(card.id, card.kanban, card.region);}}); } else { - statusLang = kanbanLang.activeCard; - statusIcon = 'magic'; + items.push({label: kanbanLang.finishCard, icon: 'checked', onClick: function(){finishCard(card.id, card.kanban, card.region);}}); } - - items.push({label: statusLang, icon: statusIcon, onClick: function(){editCardStatus(card.id, card.kanban, card.region);}}); } if(privs.includes('archiveCard') && kanban.archived == '1') items.push({label: kanbanLang.archiveCard, icon: 'card-archive', url: createLink('kanban', 'archiveCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}}); if(privs.includes('copyCard')) items.push({label: kanbanLang.copyCard, icon: 'copy', url: createLink('kanban', 'copyCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}}); diff --git a/module/kanban/model.php b/module/kanban/model.php index b653ea8bd7..140289a6b0 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -872,7 +872,7 @@ class kanbanModel extends model ->andWhere('type')->eq('common') ->fetchAll(); - $actions = array('editCard', 'editCardStatus', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); + $actions = array('editCard', 'finishCard', 'activeCard', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); $cardGroup = array(); foreach($cellList as $cell) { diff --git a/module/kanban/view/viewcard.html.php b/module/kanban/view/viewcard.html.php index 7de50aaf78..2d9b94fb30 100644 --- a/module/kanban/view/viewcard.html.php +++ b/module/kanban/view/viewcard.html.php @@ -39,12 +39,19 @@ //common::printLink('kanban', 'assigntoCard', "cardID=$card->id", "{$lang->kanbancard->assign}", '', "class='btn btn-link iframe' title='{$lang->kanbancard->assign}'", true, true); if($kanban->archived) { - common::printLink('kanban', 'archiveCard', "cardID=$card->id", "{$lang->kanbancard->archive}", 'hiddenwin', "class='btn btn-link' title='{$lang->kanbancard->archive}'", true, true); + common::printLink('kanban', 'archiveCard', "cardID=$card->id", "{$lang->kanbancard->archive}", 'hiddenwin', "class='btn btn-link' title='{$lang->kanbancard->archive}'", true, true); echo "
"; } common::printLink('kanban', 'editCard', "cardID=$card->id", '', '', "class='btn btn-link iframe' data-width='80%' title='{$lang->kanbancard->edit}'", true, true); + + if($kanban->performable) + { + if($card->status == 'done') common::printLink('kanban', 'activeCard', "cardID={$card->id}&kanbanID={$kanban->id}", '', '', "class='btn btn-link iframe' title='{$lang->kanban->activeCard}'", true, true); + if($card->status == 'doing') common::printLink('kanban', 'finishCard', "cardID={$card->id}&kanbanID={$kanban->id}", '', '', "class='btn btn-link iframe' title='{$lang->kanban->finishCard}'", true, true); + } + common::printLink('kanban', 'copyCard', "cardID=$card->id", '', '', "class='btn btn-link iframe' title='{$lang->kanbancard->copy}'", true, true); common::printLink('kanban', 'deleteCard', "cardID=$card->id", '', 'hiddenwin', "class='btn btn-link' title='{$lang->kanbancard->delete}'",true, true); ?> From 2d6115537fbada23ed01f77e1fb3f64cfc91cc1c Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 21 Jan 2022 05:35:35 +0000 Subject: [PATCH 21/31] Fix bug. --- module/kanban/model.php | 4 ++++ module/kanban/view/batchcreatecard.html.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/kanban/model.php b/module/kanban/model.php index cabb5c866e..dfb887585e 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -480,6 +480,10 @@ class kanbanModel extends model */ public function batchCreateCard($kanbanID, $regionID, $groupID, $columnID) { + foreach($_POST['name'] as $index => $value) + { + if($_POST['name'][$index] and isset($_POST['assignedTo'][$index])) $_POST['assignedTo'][$index] = implode(',', $_POST['assignedTo'][$index]); + } $cards = fixer::input('post')->get(); $now = helper::now(); diff --git a/module/kanban/view/batchcreatecard.html.php b/module/kanban/view/batchcreatecard.html.php index 1db3829291..3312774cc2 100644 --- a/module/kanban/view/batchcreatecard.html.php +++ b/module/kanban/view/batchcreatecard.html.php @@ -39,7 +39,7 @@
- + - kanban->batchCreate; $i++):?> + kanban->batchCreate; $i++):?> From 80da12fc7db3600b69d73cd163e558c9f22eb150 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 21 Jan 2022 13:49:47 +0800 Subject: [PATCH 23/31] * Finish task#48008 and fix bug for 48011. --- module/execution/control.php | 60 ++++++++++++++++++++++----- module/execution/js/kanban.js | 45 ++++++++++++++++++++ module/execution/view/kanban.html.php | 10 ++--- module/kanban/control.php | 4 +- 4 files changed, 102 insertions(+), 17 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index bf3528b314..6a7798ec9c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1709,10 +1709,11 @@ class execution extends control * Start execution. * * @param int $executionID + * @param string $from * @access public * @return void */ - public function start($executionID) + public function start($executionID, $from = 'execution') { $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1732,7 +1733,14 @@ class execution extends control $this->loadModel('common')->syncPPEStatus($executionID); $this->executeHooks($executionID); - die(js::reload('parent.parent')); + if(isonlybody() and $from == 'kanban') + { + return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')")); + } + else + { + return print(js::reload('parent.parent')); + } } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->start; @@ -1747,10 +1755,11 @@ class execution extends control * Delay execution. * * @param int $executionID + * @param string $from * @access public * @return void */ - public function putoff($executionID) + public function putoff($executionID, $from = 'execution') { $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1767,7 +1776,14 @@ class execution extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($executionID); - die(js::reload('parent.parent')); + if(isonlybody() and $from == 'kanban') + { + return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')")); + } + else + { + return print(js::reload('parent.parent')); + } } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->putoff; @@ -1782,10 +1798,11 @@ class execution extends control * Suspend execution. * * @param int $executionID + * @param string $from * @access public * @return void */ - public function suspend($executionID) + public function suspend($executionID, $from = 'execution') { $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1803,7 +1820,14 @@ class execution extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($executionID); - die(js::reload('parent.parent')); + if(isonlybody() and $from == 'kanban') + { + return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('suspended')")); + } + else + { + return print(js::reload('parent.parent')); + } } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->suspend; @@ -1818,10 +1842,11 @@ class execution extends control * Activate execution. * * @param int $executionID + * @param string $frim * @access public * @return void */ - public function activate($executionID) + public function activate($executionID, $from = 'execution') { $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1839,7 +1864,14 @@ class execution extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($executionID); - die(js::reload('parent.parent')); + if(isonlybody() and $from == 'kanban') + { + return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('doing')")); + } + else + { + return print(js::reload('parent.parent')); + } } $newBegin = date('Y-m-d'); @@ -1861,10 +1893,11 @@ class execution extends control * Close execution. * * @param int $executionID + * @param string $from * @access public * @return void */ - public function close($executionID) + public function close($executionID, $from = 'execution') { $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -1882,7 +1915,14 @@ class execution extends control $this->action->logHistory($actionID, $changes); } $this->executeHooks($executionID); - die(js::reload('parent.parent')); + if(isonlybody() and $from == 'kanban') + { + return print(js::closeModal('parent.parent', '', "parent.parent.changeStatus('closed')")); + } + else + { + return print(js::reload('parent.parent')); + } } $this->view->title = $this->view->execution->name . $this->lang->colon .$this->lang->execution->close; diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 77120f7d19..cd3fb4643b 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1,3 +1,46 @@ +/** + * When execution status change. + * + * @param stirng executionStatus + * @access public + * @return void + */ +function changeStatus(executionStatus) +{ + if(executionStatus == 'wait') + { + $('.startButton').removeClass('hidden'); + $('.putoffButton').removeClass('hidden'); + $('.suspendButton').removeClass('hidden'); + $('.closeButton').removeClass('hidden'); + $('.activateButton').addClass('hidden'); + } + else if(executionStatus == 'doing') + { + $('.startButton').addClass('hidden'); + $('.putoffButton').removeClass('hidden'); + $('.suspendButton').removeClass('hidden'); + $('.closeButton').removeClass('hidden'); + $('.activateButton').addClass('hidden'); + } + else if(executionStatus == 'suspended') + { + $('.startButton').addClass('hidden'); + $('.putoffButton').addClass('hidden'); + $('.suspendButton').addClass('hidden'); + $('.closeButton').removeClass('hidden'); + $('.activateButton').removeClass('hidden'); + } + else if(executionStatus == 'closed') + { + $('.startButton').addClass('hidden'); + $('.putoffButton').addClass('hidden'); + $('.suspendButton').addClass('hidden'); + $('.closeButton').addClass('hidden'); + $('.activateButton').removeClass('hidden'); + } +} + /** * Display the kanban in full screen. * @@ -1046,6 +1089,8 @@ function initKanban($kanban) */ $(function() { + changeStatus(execution.status); + window.kanbanScaleSize = +$.zui.store.get('executionKanbanScaleSize', 1); $('#kanbanScaleSize').text(window.kanbanScaleSize); $('#kanbanScaleControl .btn[data-type="+"]').attr('disabled', window.kanbanScaleSize >= 4 ? 'disabled' : null); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index bb28bde6e2..425f0e7350 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -126,11 +126,11 @@ js::set('hasTaskButton', $hasTaskButton); if(common::hasPriv('kanban', 'setLaneHeight')) $actions .= '
  • ' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$execution->id&from=execution", '', true), '' . $lang->kanban->laneHeight, '', "class='iframe btn btn-link text-left' data-width=$width") . '
  • '; $kanbanActions = ''; if(common::hasPriv('execution', 'edit')) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'edit', "executionID=$execution->id", '', true), '' . $lang->kanban->edit, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; - if(in_array('start', $executionActions)) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'start', "executionID=$execution->id", '', true), '' . $lang->execution->start, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; - if(in_array('putoff', $executionActions)) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'putoff', "executionID=$execution->id", '', true), '' . $lang->execution->putoff, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; - if(in_array('suspend', $executionActions)) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'suspend', "executionID=$execution->id", '', true), '' . $lang->execution->suspend, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; - if(in_array('close', $executionActions)) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'close', "executionID=$execution->id", '', true), '' . $lang->execution->close, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; - if(in_array('activate', $executionActions)) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'activate', "executionID=$execution->id", '', true), '' . $lang->execution->activate, '', "class='iframe btn btn-link text-left' data-width='75%'") . '
  • '; + if(common::hasPriv('execution', 'start')) $kanbanActions .= ''; + if(common::hasPriv('execution', 'putoff')) $kanbanActions .= ''; + if(common::hasPriv('execution', 'suspend')) $kanbanActions .= ''; + if(common::hasPriv('execution', 'close')) $kanbanActions .= ''; + if(common::hasPriv('execution', 'activate')) $kanbanActions .= ''; if(common::hasPriv('execution', 'delete')) $kanbanActions .= '
  • ' . html::a(helper::createLink('execution', 'delete', "executionID=$execution->id"), '' . $lang->delete, 'hiddenwin', "class='btn btn-link text-left'") . '
  • '; if($kanbanActions) { diff --git a/module/kanban/control.php b/module/kanban/control.php index 2ad001cfd7..d768bf78d6 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -941,7 +941,7 @@ class kanban extends control { if(dao::isError()) return $this->sendError(dao::getError()); $regionID = $column->region; - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, 'all', 'id_desc', $regionID); + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)")); @@ -1022,7 +1022,7 @@ class kanban extends control { if(dao::isError()) return $this->sendError(dao::getError()); $regionID = $column->region; - $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, 'all', 'id_desc', $regionID); + $kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all', 'id_desc', $regionID); $kanbanData = json_encode($kanbanData); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.updateKanban($kanbanData, $regionID)")); From 6ba1e7212d3a2b3dda2f8a588d0d20719fe5968d Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 21 Jan 2022 13:50:56 +0800 Subject: [PATCH 24/31] * Optimize code. --- module/group/lang/resource.php | 4 +-- module/kanban/control.php | 8 ++--- module/kanban/js/view.js | 12 ++++---- module/kanban/lang/en.php | 4 +-- module/kanban/lang/zh-cn.php | 4 +-- module/kanban/model.php | 8 ++--- module/kanban/view/setdonefunction.html.php | 34 --------------------- module/kanban/view/viewcard.html.php | 2 +- 8 files changed, 21 insertions(+), 55 deletions(-) delete mode 100644 module/kanban/view/setdonefunction.html.php diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index e0a6e1816f..f9ede55dc2 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -644,7 +644,7 @@ $lang->resource->kanban->close = 'close'; $lang->resource->kanban->delete = 'delete'; $lang->resource->kanban->createRegion = 'createRegion'; $lang->resource->kanban->editRegion = 'editRegion'; -$lang->resource->kanban->setDoneFunction = 'setDoneFunction'; +$lang->resource->kanban->performable = 'performable'; $lang->resource->kanban->sortRegion = 'sortRegion'; $lang->resource->kanban->sortGroup = 'sortGroup'; $lang->resource->kanban->deleteRegion = 'deleteRegion'; @@ -670,7 +670,7 @@ $lang->resource->kanban->assigntoCard = 'assigntoCard'; $lang->resource->kanban->deleteCard = 'deleteCard'; $lang->resource->kanban->moveCard = 'moveCard'; $lang->resource->kanban->finishCard = 'finishCard'; -$lang->resource->kanban->activeCard = 'activeCard'; +$lang->resource->kanban->activateCard = 'activateCard'; $lang->resource->kanban->setCardColor = 'setCardColor'; $lang->resource->kanban->laneMove = 'laneMove'; $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn'; diff --git a/module/kanban/control.php b/module/kanban/control.php index bde75c8692..0f75d68324 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -752,14 +752,14 @@ class kanban extends control } /** - * Active a card. + * Activate a card. * * @param int $cardID * @param int $kanbanID * @access public * @return void */ - public function activeCard($cardID, $kanbanID) + public function activate($cardID, $kanbanID) { $this->dao->update(TABLE_KANBANCARD)->set('status')->eq('doing')->where('id')->eq($cardID)->exec(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); @@ -1069,13 +1069,13 @@ class kanban extends control } /** - * Set done function. + * Setup done function. * * @param int $kanbanID * @access public * @return void */ - public function setDoneFunction($kanbanID) + public function performable($kanbanID) { if(!empty($_POST)) { diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 5e298ae439..f6472f1932 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -257,7 +257,7 @@ function renderKanbanItem(item, $item) { var $title = $item.children('.title'); var privs = item.actions; - var printMoreBtn = (privs.includes('editCard') || privs.includes('finishCard') || privs.includes('activeCard') ||privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); + var printMoreBtn = (privs.includes('editCard') || privs.includes('finishCard') || privs.includes('activateCard') ||privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor')); if(privs.includes('sortCard')) $item.parent().addClass('sort'); if(!$title.length) @@ -472,7 +472,7 @@ function finishCard(cardID, kanbanID, regionID) } /** - * Active a card. + * Activate a card. * * @param int $cardID * @param int $kanbanID @@ -480,10 +480,10 @@ function finishCard(cardID, kanbanID, regionID) * @access public * @return void */ -function activeCard(cardID, kanbanID, regionID) +function activateCard(cardID, kanbanID, regionID) { if(!cardID) return false; - var url = createLink('kanban', 'activeCard', 'cardID=' + cardID + '&kanbanID=' + kanbanID); + var url = createLink('kanban', 'activateCard', 'cardID=' + cardID + '&kanbanID=' + kanbanID); return $.ajax( { method: 'post', @@ -750,9 +750,9 @@ function createCardMenu(options) if(privs.includes('editCard')) items.push({label: kanbanLang.editCard, icon: 'edit', url: createLink('kanban', 'editCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(kanban.performable == 1) { - if(privs.includes('activeCard') && card.status != 'doing') + if(privs.includes('activateCard') && card.status != 'doing') { - items.push({label: kanbanLang.activeCard, icon: 'magic', onClick: function(){activeCard(card.id, card.kanban, card.region);}}); + items.push({label: kanbanLang.activateCard, icon: 'magic', onClick: function(){activateCard(card.id, card.kanban, card.region);}}); } else { diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 2cc8d684f4..08cadf01c1 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -28,7 +28,7 @@ $lang->kanban->deleteColumn = 'Delete Column'; $lang->kanban->createCard = 'Create Card'; $lang->kanban->editCard = 'Edit Card'; $lang->kanban->finishCard = 'Finish Card'; -$lang->kanban->activeCard = 'Active Card'; +$lang->kanban->activateCard = 'Activate Card'; $lang->kanban->viewCard = 'View Card'; $lang->kanban->archiveCard = 'Archive Card'; $lang->kanban->sortCard = 'Sort Card'; @@ -39,7 +39,7 @@ $lang->kanban->setCardColor = 'Set Card Color'; $lang->kanban->deleteCard = 'Delete Card'; $lang->kanban->assigntoCard = 'Assign'; $lang->kanban->setting = 'Setting'; -$lang->kanban->setDoneFunction = 'Set done function'; +$lang->kanban->performable = 'Set done function'; $lang->kanban->doneFunction = 'Done function'; $lang->kanban->splitColumn = 'Split Column'; $lang->kanban->createColumnOnLeft = 'Create Column On Left'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 88abfbd07a..40e8a61fb3 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -28,7 +28,7 @@ $lang->kanban->deleteColumn = '删除看板列'; $lang->kanban->createCard = '创建卡片'; $lang->kanban->editCard = '编辑卡片'; $lang->kanban->finishCard = '完成卡片'; -$lang->kanban->activeCard = '激活卡片'; +$lang->kanban->activateCard = '激活卡片'; $lang->kanban->viewCard = '查看卡片'; $lang->kanban->archiveCard = '归档卡片'; $lang->kanban->sortCard = '卡片排序'; @@ -39,7 +39,7 @@ $lang->kanban->setCardColor = '设置卡片颜色'; $lang->kanban->deleteCard = '删除卡片'; $lang->kanban->assigntoCard = '指派'; $lang->kanban->setting = '设置'; -$lang->kanban->setDoneFunction = '设置完成功能'; +$lang->kanban->performable = '设置完成功能'; $lang->kanban->doneFunction = '完成功能'; $lang->kanban->splitColumn = '新增子看板列'; $lang->kanban->createColumnOnLeft = '左侧新增看板列'; diff --git a/module/kanban/model.php b/module/kanban/model.php index 140289a6b0..67c02813c5 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -872,7 +872,7 @@ class kanbanModel extends model ->andWhere('type')->eq('common') ->fetchAll(); - $actions = array('editCard', 'finishCard', 'activeCard', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); + $actions = array('editCard', 'finishCard', 'activateCard', 'archiveCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard', 'sortCard'); $cardGroup = array(); foreach($cellList as $cell) { @@ -2533,7 +2533,7 @@ class kanbanModel extends model $actions .= "
    "; $actions .= " {$this->lang->kanban->fullScreen}"; - $printSettingBtn = (common::hasPriv('kanban', 'createRegion') or $printSetHeight or common::hasPriv('kanban', 'setDoneFunction') or common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete')); + $printSettingBtn = (common::hasPriv('kanban', 'createRegion') or $printSetHeight or common::hasPriv('kanban', 'performable') or common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete')); if($printSettingBtn) { @@ -2546,7 +2546,7 @@ class kanbanModel extends model $actions .= '
  • ' . html::a(helper::createLink('kanban', 'setLaneHeight', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->laneHeight, '', "class='iframe btn btn-link' data-width='$width'") . '
  • '; } - if(common::hasPriv('kanban', 'setDoneFunction')) $actions .= '
  • ' . html::a(helper::createLink('kanban', 'setDoneFunction', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->doneFunction, '', "class='iframe btn btn-link'") . '
  • '; + if(common::hasPriv('kanban', 'performable')) $actions .= '
  • ' . html::a(helper::createLink('kanban', 'performable', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->doneFunction, '', "class='iframe btn btn-link'") . '
  • '; $kanbanActions = ''; $attr = $kanban->status == 'closed' ? "disabled='disabled'" : ''; @@ -2555,7 +2555,7 @@ class kanbanModel extends model if(common::hasPriv('kanban', 'delete')) $kanbanActions .= '
  • ' . html::a(helper::createLink('kanban', 'delete', "kanbanID=$kanban->id"), '' . $this->lang->kanban->delete, 'hiddenwin', "class='btn btn-link'") . '
  • '; if($kanbanActions) { - $actions .= ((common::hasPriv('kanban', 'createRegion') or $printSetHeight or common::hasPriv('kanban', 'setDoneFunction')) and (common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete'))) ? "
    " . $kanbanActions : $kanbanActions; + $actions .= ((common::hasPriv('kanban', 'createRegion') or $printSetHeight or common::hasPriv('kanban', 'performable')) and (common::hasPriv('kanban', 'edit') or common::hasPriv('kanban', 'close') or common::hasPriv('kanban', 'delete'))) ? "
    " . $kanbanActions : $kanbanActions; } $actions .= ""; } diff --git a/module/kanban/view/setdonefunction.html.php b/module/kanban/view/setdonefunction.html.php deleted file mode 100644 index 869c57feba..0000000000 --- a/module/kanban/view/setdonefunction.html.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @package kanban - * @version $Id: setdonefunction.html.php 935 2022-01-1 14:20:24Z $ - * @link https://www.zentao.net - */ -?> - -
    -
    -
    -

    kanban->setDoneFunction;?>

    -
    -
    -
    kanbanspace->type;?>
    user->account, "class='form-control chosen'");?>user->account, "class='form-control chosen' multiple");?>
    From 6041f71d99b8f160492ee245edebec5a15e99944 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 21 Jan 2022 05:44:18 +0000 Subject: [PATCH 22/31] Adjust code. --- module/kanban/view/batchcreatecard.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/kanban/view/batchcreatecard.html.php b/module/kanban/view/batchcreatecard.html.php index 3312774cc2..ad3a37393a 100644 --- a/module/kanban/view/batchcreatecard.html.php +++ b/module/kanban/view/batchcreatecard.html.php @@ -33,8 +33,8 @@
    - - - - - - - -
    kanban->doneFunction;?>kanban->enableFinished, $kanban->performable));?>
    - -
    - -
    -
    - diff --git a/module/kanban/view/viewcard.html.php b/module/kanban/view/viewcard.html.php index 2d9b94fb30..663f2527ca 100644 --- a/module/kanban/view/viewcard.html.php +++ b/module/kanban/view/viewcard.html.php @@ -48,7 +48,7 @@ if($kanban->performable) { - if($card->status == 'done') common::printLink('kanban', 'activeCard', "cardID={$card->id}&kanbanID={$kanban->id}", '', '', "class='btn btn-link iframe' title='{$lang->kanban->activeCard}'", true, true); + if($card->status == 'done') common::printLink('kanban', 'activateCard', "cardID={$card->id}&kanbanID={$kanban->id}", '', '', "class='btn btn-link iframe' title='{$lang->kanban->activateCard}'", true, true); if($card->status == 'doing') common::printLink('kanban', 'finishCard', "cardID={$card->id}&kanbanID={$kanban->id}", '', '', "class='btn btn-link iframe' title='{$lang->kanban->finishCard}'", true, true); } From ecef85b7f7395871adca092598079e83d217e2b8 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 21 Jan 2022 13:54:33 +0800 Subject: [PATCH 25/31] * Add a file. --- module/kanban/view/performable.html.php | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 module/kanban/view/performable.html.php diff --git a/module/kanban/view/performable.html.php b/module/kanban/view/performable.html.php new file mode 100644 index 0000000000..f6391b1a8b --- /dev/null +++ b/module/kanban/view/performable.html.php @@ -0,0 +1,34 @@ + + * @package kanban + * @version $Id: performable.html.php 935 2022-01-1 14:20:24Z $ + * @link https://www.zentao.net + */ +?> + +
    +
    +
    +

    kanban->performable;?>

    +
    +
    + + + + + + + + +
    kanban->doneFunction;?>kanban->enableFinished, $kanban->performable));?>
    + +
    +
    +
    +
    + From a2477a59bf27c95f27e98ed11027a6d99b4792e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Fri, 21 Jan 2022 14:33:58 +0800 Subject: [PATCH 26/31] * Delete unused lang. --- module/block/lang/en.php | 19 ------------------- module/block/lang/zh-cn.php | 19 ------------------- module/block/view/dashboard.html.php | 4 ++-- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/module/block/lang/en.php b/module/block/lang/en.php index 28d45685d1..b0a9a555e3 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -106,25 +106,6 @@ $lang->block->spent = 'Has Been Spent'; $lang->block->budget = 'Budget'; $lang->block->left = 'Residuals'; -$lang->block->titleList['flowchart'] = 'Flowchart'; -$lang->block->titleList['statistic'] = 'Statistic'; -$lang->block->titleList['recentproject'] = 'Recent Project'; -$lang->block->titleList['assigntome'] = 'Assign To Me'; -$lang->block->titleList['projectteam'] = 'Project Team'; -$lang->block->titleList['project'] = 'Project'; -$lang->block->titleList['dynamic'] = 'Dynamic'; -$lang->block->titleList['list'] = 'List'; -$lang->block->titleList['contribute'] = 'Contribute'; -$lang->block->titleList['scrumoverview'] = 'Scrum Overview'; -$lang->block->titleList['scrumtest'] = 'Scrum Test'; -$lang->block->titleList['scrumlist'] = 'Scrum List'; -$lang->block->titleList['sprint'] = 'Sprint'; -$lang->block->titleList['projectdynamic'] = 'Project Dynamic'; -$lang->block->titleList['bug'] = 'Bug'; -$lang->block->titleList['case'] = 'Case'; -$lang->block->titleList['testtask'] = 'Testtask'; - - $lang->block->default['waterfall']['project']['3']['title'] = 'Plan Gantt Chart'; $lang->block->default['waterfall']['project']['3']['block'] = 'waterfallgantt'; $lang->block->default['waterfall']['project']['3']['source'] = 'project'; diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 3ca65ef783..e5d8deface 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -106,25 +106,6 @@ $lang->block->spent = '已花费'; $lang->block->budget = '预算'; $lang->block->left = '剩余'; -$lang->block->titleList['flowchart'] = '流程图'; -$lang->block->titleList['statistic'] = '项目统计'; -$lang->block->titleList['recentproject'] = '我近期参与的项目'; -$lang->block->titleList['assigntome'] = '待处理'; -$lang->block->titleList['projectteam'] = '项目人力投入'; -$lang->block->titleList['project'] = '项目列表'; -$lang->block->titleList['dynamic'] = '最新动态'; -$lang->block->titleList['list'] = '我的待办'; -$lang->block->titleList['contribute'] = '我的贡献'; -$lang->block->titleList['scrumoverview'] = '项目概况'; -$lang->block->titleList['scrumtest'] = '待测版本'; -$lang->block->titleList['scrumlist'] = '迭代列表'; -$lang->block->titleList['sprint'] = '迭代总览'; -$lang->block->titleList['projectdynamic'] = '最新动态'; -$lang->block->titleList['bug'] = '指派给我的Bug'; -$lang->block->titleList['case'] = '指派给我的用例'; -$lang->block->titleList['testtask'] = '待测版本列表'; - - $lang->block->default['waterfall']['project']['3']['title'] = "项目计划"; $lang->block->default['waterfall']['project']['3']['block'] = 'waterfallgantt'; $lang->block->default['waterfall']['project']['3']['source'] = 'project'; diff --git a/module/block/view/dashboard.html.php b/module/block/view/dashboard.html.php index 4390aa91e2..ccca29da24 100644 --- a/module/block/view/dashboard.html.php +++ b/module/block/view/dashboard.html.php @@ -35,7 +35,7 @@ $useGuest = $this->app->user->account == 'guest'; block != 'welcome');?>
    -
    block->titleList, $block->block);?>
    +
    title;?>