* Fix bug and add sql file.

This commit is contained in:
liumengyi
2022-01-19 13:13:08 +08:00
parent fdac2458cb
commit cca28df709
3 changed files with 9 additions and 4 deletions
+2
View File
@@ -0,0 +1,2 @@
ALTER TABLE `zt_kanbanspace` ADD `type` varchar(50) NOT NULL AFTER `name`;
UPDATE `zt_kanbanspace` SET `type` = 'cooperation';
+1
View File
@@ -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,
+6 -4
View File
@@ -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;