From 4c5ff19a61734be73b86edf5ee8232027596d238 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 22 Jun 2022 17:01:39 +0800 Subject: [PATCH] * Finish task #58288. --- module/execution/control.php | 7 ++ module/execution/css/create.css | 3 + module/execution/css/edit.css | 3 + module/execution/model.php | 2 +- module/execution/view/edit.html.php | 4 +- module/execution/view/kanban.html.php | 6 +- module/execution/view/taskkanban.html.php | 9 +- module/kanban/control.php | 125 +-------------------- module/kanban/css/import.css | 2 - module/kanban/css/performable.css | 1 - module/kanban/css/setlaneheight.css | 1 - module/kanban/js/import.js | 33 ------ module/kanban/js/setlaneheight.js | 17 --- module/kanban/model.php | 63 +---------- module/kanban/view/enablearchived.html.php | 35 ------ module/kanban/view/import.html.php | 53 --------- module/kanban/view/performable.html.php | 34 ------ module/kanban/view/setcolumnwidth.html.php | 35 ------ module/kanban/view/setlaneheight.html.php | 42 ------- 19 files changed, 22 insertions(+), 453 deletions(-) delete mode 100644 module/kanban/css/import.css delete mode 100644 module/kanban/css/performable.css delete mode 100644 module/kanban/css/setlaneheight.css delete mode 100644 module/kanban/js/import.js delete mode 100644 module/kanban/js/setlaneheight.js delete mode 100644 module/kanban/view/enablearchived.html.php delete mode 100644 module/kanban/view/import.html.php delete mode 100644 module/kanban/view/performable.html.php delete mode 100644 module/kanban/view/setcolumnwidth.html.php delete mode 100644 module/kanban/view/setlaneheight.html.php diff --git a/module/execution/control.php b/module/execution/control.php index 4afc3e895a..d6c827e1a6 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1654,6 +1654,13 @@ class execution extends control if($_POST['status'] == 'doing') $this->loadModel('common')->syncPPEStatus($executionID); if($execution->type == 'kanban') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + + /* If link from no head then reload. */ + if(isonlybody()) + { + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "executionID=$executionID"))); } diff --git a/module/execution/css/create.css b/module/execution/css/create.css index bc275a4497..2d26e8f6b8 100644 --- a/module/execution/css/create.css +++ b/module/execution/css/create.css @@ -24,3 +24,6 @@ #productsBox .row .col-sm-4 {padding-right: 13px;} #plansBox .row {display: inline-table; width: 102%;} #plansBox .row .col-sm-4 {display: inline-block; float: none; padding-right: 13px;} + +#mainContent .laneHeightBox .radio-inline+.radio-inline {margin-left: 20px;} +#mainContent .laneHeightBox .tip {color: #999;} diff --git a/module/execution/css/edit.css b/module/execution/css/edit.css index 7d3767b7d3..71c7410e28 100644 --- a/module/execution/css/edit.css +++ b/module/execution/css/edit.css @@ -4,3 +4,6 @@ #plansBox .row .col-sm-4 {display: inline-block; float: none;} .chosen-container.chosen-highlight-selected .disabled-result.result-selected {background: none;} + +#mainContent .laneHeightBox .radio-inline+.radio-inline, #mainContent .importBox .radio-inline+.radio-inline {margin-left: 20px;} +#mainContent .laneHeightBox .tip {color: #999;} diff --git a/module/execution/model.php b/module/execution/model.php index 6787b74c93..7d0456d6ec 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -502,7 +502,7 @@ class executionModel extends model if(isset($_POST['heightType']) and $this->post->heightType == 'custom') { - if(!preg_match("/^-?\d+$/", $sprint->displayCards) or $sprint->displayCards < 3) + if(!preg_match("/^-?\d+$/", $execution->displayCards) or $execution->displayCards < 3) { $this->app->loadLang('kanban'); dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt; diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 5bdbe1ba99..69ffc1b56c 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -195,12 +195,12 @@ kanban->columnWidth;?> - kanbancolumn->fluidBoardList, $execution->fluidBoard));?> + kanbancolumn->fluidBoardList, $execution->fluidBoard));?> 1):?> kanban->laneHeight;?> - kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?> + kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?> kanban->cardCount;?> diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 04093d163c..3ac51f7c60 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -149,7 +149,7 @@ js::set('priv', echo html::a('javascript:fullScreen()', " " . $lang->kanban->fullScreen, '', "class='btn btn-link'"); $actions = ''; $printCreateRegion = (common::hasPriv('kanban', 'createRegion') and $groupBy == 'default'); - $printSettingBtn = ($printCreateRegion or (common::hasPriv('kanban', 'setLaneHeight')) or (common::hasPriv('kanban', 'setColumnWidth')) or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); + $printSettingBtn = ($printCreateRegion or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); if($printSettingBtn) { @@ -157,8 +157,6 @@ js::set('priv', $actions .= ""; } diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 2040842ec3..eb3eb87cf8 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -69,13 +69,8 @@ echo "'; ?> diff --git a/module/kanban/control.php b/module/kanban/control.php index 53a1306728..b157a89e31 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -274,6 +274,7 @@ class kanban extends control $this->view->displayCards = $kanban->displayCards ? $kanban->displayCards : ''; $this->view->enableImport = empty($kanban->object) ? 'off' : 'on'; $this->view->importObjects = empty($kanban->object) ? array() : explode(',', $kanban->object); + a($this->view->laneCount); $this->display(); } @@ -601,60 +602,6 @@ class kanban extends control return print(json_encode($kanbanGroup)); } - /** - * Set lane height. - * - * @param int $kanbanID - * @param string $from kanban|execution - * @access public - * @return void - */ - public function setLaneHeight($kanbanID, $from = 'kanban') - { - if(!empty($_POST)) - { - $this->kanban->setLaneHeight($kanbanID, $from); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - $kanban = $from == 'execution' ? $this->loadModel('execution')->getByID($kanbanID) : $this->kanban->getByID($kanbanID); - if($from == 'execution') $this->lang->kanbanlane->heightTypeList['auto'] = $this->lang->kanbanlane->heightByCard; - - $this->view->heightType = $kanban->displayCards > 2 ? 'custom' : 'auto'; - $this->view->displayCards = $kanban->displayCards ? $kanban->displayCards : ''; - - $this->display(); - } - - /** - * Set column width. - * - * @param int $kanbanID - * @param string $from kanban|execution - * @access public - * @return void - */ - public function setColumnWidth($kanbanID, $from = 'kanban') - { - if(!empty($_POST)) - { - $this->kanban->setColumnWidth($kanbanID, $from); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - $kanban = $from == 'execution' ? $this->loadModel('execution')->getByID($kanbanID) : $this->kanban->getByID($kanbanID); - - $this->view->kanban = $kanban; - - $this->display(); - } - /** * Delete a lane. * @@ -1695,50 +1642,6 @@ class kanban extends control $this->display(); } - /** - * Setup done function. - * - * @param int $kanbanID - * @access public - * @return void - */ - public function performable($kanbanID) - { - if(!empty($_POST)) - { - $this->dao->update(TABLE_KANBAN)->set('performable')->eq($_POST['performable'])->exec(); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - $this->view->kanban = $this->kanban->getByID($kanbanID); - - $this->display(); - } - - /** - * Set archived. - * - * @param int $kanbanID - * @access public - * @return void - */ - public function enableArchived($kanbanID) - { - if(!empty($_POST)) - { - $this->dao->update(TABLE_KANBAN)->set('archived')->eq($_POST['archived'])->exec(); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - $this->view->kanban = $this->kanban->getByID($kanbanID); - - $this->display(); - } - /** * AJAX: Update the cards sorting of the lane column. * @@ -1944,30 +1847,4 @@ class kanban extends control return print(html::select($field, $lanes, '', "class='form-control'")); } - - /** - * Import. - * - * @param int $kanbanID - * @access public - * @return void - */ - public function import($kanbanID) - { - if(!empty($_POST)) - { - $this->kanban->import($kanbanID); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - } - - $kanban = $this->kanban->getByID($kanbanID); - - $this->view->enableImport = empty($kanban->object) ? 'off' : 'on'; - $this->view->importObjects = empty($kanban->object) ? array() : explode(',', $kanban->object); - - $this->display(); - } } diff --git a/module/kanban/css/import.css b/module/kanban/css/import.css deleted file mode 100644 index b9a5c7ac76..0000000000 --- a/module/kanban/css/import.css +++ /dev/null @@ -1,2 +0,0 @@ -#importForm .checkbox-primary:not(:first-child) {margin-left: 10px;} -#importForm .checkbox-primary {display: inline-block} diff --git a/module/kanban/css/performable.css b/module/kanban/css/performable.css deleted file mode 100644 index 9680e099f3..0000000000 --- a/module/kanban/css/performable.css +++ /dev/null @@ -1 +0,0 @@ -#c-title {width: 130px;} diff --git a/module/kanban/css/setlaneheight.css b/module/kanban/css/setlaneheight.css deleted file mode 100644 index cb5eed3d3a..0000000000 --- a/module/kanban/css/setlaneheight.css +++ /dev/null @@ -1 +0,0 @@ -#c-name {width: 90px} diff --git a/module/kanban/js/import.js b/module/kanban/js/import.js deleted file mode 100644 index 1178f973b7..0000000000 --- a/module/kanban/js/import.js +++ /dev/null @@ -1,33 +0,0 @@ -$(function() -{ - if(enableImport == 'off') $("input[name^='importObjectList']").attr('disabled', 'disabled'); - - $("input[name='import']").change(function() - { - if($(this).val() == 'off') - { - $("input[name^='importObjectList']").attr('disabled', 'disabled'); - } - else - { - $("input[name^='importObjectList']").removeAttr('disabled'); - } - }) - - $("input[name^='importObjectList']").change(function() - { - if($("input:checked[name^=importObjectList]").length != 0 && !$('#emptyTip').is('.hidden')) $('#emptyTip').addClass('hidden'); - }) - - $('#submit').click(function() - { - var enableImport = $("input:checked[name='import']").val(); - var objectListLength = $("input:checked[name^=importObjectList]").length; - - if(enableImport == 'on' && objectListLength == 0 && vision != 'lite') - { - $('#emptyTip').removeClass('hidden'); - return false; - } - }) -}) diff --git a/module/kanban/js/setlaneheight.js b/module/kanban/js/setlaneheight.js deleted file mode 100644 index 4f37eb4763..0000000000 --- a/module/kanban/js/setlaneheight.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Set card count. - * - * @param string $heightType - * @access public - * @return void - */ -function setCardCount(heightType) -{ - heightType != 'custom' ? $('#cardBox').addClass('hidden') : $('#cardBox').removeClass('hidden'); -} - -$(function() -{ - var heightType = $("[name='heightType']:checked").val(); - setCardCount(heightType); -}) diff --git a/module/kanban/model.php b/module/kanban/model.php index a875552cf6..c508a77b99 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3013,52 +3013,6 @@ class kanbanModel extends model return dao::isError(); } - /** - * Set lane height. - * - * @param int $kanbanID - * @param string $from kanban|execution - * @access public - * @return bool - */ - public function setLaneHeight($kanbanID, $from = 'kanban') - { - $kanbanID = (int)$kanbanID; - $kanban = fixer::input('post') - ->setIF($this->post->heightType == 'auto', 'displayCards', 0) - ->get(); - - if($kanban->heightType == 'custom') - { - if(!preg_match("/^-?\d+$/", $kanban->displayCards) or $kanban->displayCards < 3) - { - dao::$errors['displayCards'] = $this->lang->kanbanlane->error->mustBeInt; - return false; - } - } - - $table = $this->config->objectTables[$from]; - $this->dao->update($table)->set('displayCards')->eq((int)$kanban->displayCards)->where('id')->eq($kanbanID)->exec(); - - if(dao::isError()) return false; - } - - /** - * Set column width. - * - * @param int $kanbanID - * @param string $from - * @access public - * @return bool|void - */ - public function setColumnWidth($kanbanID, $from = 'kanban') - { - $table = $this->config->objectTables[$from]; - $this->dao->update($table)->set('fluidBoard')->eq($this->post->fluidBoard)->where('id')->eq($kanbanID)->exec(); - - if(dao::isError()) return false; - } - /** * Set kanban headerActions. * @@ -3839,21 +3793,6 @@ class kanbanModel extends model return true; } - /** - * Import. - * - * @param int $kanbanID - * @access public - * @return void - */ - public function import($kanbanID) - { - $importObjects = $_POST['import'] == 'off' ? array() : $_POST['importObjectList']; - $importObjectList = implode(',', $importObjects); - - $this->dao->update(TABLE_KANBAN)->set('object')->eq($importObjectList)->where('id')->eq($kanbanID)->exec(); - } - /** * Get kanban lane count. * @@ -3864,7 +3803,7 @@ class kanbanModel extends model */ public function getLaneCount($kanbanID, $type = 'common') { - if($type == 'common ' or $type == 'kanban') + if($type == 'common' or $type == 'kanban') { return $this->dao->select('COUNT(t2.id) as count')->from(TABLE_KANBANREGION)->alias('t1') ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.id=t2.region') diff --git a/module/kanban/view/enablearchived.html.php b/module/kanban/view/enablearchived.html.php deleted file mode 100644 index 0d352fbae5..0000000000 --- a/module/kanban/view/enablearchived.html.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @package kanban - * @version $Id: enableArchived.html.php 935 2022-01-21 11:02:24Z $ - * @link https://www.zentao.net - */ -?> - -
-
-
-

