From c0ef49273f08e08330a6f897fad364d4493c2a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 1 Nov 2022 13:30:03 +0800 Subject: [PATCH 01/19] * Add db and define to 17-7 --- config/zentaopms.php | 1 + db/update17.7.sql | 13 +++++++++++++ module/index/a.html.php | 0 3 files changed, 14 insertions(+) create mode 100644 db/update17.7.sql create mode 100644 module/index/a.html.php diff --git a/config/zentaopms.php b/config/zentaopms.php index f19d560b09..248cb89191 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -340,6 +340,7 @@ if(!defined('TABLE_SEARCHDICT')) define('TABLE_SEARCHDICT', $config->db->prefi define('TABLE_CHART', '`' . $config->db->prefix . 'chart`'); define('TABLE_DASHBOARD', '`' . $config->db->prefix . 'dashboard`'); define('TABLE_DATASET', '`' . $config->db->prefix . 'dataset`'); +define('TABLE_DIMENSION', '`' . $config->db->prefix . 'dimension`'); $config->objectTables['product'] = TABLE_PRODUCT; $config->objectTables['productplan'] = TABLE_PRODUCTPLAN; diff --git a/db/update17.7.sql b/db/update17.7.sql new file mode 100644 index 0000000000..6c365140fa --- /dev/null +++ b/db/update17.7.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS `zt_dimension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `code` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/module/index/a.html.php b/module/index/a.html.php new file mode 100644 index 0000000000..e69de29bb2 From c599d7fc1876442dea0a6c51af36151f4a076ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 1 Nov 2022 13:30:51 +0800 Subject: [PATCH 02/19] * Delete unused file. --- module/index/a.html.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 module/index/a.html.php diff --git a/module/index/a.html.php b/module/index/a.html.php deleted file mode 100644 index e69de29bb2..0000000000 From d93ac61f69a065af8a4abc90f71516cd3250e613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 1 Nov 2022 13:34:29 +0800 Subject: [PATCH 03/19] * Add sql to zentao. --- db/zentao.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/db/zentao.sql b/db/zentao.sql index 5e2f79f431..8c11328b20 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -7545,6 +7545,20 @@ CREATE TABLE IF NOT EXISTS `zt_deployscope` ( `remove` text NOT NULL, `add` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_dimension`; +CREATE TABLE IF NOT EXISTS `zt_dimension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `code` (`code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_vm`; CREATE TABLE IF NOT EXISTS `zt_vm` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, From ca70d4d63c877ee8954c878c85fd431e7610316f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 1 Nov 2022 14:20:57 +0800 Subject: [PATCH 04/19] * Finish task #74322, #74326. --- db/update17.7.sql | 13 +++++++++++++ module/tree/control.php | 1 + module/tree/lang/de.php | 1 + module/tree/lang/en.php | 1 + module/tree/lang/fr.php | 1 + module/tree/lang/zh-cn.php | 1 + 6 files changed, 18 insertions(+) create mode 100644 db/update17.7.sql diff --git a/db/update17.7.sql b/db/update17.7.sql new file mode 100644 index 0000000000..6203daef55 --- /dev/null +++ b/db/update17.7.sql @@ -0,0 +1,13 @@ +ALTER TABLE `zt_chart` ADD `group` mediumint(8) unsigned NOT NULL default '0' AFTER `type`; +ALTER TABLE `zt_chart` MODIFY COLUMN `desc` text NOT NULL; +ALTER TABLE `zt_chart` ADD `editedBy` varchar(30) NOT NULL AFTER `createdDate`; +ALTER TABLE `zt_chart` ADD `editedDate` datetime NOT NULL AFTER `editedBy`; + +INSERT INTO `zt_module` (`company`, `root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `owner`, `collector`, `short`, `deleted`) VALUES +(0, 0, 0, '产品', 0, ',0,', 1, 10, 'bi', '', '', '', '0'), +(0, 0, 0, '项目', 0, ',0,', 1, 20, 'bi', '', '', '', '0'), +(0, 0, 0, '测试', 0, ',0,', 1, 30, 'bi', '', '', '', '0'), +(0, 0, 0, '组织', 0, ',0,', 1, 40, 'bi', '', '', '', '0'); + +UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); +UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); diff --git a/module/tree/control.php b/module/tree/control.php index 49ac28269b..d26b24104f 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -486,6 +486,7 @@ class tree extends control if($module->type == 'doc') $confirmLang = $this->lang->tree->confirmDeleteMenu; if($module->type == 'line') $confirmLang = $this->lang->tree->confirmDeleteLine; if($module->type == 'host') $confirmLang = $this->lang->tree->confirmDeleteHost; + if($module->type == 'bi') $confirmLang = $this->lang->tree->confirmDeleteGroup; die(js::confirm($confirmLang, $this->createLink('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=yes"))); } else diff --git a/module/tree/lang/de.php b/module/tree/lang/de.php index 873170ee81..4b77b51949 100755 --- a/module/tree/lang/de.php +++ b/module/tree/lang/de.php @@ -43,6 +43,7 @@ $lang->tree->confirmDelete = 'Do you want to delete this module and its c $lang->tree->confirmDeleteMenu = 'Do you want to delete this menu and its child menus?'; $lang->tree->confirmDelCategory = 'Möchten Sie diese Kategorie und ihre Kinderkategorien löschen?'; $lang->tree->confirmDeleteLine = "Do you want to delete this {$lang->productCommon} line?"; +$lang->tree->confirmDeleteGroup = 'Do you want to delete this group and its child groups?'; $lang->tree->confirmRoot = "Any changes to the {$lang->productCommon} will change the stories, bugs, cases of {$lang->productCommon} it belongs to, as well as the linkage of {$lang->executionCommon} and {$lang->productCommon}, which is dangerous. Do you want to change it?"; $lang->tree->confirmRoot4Doc = "Any changes to the library will change the document of library it belongs to, which is dangerous. Do you want to change it?"; $lang->tree->noSubmodule = "There are no copyable submodules under the current module!"; diff --git a/module/tree/lang/en.php b/module/tree/lang/en.php index 611025a4d0..9bbe279655 100755 --- a/module/tree/lang/en.php +++ b/module/tree/lang/en.php @@ -43,6 +43,7 @@ $lang->tree->confirmDelete = 'Do you want to delete this module and its c $lang->tree->confirmDeleteMenu = 'Do you want to delete this menu and its child menus?'; $lang->tree->confirmDelCategory = 'Do you want to delete this category and its child categories?'; $lang->tree->confirmDeleteLine = "Do you want to delete this {$lang->productCommon} line?"; +$lang->tree->confirmDeleteGroup = 'Do you want to delete this group and its child groups?'; $lang->tree->confirmRoot = "Any changes to the {$lang->productCommon} will change the stories, bugs, cases of {$lang->productCommon} it belongs to, as well as the linkage of {$lang->executionCommon} and {$lang->productCommon}, which is dangerous. Do you want to change it?"; $lang->tree->confirmRoot4Doc = "Any changes to the library will change the document of library it belongs to, which is dangerous. Do you want to change it?"; $lang->tree->noSubmodule = "There are no copyable submodules under the current module!"; diff --git a/module/tree/lang/fr.php b/module/tree/lang/fr.php index 3d5f6bb04c..77d1df5655 100755 --- a/module/tree/lang/fr.php +++ b/module/tree/lang/fr.php @@ -42,6 +42,7 @@ $lang->tree->addChild = "Ajout Sous-Module"; $lang->tree->confirmDelete = 'Voulez-vous supprimer ce module et tous ses sous-modules ?'; $lang->tree->confirmDeleteMenu = 'Do you want to delete this menu and its child menus?'; $lang->tree->confirmDelCategory = 'Voulez-vous supprimer cette catégorie et ses sous-catégories?'; +$lang->tree->confirmDeleteGroup = 'Do you want to delete this group and its child groups?'; $lang->tree->confirmDeleteLine = 'Voulez-vous supprimer cette ligne de produit ?'; $lang->tree->confirmRoot = "Les changements du {$lang->productCommon} vont impacter les stories, bugs, casTests du {$lang->productCommon} auquel ils appartiennent, ainsi que les associations de {$lang->executionCommon} et {$lang->productCommon}, ce qui est dangereux. Voulez-vous malgré tout effectuer le changement ?"; $lang->tree->confirmRoot4Doc = "Toute modification apportée à la bibliothèque modifiera le document de la bibliothèque à laquelle elle appartient, ce qui est dangereux. Voulez-vous le changer ?"; diff --git a/module/tree/lang/zh-cn.php b/module/tree/lang/zh-cn.php index 9050ff21e9..7acc707f6c 100755 --- a/module/tree/lang/zh-cn.php +++ b/module/tree/lang/zh-cn.php @@ -43,6 +43,7 @@ $lang->tree->confirmDelete = '该模块及其子模块都会被删除, $lang->tree->confirmDeleteMenu = '该目录及其子目录都会被删除,您确定删除吗?'; $lang->tree->confirmDelCategory = '该分类及其子分类都会被删除,您确定删除吗?'; $lang->tree->confirmDeleteLine = "您确定删除该{$lang->productCommon}线吗?"; +$lang->tree->confirmDeleteGroup = '该分组及其子分组都会被删除,您确定删除吗?'; $lang->tree->confirmRoot = "模块的所属{$lang->productCommon}修改,会关联修改该模块下的{$lang->SRCommon}、Bug、用例的所属{$lang->productCommon},以及{$lang->executionCommon}和{$lang->productCommon}的关联关系。该操作比较危险,请谨慎操作。是否确认修改?"; $lang->tree->confirmRoot4Doc = "修改所属文档库,会同时修改该分类下文档的关联关系。该操作比较危险,请谨慎操作。是否确认修改?"; $lang->tree->noSubmodule = "当前模块下没有可复制的子模块!"; From d92a58f3df5b9b612680bf9847c62b6783e76bfe Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 1 Nov 2022 14:39:16 +0800 Subject: [PATCH 05/19] * Optimize code for task #74322, #74326. --- db/zentao.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/zentao.sql b/db/zentao.sql index 5e2f79f431..3110004dfb 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -429,12 +429,15 @@ CREATE TABLE `zt_chart` ( `id` mediumint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(30) NOT NULL, + `group` varchar(30) NOT NULL, `dataset` varchar(30) NOT NULL, - `desc` mediumtext NOT NULL, + `desc` desc NOT NULL, `settings` mediumtext NOT NULL, `filters` mediumtext NOT NULL, `createdBy` char(30) NOT NULL, `createdDate` datetime NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime NOT NULL, `deleted` tinyint NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 7fba5b1b820973191408e4a827eee821443458a4 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 1 Nov 2022 14:47:24 +0800 Subject: [PATCH 06/19] * Fix bug. --- db/zentao.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/zentao.sql b/db/zentao.sql index 3110004dfb..dbb2772c97 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -431,7 +431,7 @@ CREATE TABLE `zt_chart` ( `type` varchar(30) NOT NULL, `group` varchar(30) NOT NULL, `dataset` varchar(30) NOT NULL, - `desc` desc NOT NULL, + `desc` text NOT NULL, `settings` mediumtext NOT NULL, `filters` mediumtext NOT NULL, `createdBy` char(30) NOT NULL, From 92054f16ec718655ad35d67bf9a54cf112dd1f47 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 1 Nov 2022 16:24:06 +0800 Subject: [PATCH 07/19] * Fix bug for task #74322. --- db/update17.7.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index 6203daef55..39d17ffffe 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -4,10 +4,10 @@ ALTER TABLE `zt_chart` ADD `editedBy` varchar(30) NOT NULL AFTER `createdDate`; ALTER TABLE `zt_chart` ADD `editedDate` datetime NOT NULL AFTER `editedBy`; INSERT INTO `zt_module` (`company`, `root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `owner`, `collector`, `short`, `deleted`) VALUES -(0, 0, 0, '产品', 0, ',0,', 1, 10, 'bi', '', '', '', '0'), -(0, 0, 0, '项目', 0, ',0,', 1, 20, 'bi', '', '', '', '0'), -(0, 0, 0, '测试', 0, ',0,', 1, 30, 'bi', '', '', '', '0'), -(0, 0, 0, '组织', 0, ',0,', 1, 40, 'bi', '', '', '', '0'); +(0, 0, 0, '产品', 0, ',0,', 1, 10, 'bi', 'system', '', '', '0'), +(0, 0, 0, '项目', 0, ',0,', 1, 20, 'bi', 'system', '', '', '0'), +(0, 0, 0, '测试', 0, ',0,', 1, 30, 'bi', 'system', '', '', '0'), +(0, 0, 0, '组织', 0, ',0,', 1, 40, 'bi', 'system', '', '', '0'); UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); From f7af6deaa6aeb420988fae807d90f69fdf9b69da Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 2 Nov 2022 13:27:31 +0800 Subject: [PATCH 08/19] * Optimize code after code review. --- db/update17.7.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index d698b4364b..d76ea387ab 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -4,10 +4,10 @@ ALTER TABLE `zt_chart` ADD `editedBy` varchar(30) NOT NULL AFTER `createdDate`; ALTER TABLE `zt_chart` ADD `editedDate` datetime NOT NULL AFTER `editedBy`; INSERT INTO `zt_module` (`company`, `root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `owner`, `collector`, `short`, `deleted`) VALUES -(0, 0, 0, '产品', 0, ',0,', 1, 10, 'bi', 'system', '', '', '0'), -(0, 0, 0, '项目', 0, ',0,', 1, 20, 'bi', 'system', '', '', '0'), -(0, 0, 0, '测试', 0, ',0,', 1, 30, 'bi', 'system', '', '', '0'), -(0, 0, 0, '组织', 0, ',0,', 1, 40, 'bi', 'system', '', '', '0'); +(0, 0, 0, '产品', 0, ',0,', 1, 10, 'chart', 'system', '', '', '0'), +(0, 0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), +(0, 0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), +(0, 0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); @@ -24,4 +24,4 @@ CREATE TABLE IF NOT EXISTS `zt_dimension` ( `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `code` (`code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From ddae3dce44099fe8cbddf9eef33ebf82cae46b95 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 3 Nov 2022 11:17:29 +0800 Subject: [PATCH 09/19] * Fix bug. --- db/update17.7.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index d76ea387ab..e66147fe50 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -3,11 +3,11 @@ ALTER TABLE `zt_chart` MODIFY COLUMN `desc` text NOT NULL; ALTER TABLE `zt_chart` ADD `editedBy` varchar(30) NOT NULL AFTER `createdDate`; ALTER TABLE `zt_chart` ADD `editedDate` datetime NOT NULL AFTER `editedBy`; -INSERT INTO `zt_module` (`company`, `root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `owner`, `collector`, `short`, `deleted`) VALUES -(0, 0, 0, '产品', 0, ',0,', 1, 10, 'chart', 'system', '', '', '0'), -(0, 0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), -(0, 0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), -(0, 0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); +INSERT INTO `zt_module` (`root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `owner`, `collector`, `short`, `deleted`) VALUES +(0, 0, '产品', 0, ',0,', 1, 10, 'chart', 'system', '', '', '0'), +(0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), +(0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), +(0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); From a38461a20e43659e2126cd874dbacca91fa5196d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Sun, 6 Nov 2022 16:03:14 +0800 Subject: [PATCH 10/19] * Fix bug for manage chart group. --- module/action/lang/de.php | 1 + module/action/lang/en.php | 1 + module/action/lang/fr.php | 1 + module/action/lang/zh-cn.php | 1 + module/action/model.php | 7 +++++++ module/tree/control.php | 4 ++-- module/tree/model.php | 20 +++++++++++++------- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index f11ff708dd..2b681adce2 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -720,6 +720,7 @@ $lang->action->label->gitlab = 'GitLab Server|gitlab|view|id=%s'; $lang->action->label->stage = 'Stage|stage|browse|'; $lang->action->label->module = 'Module|tree|browse|productid=%s&type=story¤tModuleID=0&branch=all'; $lang->action->label->ticket = 'Ticket|ticket|view|id=%s'; +$lang->action->label->chartgroup = 'Group'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/action/lang/en.php b/module/action/lang/en.php index fbdaf2970f..7f607016ea 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -720,6 +720,7 @@ $lang->action->label->gitlab = 'GitLab Server|gitlab|view|id=%s'; $lang->action->label->stage = 'Stage|stage|browse|'; $lang->action->label->module = 'Module|tree|browse|productid=%s&type=story¤tModuleID=0&branch=all'; $lang->action->label->ticket = 'Ticket|ticket|view|id=%s'; +$lang->action->label->chartgroup = 'Group'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 1e033620da..ecbe62e3bb 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -720,6 +720,7 @@ $lang->action->label->gitlab = 'GitLab Server|gitlab|view|id=%s'; $lang->action->label->stage = 'Stage|stage|browse|'; $lang->action->label->module = 'Module|tree|browse|productid=%s&type=story¤tModuleID=0&branch=all'; $lang->action->label->ticket = 'Ticket|ticket|view|id=%s'; +$lang->action->label->chartgroup = 'Group'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 2ba8f216e4..d210a91381 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -720,6 +720,7 @@ $lang->action->label->gitlab = 'GitLab服务器|gitlab|view|id=%s'; $lang->action->label->stage = '瀑布模型的阶段|stage|browse|'; $lang->action->label->module = '模块|tree|browse|productid=%s&type=story¤tModuleID=0&branch=all'; $lang->action->label->ticket = '工单|ticket|view|id=%s'; +$lang->action->label->chartgroup = '分组'; /* Object type. */ $lang->action->search = new stdclass(); diff --git a/module/action/model.php b/module/action/model.php index 1d4df4b1aa..2787d00c40 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1620,6 +1620,13 @@ class actionModel extends model $action->objectLink = helper::createLink('kanban', 'view', "kanbanID=$kanbanID"); } + if($action->objectType == 'chartgroup' and $action->action != 'deleted') + { + $group = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->eq($action->objectID)->fetch(); + if(empty($group)) $action->objectLink = ''; + if(!empty($group)) $action->objectLink = helper::createLink('chart', 'browseGroup', "rootID=$group->root"); + } + if($action->objectType == 'branch' and $action->action == 'mergedbranch') { $action->objectLink = 'javascript:void(0)'; diff --git a/module/tree/control.php b/module/tree/control.php index d26b24104f..b7c99e3817 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -382,7 +382,7 @@ class tree extends control { $this->view->optionMenu = $this->tree->getTaskOptionMenu($module->root); } - else + else if($type != 'chart') { $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch); } @@ -486,7 +486,7 @@ class tree extends control if($module->type == 'doc') $confirmLang = $this->lang->tree->confirmDeleteMenu; if($module->type == 'line') $confirmLang = $this->lang->tree->confirmDeleteLine; if($module->type == 'host') $confirmLang = $this->lang->tree->confirmDeleteHost; - if($module->type == 'bi') $confirmLang = $this->lang->tree->confirmDeleteGroup; + if($module->type == 'chart') $confirmLang = $this->lang->tree->confirmDeleteGroup; die(js::confirm($confirmLang, $this->createLink('tree', 'delete', "rootID=$rootID&moduleID=$moduleID&confirm=yes"))); } else diff --git a/module/tree/model.php b/module/tree/model.php index e082e56a07..fdbbdff132 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1756,10 +1756,11 @@ class treeModel extends model } } - if($type == 'story') + if($type == 'story' or $type == 'chart') { + $objectType = $type == 'story' ? 'module' : 'chartgroup'; $this->loadModel('action'); - if(!empty($createIdList)) $actionID = $this->action->create('module', $rootID, 'created', '', implode(',', $createIdList)); + if(!empty($createIdList)) $actionID = $this->action->create($objectType, $rootID, 'created', '', implode(',', $createIdList)); if(!empty($editIdList)) { @@ -1778,7 +1779,7 @@ class treeModel extends model $changes[] = $change; } } - $actionID = $this->action->create('module', $rootID, 'edited', '', implode(',', $editIdList)); + $actionID = $this->action->create($objectType, $rootID, 'edited', '', implode(',', $editIdList)); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } } @@ -1814,8 +1815,9 @@ class treeModel extends model $this->dao->update(TABLE_MODULE)->set('owner')->eq($this->post->owner)->where('id')->in($childs)->andWhere('owner')->eq('')->exec(); $this->dao->update(TABLE_MODULE)->set('owner')->eq($this->post->owner)->where('id')->in($childs)->andWhere('owner')->eq($self->owner)->exec(); - if($self->type == 'story') + if($self->type == 'story' or $self->type == 'chart') { + $objectType = $self->type == 'story' ? 'module' : 'chartgroup'; $rootID = isset($module->root) ? $module->root : $self->root; $newModules = $this->getOptionMenu($rootID, 'story', 0, 'all'); @@ -1829,11 +1831,11 @@ class treeModel extends model break; } } - $actionID = $this->loadModel('action')->create('module', $self->root, 'edited', '', $moduleID); + $actionID = $this->loadModel('action')->create($objectType, $self->root, 'edited', '', $moduleID); if(!empty($changes)) $this->action->logHistory($actionID, $changes); if(isset($module->root) and $module->root != $self->root) { - $actionID = $this->action->create('module', $rootID, 'edited', '', $moduleID); + $actionID = $this->action->create($objectType, $rootID, 'edited', '', $moduleID); if(!empty($changes)) $this->action->logHistory($actionID, $changes); } } @@ -1927,11 +1929,12 @@ class treeModel extends model $childs = $this->getAllChildId($moduleID); $childs[$moduleID] = $moduleID; + $objectType = (!empty($module->type) and $module->type == 'chart') ? 'chartgroup' : 'module'; /* Mark deletion when delete a module. */ $this->dao->update(TABLE_MODULE)->set('deleted')->eq(1)->where('id')->in($childs)->exec(); foreach($childs as $childID) { - $this->loadModel('action')->create('module', $childID, 'deleted', '', $extra = ACTIONMODEL::CAN_UNDELETED); + $this->loadModel('action')->create($objectType, $childID, 'deleted', '', $extra = ACTIONMODEL::CAN_UNDELETED); } $this->fixModulePath($module->root, $module->type); @@ -1960,6 +1963,9 @@ class treeModel extends model $this->dao->update(TABLE_CASE)->set('module')->eq($module->parent)->where('module')->in($childs)->exec(); $cookieName = 'storyModule'; break; + case 'chart': + $this->dao->update(TABLE_CHART)->set('`group`')->eq($module->parent)->where('`group`')->in($childs)->exec(); + break; } if(strpos($this->session->{$module->type . 'List'}, 'param=' . $moduleID)) $this->session->set($module->type . 'List', str_replace('param=' . $moduleID, 'param=0', $this->session->{$module->type . 'List'})); if($cookieName) setcookie($cookieName, 0, time() - 3600, $this->config->webRoot, '', $this->config->cookieSecure, false); From a25727d923a2d88085d7ab07c729b48f0ecef43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Mon, 7 Nov 2022 16:07:02 +0800 Subject: [PATCH 11/19] * Update sql. --- db/update17.7.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/update17.7.sql b/db/update17.7.sql index e66147fe50..1c3f95ba07 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -8,10 +8,12 @@ INSERT INTO `zt_module` (`root`, `branch`, `name`, `parent`, `path`, `grade`, `o (0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), (0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), (0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); +UPDATE `zt_module` SET `root` = 1 where `owner` = 'system'; UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); +DROP TABLE IF EXISTS `zt_dimension`; CREATE TABLE IF NOT EXISTS `zt_dimension` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(90) NOT NULL, @@ -25,3 +27,7 @@ CREATE TABLE IF NOT EXISTS `zt_dimension` ( PRIMARY KEY (`id`), KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +INSERT INTO `zt_dimension` (`name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES('default', 'default', '', 'system', CURDATE(), 'system', CURDATE()); + +ALTER TABLE `zt_report` ADD `root` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_chart` ADD `root` int(8) NOT NULL default 1 AFTER `name`; From 5e9f255e142e3128d3327f198ad99f3daa86d23b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 7 Nov 2022 16:27:53 +0800 Subject: [PATCH 12/19] * Fix bug for init chart. --- db/update17.7.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index 1c3f95ba07..6024477711 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -10,8 +10,8 @@ INSERT INTO `zt_module` (`root`, `branch`, `name`, `parent`, `path`, `grade`, `o (0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); UPDATE `zt_module` SET `root` = 1 where `owner` = 'system'; -UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'bi' AND `name` = '产品' limit 1); -UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'bi' AND `name` in ('产品', '项目', '测试', '组织'); +UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'chart' AND `name` = '产品' limit 1); +UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'chart' AND `name` in ('产品', '项目', '测试', '组织'); DROP TABLE IF EXISTS `zt_dimension`; CREATE TABLE IF NOT EXISTS `zt_dimension` ( From 42e445c48d9b0491895e6c558ec538142a49cb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Mon, 7 Nov 2022 16:46:34 +0800 Subject: [PATCH 13/19] * Modify sql field. --- db/update17.7.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index 1c3f95ba07..e0473931c7 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -29,5 +29,7 @@ CREATE TABLE IF NOT EXISTS `zt_dimension` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `zt_dimension` (`name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES('default', 'default', '', 'system', CURDATE(), 'system', CURDATE()); -ALTER TABLE `zt_report` ADD `root` int(8) NOT NULL default 1 AFTER `name`; -ALTER TABLE `zt_chart` ADD `root` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_report` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_chart` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_dataset` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_dashboard` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; From 39f4ea0e7a15c03cf2131d58f0b5586e3d0258d1 Mon Sep 17 00:00:00 2001 From: liugang Date: Tue, 8 Nov 2022 10:36:53 +0800 Subject: [PATCH 14/19] * Finish task #75169. --- module/tree/model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module/tree/model.php b/module/tree/model.php index fdbbdff132..0a93d41ab4 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -1391,6 +1391,21 @@ class treeModel extends model return html::a(helper::createLink('dashboard', 'browse', "type=bymodule¶m={$module->id}"), $module->name, '', "id='module{$module->id}' title='{$module->name}'"); } + /** + * Create report link. + * + * @param string $type + * @param object $module + * @param array $extra + * @access public + * @return string + */ + public function createReportLink($type, $module, $extra) + { + $dimension = zget($extra, 'dimension', 0); + return html::a(helper::createLink('report', 'browsereport', "dimension={$dimension}&module={$module->id}"), $module->name, '', "id='module{$module->id}' title='{$module->name}'"); + } + /** * Get sons of a module. * From e4d32ca2546e1512dac9ec0f765bad8588f2ec06 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 8 Nov 2022 10:38:05 +0800 Subject: [PATCH 15/19] * Finish task #75528. --- db/update17.7.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db/update17.7.sql b/db/update17.7.sql index d801bc491e..6f2280e152 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -33,3 +33,8 @@ ALTER TABLE `zt_report` ADD `dimension` int(8) NOT NULL default 1 AFTER `name ALTER TABLE `zt_chart` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; ALTER TABLE `zt_dataset` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; ALTER TABLE `zt_dashboard` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; + +UPDATE `zt_chart` SET `dimension` = 1 WHERE `dimension` = 0; +UPDATE `zt_report` SET `dimension` = 1 WHERE `dimension` = 0; +UPDATE `zt_dashboard` SET `dimension` = 1 WHERE `dimension` = 0; +UPDATE `zt_module` SET `root` = 1 WHERE `root` = 0 AND `type` in ('chart'); From cb56e049e66ec5f00a7db9d33d9abd86437a554c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 8 Nov 2022 10:50:17 +0800 Subject: [PATCH 16/19] * Modify sql for 18-7. --- db/update17.7.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index 6f2280e152..d409908bb7 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -8,7 +8,8 @@ INSERT INTO `zt_module` (`root`, `branch`, `name`, `parent`, `path`, `grade`, `o (0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), (0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), (0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); -UPDATE `zt_module` SET `root` = 1 where `owner` = 'system'; +UPDATE `zt_module` SET `root` = 1 where `type` = 'chart'; +UPDATE `zt_module` SET `root` = 1 where `type` = 'dashboard'; UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'chart' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'chart' AND `name` in ('产品', '项目', '测试', '组织'); @@ -29,10 +30,10 @@ CREATE TABLE IF NOT EXISTS `zt_dimension` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `zt_dimension` (`name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES('default', 'default', '', 'system', CURDATE(), 'system', CURDATE()); -ALTER TABLE `zt_report` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; -ALTER TABLE `zt_chart` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; -ALTER TABLE `zt_dataset` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; -ALTER TABLE `zt_dashboard` ADD `dimension` int(8) NOT NULL default 1 AFTER `name`; +ALTER TABLE `zt_report` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; +ALTER TABLE `zt_chart` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; +--ALTER TABLE `zt_dataset` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; +ALTER TABLE `zt_dashboard` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; UPDATE `zt_chart` SET `dimension` = 1 WHERE `dimension` = 0; UPDATE `zt_report` SET `dimension` = 1 WHERE `dimension` = 0; From 9c1f8b2be172d2f9b55405451eb4c3226ea28367 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 8 Nov 2022 13:02:01 +0800 Subject: [PATCH 17/19] * Fix bug #29325. --- module/action/model.php | 26 ++++++++++++-------------- module/company/view/dynamic.html.php | 2 +- module/my/view/dynamic.html.php | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/module/action/model.php b/module/action/model.php index 2787d00c40..ab5254f06d 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1267,7 +1267,7 @@ class actionModel extends model $objectName = ($objectType == 'productplan' or $objectType == 'ticket') ? 'title' : 'name'; $action->objectName = $this->dao->select($objectName)->from($objectTable)->where('id')->eq($action->extra)->fetch($objectName); } - elseif($action->objectType == 'module' and !empty($action->extra) and $action->action != 'deleted') + elseif(strpos(',module,chartgroup,', ",$action->objectType,") !== false and !empty($action->extra) and $action->action != 'deleted') { $modules = $this->dao->select('id,name')->from(TABLE_MODULE)->where('id')->in(explode(',', $action->extra))->fetchPairs('id'); $action->objectName = implode(',', $modules); @@ -1443,6 +1443,16 @@ class actionModel extends model if(!is_array($objectLabel)) $actionObjectLabel = $objectLabel; if(is_array($objectLabel) and isset($objectLabel[$actionType])) $actionObjectLabel = $objectLabel[$actionType]; + + if($objectType == 'module' and $actionType == 'deleted') + { + $moduleType = $this->dao->select('type')->from(TABLE_MODULE)->where('id')->eq($objectID)->fetch('type'); + if($moduleType == 'doc') + { + $this->app->loadLang('doc'); + $actionObjectLabel = $this->lang->doc->menuTitle; + } + } } if($this->config->edition == 'max' and $objectType == 'assetlib') @@ -1622,9 +1632,7 @@ class actionModel extends model if($action->objectType == 'chartgroup' and $action->action != 'deleted') { - $group = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->eq($action->objectID)->fetch(); - if(empty($group)) $action->objectLink = ''; - if(!empty($group)) $action->objectLink = helper::createLink('chart', 'browseGroup', "rootID=$group->root"); + $action->objectLink = helper::createLink('chart', 'browseGroup', "rootID=$action->objectID"); } if($action->objectType == 'branch' and $action->action == 'mergedbranch') @@ -1632,16 +1640,6 @@ class actionModel extends model $action->objectLink = 'javascript:void(0)'; } - if($action->objectType == 'module') - { - $moduleType = $this->dao->select('type')->from(TABLE_MODULE)->where('id')->eq($action->objectID)->fetch('type'); - if($moduleType == 'doc') - { - $this->app->loadLang('doc'); - $action->objectLabel = $this->lang->doc->menuTitle; - } - } - if($action->objectType == 'review') { $action->objectLink = helper::createLink('review', 'view', "reviewID=$action->objectID"); diff --git a/module/company/view/dynamic.html.php b/module/company/view/dynamic.html.php index 0b4a7e45ad..e889c24e43 100644 --- a/module/company/view/dynamic.html.php +++ b/module/company/view/dynamic.html.php @@ -75,7 +75,7 @@ action != 'login' and $action->action != 'logout'):?> objectLabel;?> objectID):?> - objectType == 'module' and strpos(',created,edited,moved,', "$action->action") !== false) ? trim($action->extra, ',') : $action->objectID;?> + objectType,") !== false and strpos(',created,edited,moved,', "$action->action") !== false) ? trim($action->extra, ',') : $action->objectID;?> objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";?> diff --git a/module/my/view/dynamic.html.php b/module/my/view/dynamic.html.php index 3575889ffe..b6e2c19ef2 100644 --- a/module/my/view/dynamic.html.php +++ b/module/my/view/dynamic.html.php @@ -59,7 +59,7 @@ action != 'login' and $action->action != 'logout'):?> objectLabel;?> objectID):?> - objectID;?> + objectType,") !== false and strpos(',created,edited,moved,', "$action->action") !== false) ? trim($action->extra, ',') : $action->objectID;?> objectType == 'meeting') $tab = $action->project ? "data-app='project'" : "data-app='my'";?> From 3ba24349ebe5e922f602b3814408361fff0f20e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 8 Nov 2022 13:03:55 +0800 Subject: [PATCH 18/19] * Modify sql. --- db/update17.7.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index d409908bb7..279892c21f 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `zt_dimension` ( PRIMARY KEY (`id`), KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `zt_dimension` (`name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES('default', 'default', '', 'system', CURDATE(), 'system', CURDATE()); +INSERT INTO `zt_dimension` (`name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES('default', 'default', '', 'system', NOW(), 'system', NOW()); ALTER TABLE `zt_report` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; ALTER TABLE `zt_chart` ADD `dimension` int(8) NOT NULL default 0 AFTER `name`; From d84d4a26c4c0b056d9f6439e084200bd634624e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Tue, 8 Nov 2022 13:49:10 +0800 Subject: [PATCH 19/19] * Delete unused sql. --- db/update17.7.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/db/update17.7.sql b/db/update17.7.sql index 279892c21f..e01d36c5dd 100644 --- a/db/update17.7.sql +++ b/db/update17.7.sql @@ -8,8 +8,6 @@ INSERT INTO `zt_module` (`root`, `branch`, `name`, `parent`, `path`, `grade`, `o (0, 0, '项目', 0, ',0,', 1, 20, 'chart', 'system', '', '', '0'), (0, 0, '测试', 0, ',0,', 1, 30, 'chart', 'system', '', '', '0'), (0, 0, '组织', 0, ',0,', 1, 40, 'chart', 'system', '', '', '0'); -UPDATE `zt_module` SET `root` = 1 where `type` = 'chart'; -UPDATE `zt_module` SET `root` = 1 where `type` = 'dashboard'; UPDATE `zt_chart` SET `group` = (SELECT `id` FROM `zt_module` WHERE `type` = 'chart' AND `name` = '产品' limit 1); UPDATE `zt_module` SET `path` = CONCAT(',', `id`, ',') WHERE `type` = 'chart' AND `name` in ('产品', '项目', '测试', '组织'); @@ -38,4 +36,4 @@ ALTER TABLE `zt_dashboard` ADD `dimension` int(8) NOT NULL default 0 AFTER `name UPDATE `zt_chart` SET `dimension` = 1 WHERE `dimension` = 0; UPDATE `zt_report` SET `dimension` = 1 WHERE `dimension` = 0; UPDATE `zt_dashboard` SET `dimension` = 1 WHERE `dimension` = 0; -UPDATE `zt_module` SET `root` = 1 WHERE `root` = 0 AND `type` in ('chart'); +UPDATE `zt_module` SET `root` = 1 WHERE `root` = 0 AND `type` in ('chart', 'dashboard');