From 9c56619418d7390b3179089f0c639ab05f52c8ec Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Mon, 13 Dec 2021 09:06:55 +0800 Subject: [PATCH 1/2] *Finish task 45822. --- module/kanban/control.php | 6 ++++-- module/kanban/model.php | 3 +-- module/kanban/view/createlane.html.php | 6 +----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index 6f979f87d2..13680a9e45 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -209,9 +209,11 @@ class kanban extends control if(!empty($_POST)) { $laneID = $this->kanban->createLane($kanbanID, $regionID, $lane = null); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(dao::isError()) die(js::error(dao::getError())); + + $this->loadModel('action')->create('kanbanLane', $laneID, 'created'); + die(js::reload('parent.parent')); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'callback' => 'closeModalAndUpdateKanban', 'callback_params' => $regionID)); } $this->view->lanes = $this->kanban->getLanePairsByRegion($regionID); diff --git a/module/kanban/model.php b/module/kanban/model.php index d5ffbcd80f..e8b2adbaf8 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -826,7 +826,6 @@ class kanbanModel extends model $this->dao->insert(TABLE_KANBANLANE)->data($lane, $skip = 'mode,otherLane') ->batchCheck($this->config->kanban->require->createlane, 'notempty') ->autoCheck() - ->checkIF(!empty($lane->name), 'name', 'unique', "`type`='common'") ->exec(); if(dao::isError()) return false; @@ -835,7 +834,7 @@ class kanbanModel extends model return $laneID; } - + /* * Create a kanban. * diff --git a/module/kanban/view/createlane.html.php b/module/kanban/view/createlane.html.php index 3a5206b9de..659b03e315 100644 --- a/module/kanban/view/createlane.html.php +++ b/module/kanban/view/createlane.html.php @@ -32,11 +32,7 @@ - - - - cancel);?> - + From 3dde658da2afdcbd782327d2241f6f59f5bc5cd3 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Mon, 13 Dec 2021 09:50:32 +0800 Subject: [PATCH 2/2] *Finish task #45822. --- module/kanban/control.php | 9 ++++----- module/kanban/view/createlane.html.php | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/module/kanban/control.php b/module/kanban/control.php index 13680a9e45..f7ff435a1e 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -209,11 +209,10 @@ class kanban extends control if(!empty($_POST)) { $laneID = $this->kanban->createLane($kanbanID, $regionID, $lane = null); - if(dao::isError()) die(js::error(dao::getError())); - $this->loadModel('action')->create('kanbanLane', $laneID, 'created'); + if(dao::isError()) die(js::error(dao::getError())); + die(js::reload('parent.parent')); - } $this->view->lanes = $this->kanban->getLanePairsByRegion($regionID); @@ -237,9 +236,9 @@ class kanban extends control $order = $position == 'left' ? $column->order : $column->order + 1; $columnID = $this->kanban->createColumn($column->region, null, $order); $this->loadModel('action')->create('kanbanColumn', $columnID, 'Created'); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(dao::isError()) die(js::error(dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent', 'callback' => 'closeModalAndUpdateKanban', 'callback_params' => $column->region)); + die(js::reload('parent.parent')); } $this->view->title = $this->lang->kanban->createColumn; diff --git a/module/kanban/view/createlane.html.php b/module/kanban/view/createlane.html.php index 659b03e315..72637b6004 100644 --- a/module/kanban/view/createlane.html.php +++ b/module/kanban/view/createlane.html.php @@ -32,7 +32,10 @@ - + + + cancel, "data-dismiss='modal'", 'btn btn-wide');?> +