diff --git a/db/update16.2.sql b/db/update16.2.sql new file mode 100644 index 0000000000..129e637289 --- /dev/null +++ b/db/update16.2.sql @@ -0,0 +1,2 @@ +ALTER TABLE `zt_kanbanspace` ADD `type` varchar(50) NOT NULL AFTER `name`; +UPDATE `zt_kanbanspace` SET `type` = 'cooperation'; diff --git a/db/zentao.sql b/db/zentao.sql index 6d76a6175f..96d30fa663 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -648,6 +648,7 @@ CREATE TABLE IF NOT EXISTS `zt_job` ( CREATE TABLE `zt_kanbanspace` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, + `type` varchar(50) NOT NULL, `owner` varchar(30) NOT NULL, `team` text NOT NULL, `desc` text NOT NULL, diff --git a/module/execution/model.php b/module/execution/model.php index 69cc47c87b..dc5a6dd30b 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -302,13 +302,14 @@ class executionModel extends model if($project) $type = zget($this->config->execution->modelList, $project->model, 'sprint'); /* If the execution model is a stage, determine whether the product is linked. */ - if($type == 'stage' and empty(array_filter($this->post->products))) + $products = array_filter($this->post->products); + if($type == 'stage' and empty($products)) { dao::$errors['message'][] = $this->lang->execution->noLinkProduct; return false; } - if($type == 'kanban' and empty(array_filter($this->post->products))) + if($type == 'kanban' and empty($products)) { dao::$errors['message'][] = $this->lang->execution->kanbanNoLinkProduct; return false; @@ -470,13 +471,14 @@ class executionModel extends model return false; } - if($oldExecution->type == 'stage' and empty(array_filter($this->post->products))) + $products = array_filter($this->post->products); + if($oldExecution->type == 'stage' and empty($products)) { dao::$errors['message'][] = $this->lang->execution->noLinkProduct; return false; } - if($oldExecution->type == 'kanban' and empty(array_filter($this->post->products))) + if($oldExecution->type == 'kanban' and empty($products)) { dao::$errors['message'][] = $this->lang->execution->kanbanNoLinkProduct; return false;