kanban->enableArchived;?>

-
-
- - - - - - - - -
kanban->archive;?>kanban->archiveList, $kanban->archived));?>
- -
-
-
-
- - diff --git a/module/kanban/view/import.html.php b/module/kanban/view/import.html.php deleted file mode 100644 index c97939dc0b..0000000000 --- a/module/kanban/view/import.html.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @package kanban - * @version $Id: import.html.php 935 2022-01-19 14:15:24Z hufangzhou@easycorp.ltd $ - * @link https://www.zentao.net - */ -?> - - - -config->vision);?> -
-
-
-

- " . $lang->kanban->import . '';?> -

-
-
- - - - - - - - - - - - - - -
- -
- -
kanban->importObjectList, $importObjects);?>
-
-
-
- diff --git a/module/kanban/view/performable.html.php b/module/kanban/view/performable.html.php deleted file mode 100644 index 75e7a595c9..0000000000 --- a/module/kanban/view/performable.html.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @package kanban - * @version $Id: performable.html.php 935 2022-01-1 14:20:24Z $ - * @link https://www.zentao.net - */ -?> - -
-
-
-

kanban->performable;?>

-
-
- - - - - - - - -
kanban->manageProgress;?>kanban->enableList, $kanban->performable));?>
- -
-
-
-
- diff --git a/module/kanban/view/setcolumnwidth.html.php b/module/kanban/view/setcolumnwidth.html.php deleted file mode 100644 index ef6e49c376..0000000000 --- a/module/kanban/view/setcolumnwidth.html.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @package kanban - * @version $Id: setlaneheight.html.php 935 2022-01-11 10:49:24Z $ - * @link https://www.zentao.net - */ -?> - -app->getClientLang() == 'en' ? 'w-120px' : 'w-80px';?> -
-
-
-

kanban->setColumnWidth;?>

-
-
- - - - - - - - -
kanban->columnWidth;?>kanbancolumn->fluidBoardList, $kanban->fluidBoard));?>
- -
-
-
-
- diff --git a/module/kanban/view/setlaneheight.html.php b/module/kanban/view/setlaneheight.html.php deleted file mode 100644 index 16e895a740..0000000000 --- a/module/kanban/view/setlaneheight.html.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @package kanban - * @version $Id: setlaneheight.html.php 935 2022-01-11 10:49:24Z $ - * @link https://www.zentao.net - */ -?> - - -
-
-
-

kanban->setLaneHeight;?>

-
-
- - - - - - - - - - - - -
kanban->laneHeight;?>kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?>
- -
-
-
-
-