From ebf47c2dc13df0211322729a34e28cec4cdd98c7 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 13 Apr 2023 15:15:06 +0800 Subject: [PATCH] - Delete the privilege of kanban-laneMove. --- module/execution/js/taskkanban.js | 4 ---- module/execution/view/taskkanban.html.php | 1 - module/group/lang/resource.php | 2 -- module/kanban/control.php | 24 -------------------- module/kanban/lang/de.php | 1 - module/kanban/lang/en.php | 1 - module/kanban/lang/fr.php | 1 - module/kanban/lang/zh-cn.php | 1 - module/kanban/model.php | 27 ----------------------- 9 files changed, 62 deletions(-) diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 487837e75a..144f326a2f 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -999,10 +999,6 @@ function createLaneMenu(options) var items = []; if(priv.canSetLane) items.push({label: kanbanLang.setLane, icon: 'edit', url: $.createLink('kanban', 'setLane', 'lane=' + lane.laneID + '&executionID=' + executionID + '&from=execution'), className: 'iframe'}); - if(priv.canMoveLane) items.push( - {label: kanbanLang.moveUp, icon: 'arrow-up', url: $.createLink('kanban', 'laneMove', 'executionID=' + executionID + '¤tLane=' + lane.id + '&targetLane=' + upTargetKanban), className: 'iframe', disabled: !$kanban.prev('.kanban').length}, - {label: kanbanLang.moveDown, icon: 'arrow-down', url: $.createLink('kanban', 'laneMove', 'executionID=' + executionID + '¤tLane=' + lane.id + '&targetLane=' + downTargetKanban), className: 'iframe', disabled: !$kanban.next('.kanban').length} - ); var bounds = options.$trigger[0].getBoundingClientRect(); items.$options = {x: bounds.right, y: bounds.top}; diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 764e74419a..1587fff5bb 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -189,7 +189,6 @@ js::set('priv', 'canEditName' => common::hasPriv('kanban', 'setColumn'), 'canSetWIP' => common::hasPriv('kanban', 'setWIP'), 'canSetLane' => common::hasPriv('kanban', 'setLane'), - 'canMoveLane' => common::hasPriv('kanban', 'laneMove'), 'canSortCards' => common::hasPriv('kanban', 'cardsSort'), 'canCreateTask' => $canCreateTask, 'canBatchCreateTask' => $canBatchCreateTask, diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 0b235030ec..a25b9c19ad 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -737,7 +737,6 @@ $lang->resource->kanban->assigntoCard = 'assigntoCard'; $lang->resource->kanban->deleteCard = 'deleteCard'; $lang->resource->kanban->moveCard = 'moveCard'; $lang->resource->kanban->setCardColor = 'setCardColor'; -$lang->resource->kanban->laneMove = 'laneMove'; $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn'; $lang->resource->kanban->viewArchivedCard = 'viewArchivedCard'; $lang->resource->kanban->restoreCard = 'restoreCard'; @@ -779,7 +778,6 @@ $lang->kanban->methodOrder[165] = 'deleteCard'; $lang->kanban->methodOrder[170] = 'assigntoCard'; $lang->kanban->methodOrder[175] = 'moveCard'; $lang->kanban->methodOrder[180] = 'setCardColor'; -$lang->kanban->methodOrder[185] = 'laneMove'; $lang->kanban->methodorder[190] = 'cardsSort'; $lang->kanban->methodOrder[195] = 'viewArchivedColumn'; $lang->kanban->methodorder[200] = 'viewArchivedCard'; diff --git a/module/kanban/control.php b/module/kanban/control.php index 2db3be55cf..0959f660c8 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -1923,30 +1923,6 @@ class kanban extends control echo json_encode($kanbanGroup); } - /** - * Change the order through the lane move up and down. - * - * @param int $executionID - * @param string $currentType - * @param string $targetType - * @access public - * @return void - */ - public function laneMove($executionID, $currentType, $targetType) - { - if(empty($targetType)) return false; - - $this->kanban->updateLaneOrder($executionID, $currentType, $targetType); - - if(!dao::isError()) - { - $laneID = $this->dao->select('id')->from(TABLE_KANBANLANE)->where('execution')->eq($executionID)->andWhere('type')->eq($currentType)->fetch('id'); - $this->loadModel('action')->create('kanbanlane', $laneID, 'Moved'); - } - - echo js::locate($this->createLink('execution', 'kanban', 'executionID=' . $executionID . '&type=all'), 'parent'); - } - /** * Ajax get contact users. * diff --git a/module/kanban/lang/de.php b/module/kanban/lang/de.php index 773954a876..dacbd7059d 100644 --- a/module/kanban/lang/de.php +++ b/module/kanban/lang/de.php @@ -196,7 +196,6 @@ $lang->kanban->columnName = 'Column Name'; $lang->kanban->columnColor = 'Column Color'; $lang->kanban->moveUp = 'Swimlane Up'; $lang->kanban->moveDown = 'Swimlane Down'; -$lang->kanban->laneMove = 'Swimlane Move'; $lang->kanban->laneGroup = 'Lane Group'; $lang->kanban->cardsSort = 'Cards Sortting'; $lang->kanban->more = 'More'; diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 2841e357b5..56406a02c2 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -196,7 +196,6 @@ $lang->kanban->columnName = 'Column Name'; $lang->kanban->columnColor = 'Column Color'; $lang->kanban->moveUp = 'Swimlane Up'; $lang->kanban->moveDown = 'Swimlane Down'; -$lang->kanban->laneMove = 'Swimlane Move'; $lang->kanban->laneGroup = 'Lane Group'; $lang->kanban->cardsSort = 'Cards Sortting'; $lang->kanban->more = 'More'; diff --git a/module/kanban/lang/fr.php b/module/kanban/lang/fr.php index 68877a9b15..f1f51a27aa 100644 --- a/module/kanban/lang/fr.php +++ b/module/kanban/lang/fr.php @@ -196,7 +196,6 @@ $lang->kanban->columnName = 'Column Name'; $lang->kanban->columnColor = 'Column Color'; $lang->kanban->moveUp = 'Swimlane Up'; $lang->kanban->moveDown = 'Swimlane Down'; -$lang->kanban->laneMove = 'Swimlane Move'; $lang->kanban->laneGroup = 'Lane Group'; $lang->kanban->cardsSort = 'Cards Sortting'; $lang->kanban->more = 'More'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 92903ef587..4a9c971b57 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -196,7 +196,6 @@ $lang->kanban->columnName = '看板列名称'; $lang->kanban->columnColor = '看板列颜色'; $lang->kanban->moveUp = '泳道上移'; $lang->kanban->moveDown = '泳道下移'; -$lang->kanban->laneMove = '泳道移动'; $lang->kanban->laneGroup = '泳道分组'; $lang->kanban->cardsSort = '卡片排序'; $lang->kanban->more = '更多'; diff --git a/module/kanban/model.php b/module/kanban/model.php index fd8051f012..173956ff1b 100755 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3050,33 +3050,6 @@ class kanbanModel extends model return $changes; } - /** - * Change the order through the lane move up and down. - * - * @param int $executionID - * @param string $currentType - * @param string $targetType - * @access public - * @return void - */ - public function updateLaneOrder($executionID, $currentType, $targetType) - { - $orderList = $this->dao->select('id,type,`order`')->from(TABLE_KANBANLANE) - ->where('execution')->eq($executionID) - ->andWhere('type')->in(array($currentType, $targetType)) - ->andWhere('groupby')->eq('') - ->fetchAll('type'); - - $this->dao->update(TABLE_KANBANLANE)->set('`order`')->eq($orderList[$targetType]->order) - ->where('id')->eq($orderList[$currentType]->id) - ->andWhere('groupby')->eq('') - ->exec(); - - $this->dao->update(TABLE_KANBANLANE)->set('`order`')->eq($orderList[$currentType]->order) - ->where('id')->eq($orderList[$targetType]->id) - ->andWhere('groupby')->eq('') - ->exec(); - } /** * Activate a card. *