diff --git a/config/filter.php b/config/filter.php index 71cb71ac32..f35c2f8ac3 100644 --- a/config/filter.php +++ b/config/filter.php @@ -3,7 +3,7 @@ $filter = new stdclass(); $filter->rules = new stdclass(); $filter->rules->md5 = '/^[a-z0-9]{32}$/'; $filter->rules->base64 = '/^[a-zA-Z0-9\+\/\=]+$/'; -$filter->rules->checked = '/^[0-9,]+$/'; +$filter->rules->checked = '/^[0-9,\-]+$/'; $filter->rules->idList = '/^[0-9\|]+$/'; $filter->rules->lang = '/^[a-zA-Z_\-]+$/'; $filter->rules->any = '/./'; @@ -50,6 +50,7 @@ $filter->user = new stdclass(); $filter->block = new stdclass(); $filter->file = new stdclass(); $filter->repo = new stdclass(); +$filter->webhook = new stdclass(); $filter->block->default = new stdclass(); $filter->block->main = new stdclass(); @@ -97,9 +98,13 @@ $filter->testtask->default = new stdclass(); $filter->todo->export = new stdclass(); $filter->upgrade->license = new stdclass(); $filter->user->login = new stdclass(); +$filter->webhook->bind = new stdclass(); +$filter->user->ajaxgetmore = new stdclass(); $filter->bug->batchcreate->cookie['preBranch'] = 'int'; $filter->bug->browse->cookie['bugModule'] = 'int'; +$filter->bug->browse->cookie['bugBranch'] = 'int'; +$filter->bug->browse->cookie['treeBranch'] = 'int'; $filter->bug->browse->cookie['preBranch'] = 'int'; $filter->bug->browse->cookie['qaBugOrder'] = 'reg::orderBy'; $filter->bug->browse->cookie['windowWidth'] = 'int'; @@ -127,6 +132,8 @@ $filter->product->browse->cookie['preBranch'] = 'int'; $filter->product->browse->cookie['preProductID'] = 'int'; $filter->product->browse->cookie['productStoryOrder'] = 'reg::orderBy'; $filter->product->browse->cookie['storyModule'] = 'int'; +$filter->product->browse->cookie['storyBranch'] = 'int'; +$filter->product->browse->cookie['treeBranch'] = 'int'; $filter->product->default->cookie['lastProduct'] = 'int'; $filter->product->default->cookie['preProductID'] = 'int'; $filter->product->index->cookie['preBranch'] = 'int'; @@ -225,10 +232,12 @@ $filter->sso->logout->get['token'] = 'reg::md5'; $filter->upgrade->license->get['agree'] = 'equal::true'; -$filter->user->login->get['account'] = 'account'; -$filter->user->login->get['lang'] = 'reg::lang'; -$filter->user->login->get['password'] = 'reg::any'; -$filter->user->edit->get['from'] = 'reg::word'; +$filter->user->login->get['account'] = 'account'; +$filter->user->login->get['lang'] = 'reg::lang'; +$filter->user->login->get['password'] = 'reg::any'; +$filter->user->edit->get['from'] = 'reg::word'; +$filter->user->ajaxgetmore->get['search'] = 'reg::any'; +$filter->user->ajaxgetmore->get['limit'] = 'int'; $filter->git->cat->get['repoUrl'] = 'reg::base64'; $filter->git->diff->get['repoUrl'] = 'reg::base64'; @@ -247,3 +256,6 @@ $filter->repo->diff->cookie['arrange'] = 'reg::word'; $filter->repo->diff->cookie['repoPairs'] = 'array'; $filter->repo->view->cookie['repoPairs'] = 'array'; $filter->repo->ajaxsynccommit->cookie['syncBranch'] = 'reg::any'; + +$filter->webhook->bind->get['selectedDepts'] = 'reg::checked'; +$filter->webhook->bind->cookie['selectedDepts'] = 'reg::checked'; diff --git a/config/zentaopms.php b/config/zentaopms.php index 408f4ee482..fcc2cec76b 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -23,7 +23,9 @@ $config->checkVersion = true; // Auto check for new version or not. /* Set the wide window size and timeout(ms) and duplicate interval time(s). */ $config->wideSize = 1400; $config->timeout = 30000; -$config->duplicateTime = 60; +$config->duplicateTime = 30; +$config->maxCount = 500; +$config->moreLinks = array(); /* Product common list. */ $config->productCommonList['zh-cn'][0] = '产品'; @@ -85,21 +87,30 @@ $config->storyCommonList['vi'][1] = 'Câu chuyện'; /* Story common list. */ $config->hourPointCommonList['zh-cn'][0] = '工时'; $config->hourPointCommonList['zh-cn'][1] = '故事点'; +$config->hourPointCommonList['zh-cn'][2] = '功能点'; $config->hourPointCommonList['zh-tw'][0] = '工时'; $config->hourPointCommonList['zh-tw'][1] = '故事点'; +$config->hourPointCommonList['zh-tw'][2] = '功能点'; $config->hourPointCommonList['en'][0] = 'hour'; $config->hourPointCommonList['en'][1] = 'story point'; +$config->hourPointCommonList['en'][2] = 'function point'; $config->hourPointCommonList['de'][0] = 'hour'; $config->hourPointCommonList['de'][1] = 'story point'; +$config->hourPointCommonList['de'][2] = 'function point'; $config->hourPointCommonList['fr'][0] = 'hour'; $config->hourPointCommonList['fr'][1] = 'story point'; +$config->hourPointCommonList['fr'][2] = 'function point'; $config->hourPointCommonList['vi'][0] = 'giờ'; $config->hourPointCommonList['vi'][1] = 'điểm'; +$config->hourPointCommonList['vi'][2] = 'function point'; + +$config->manualUrl['home'] = 'https://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao'; +$config->manualUrl['int'] = 'https://www.zentao.pm/book/zentaomanual/zentao-installation-11.html?fullScreen=zentao'; /* Supported charsets. */ $config->charsets['zh-cn']['utf-8'] = 'UTF-8'; @@ -149,6 +160,7 @@ define('TABLE_RELEASE', '`' . $config->db->prefix . 'release`'); define('TABLE_PROJECT', '`' . $config->db->prefix . 'project`'); define('TABLE_TASK', '`' . $config->db->prefix . 'task`'); +define('TABLE_TASKSPEC', '`' . $config->db->prefix . 'taskspec`'); define('TABLE_TEAM', '`' . $config->db->prefix . 'team`'); define('TABLE_PROJECTPRODUCT','`' . $config->db->prefix . 'projectproduct`'); define('TABLE_PROJECTSTORY', '`' . $config->db->prefix . 'projectstory`'); diff --git a/db/standard/xuanxuan10.2.sql b/db/standard/xuanxuan10.2.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.2.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.3.1.sql b/db/standard/xuanxuan10.3.1.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.3.1.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.3.sql b/db/standard/xuanxuan10.3.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.3.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.4.sql b/db/standard/xuanxuan10.4.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.4.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.5.1.sql b/db/standard/xuanxuan10.5.1.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.5.1.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.5.sql b/db/standard/xuanxuan10.5.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.5.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan10.6.sql b/db/standard/xuanxuan10.6.sql new file mode 100644 index 0000000000..4e79c1ca01 --- /dev/null +++ b/db/standard/xuanxuan10.6.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser`( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.0.sql b/db/standard/xuanxuan11.0.sql new file mode 100644 index 0000000000..90450aca5a --- /dev/null +++ b/db/standard/xuanxuan11.0.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.1.sql b/db/standard/xuanxuan11.1.sql new file mode 100644 index 0000000000..90450aca5a --- /dev/null +++ b/db/standard/xuanxuan11.1.sql @@ -0,0 +1,65 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.2.sql b/db/standard/xuanxuan11.2.sql new file mode 100644 index 0000000000..868df2ca4c --- /dev/null +++ b/db/standard/xuanxuan11.2.sql @@ -0,0 +1,66 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.3.sql b/db/standard/xuanxuan11.3.sql new file mode 100644 index 0000000000..868df2ca4c --- /dev/null +++ b/db/standard/xuanxuan11.3.sql @@ -0,0 +1,66 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.4.1.sql b/db/standard/xuanxuan11.4.1.sql new file mode 100644 index 0000000000..868df2ca4c --- /dev/null +++ b/db/standard/xuanxuan11.4.1.sql @@ -0,0 +1,66 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.4.sql b/db/standard/xuanxuan11.4.sql new file mode 100644 index 0000000000..868df2ca4c --- /dev/null +++ b/db/standard/xuanxuan11.4.sql @@ -0,0 +1,66 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `gid` char(40) NOT NULL DEFAULT '', + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`gid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.5.1.sql b/db/standard/xuanxuan11.5.1.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.5.1.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.5.2.sql b/db/standard/xuanxuan11.5.2.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.5.2.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.5.sql b/db/standard/xuanxuan11.5.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.5.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.1.sql b/db/standard/xuanxuan11.6.1.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.1.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.2.sql b/db/standard/xuanxuan11.6.2.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.2.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.3.sql b/db/standard/xuanxuan11.6.3.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.3.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.4.sql b/db/standard/xuanxuan11.6.4.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.4.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.5.sql b/db/standard/xuanxuan11.6.5.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.5.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.6.sql b/db/standard/xuanxuan11.6.sql new file mode 100644 index 0000000000..fafea4f43d --- /dev/null +++ b/db/standard/xuanxuan11.6.sql @@ -0,0 +1,80 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(10) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan11.7.sql b/db/standard/xuanxuan11.7.sql new file mode 100644 index 0000000000..68de0d1472 --- /dev/null +++ b/db/standard/xuanxuan11.7.sql @@ -0,0 +1,91 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.0.1.sql b/db/standard/xuanxuan12.0.1.sql new file mode 100644 index 0000000000..68de0d1472 --- /dev/null +++ b/db/standard/xuanxuan12.0.1.sql @@ -0,0 +1,91 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.0.sql b/db/standard/xuanxuan12.0.sql new file mode 100644 index 0000000000..68de0d1472 --- /dev/null +++ b/db/standard/xuanxuan12.0.sql @@ -0,0 +1,91 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.1.sql b/db/standard/xuanxuan12.1.sql new file mode 100644 index 0000000000..68de0d1472 --- /dev/null +++ b/db/standard/xuanxuan12.1.sql @@ -0,0 +1,91 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.2.sql b/db/standard/xuanxuan12.2.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.2.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.3.1.sql b/db/standard/xuanxuan12.3.1.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.3.1.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.3.2.sql b/db/standard/xuanxuan12.3.2.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.3.2.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.3.3.sql b/db/standard/xuanxuan12.3.3.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.3.3.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.3.sql b/db/standard/xuanxuan12.3.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.3.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/xuanxuan12.4.sql b/db/standard/xuanxuan12.4.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.4.sql @@ -0,0 +1,109 @@ +CREATE TABLE IF NOT EXISTS `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT 0, + `public` enum('0', '1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT 0, + `order` smallint(5) NOT NULL DEFAULT 0, + `star` enum('0', '1') NOT NULL DEFAULT '0', + `hide` enum('0', '1') NOT NULL DEFAULT '0', + `mute` enum('0', '1') NOT NULL DEFAULT '0', + `freeze` enum('0', '1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`), + UNIQUE KEY `chatuser` (`cgid`, `user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_message` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `order` bigint(8) unsigned NOT NULL, + `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL DEFAULT '', + `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', + `data` text NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT 0, + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT 0, + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `rid` char(24) NOT NULL DEFAULT '', + `type` enum('create','join','leave','close') NOT NULL DEFAULT 'create', + `user` mediumint(8) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/zentao12.3.1.sql b/db/standard/zentao12.3.1.sql new file mode 100644 index 0000000000..fd371d9d16 --- /dev/null +++ b/db/standard/zentao12.3.1.sql @@ -0,0 +1,1066 @@ +CREATE TABLE `zt_action` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` varchar(255) NOT NULL, + `project` mediumint(9) NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL default 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` text NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(30) NOT NULL, + `token` varchar(255) DEFAULT 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `marker` enum('0','1') NOT NULL DEFAULT '0', + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `leftBugs` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'normal', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `prefix` varchar(100) NOT NULL, + `encoding` varchar(20) NOT NULL, + `SCM` varchar(10) NOT NULL, + `client` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repobranch` ( + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `branch` varchar(255) NOT NULL, + UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), + KEY `branch` (`branch`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repohistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `repo` mediumint(9) NOT NULL, + `revision` varchar(40) NOT NULL, + `commit` mediumint(8) unsigned NOT NULL, + `comment` text NOT NULL, + `committer` varchar(100) NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repofiles` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `path` varchar(255) NOT NULL, + `parent` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `action` char(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `path` (`path`), + KEY `parent` (`parent`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `account` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL DEFAULT '', + `method` varchar(30) NOT NULL, + `desc` varchar(250) NOT NULL DEFAULT '', + `before` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `after` int(11) NOT NULL DEFAULT '0', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`module`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`), + KEY `run` (`run`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testrun` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `assignedTo` char(30) NOT NULL DEFAULT '', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `task` (`task`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testsuite` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `type` varchar(20) NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testtask` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(90) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/zentao12.3.2.sql b/db/standard/zentao12.3.2.sql new file mode 100644 index 0000000000..fd371d9d16 --- /dev/null +++ b/db/standard/zentao12.3.2.sql @@ -0,0 +1,1066 @@ +CREATE TABLE `zt_action` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` varchar(255) NOT NULL, + `project` mediumint(9) NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL default 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` text NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(30) NOT NULL, + `token` varchar(255) DEFAULT 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `marker` enum('0','1') NOT NULL DEFAULT '0', + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `leftBugs` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'normal', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `prefix` varchar(100) NOT NULL, + `encoding` varchar(20) NOT NULL, + `SCM` varchar(10) NOT NULL, + `client` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repobranch` ( + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `branch` varchar(255) NOT NULL, + UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), + KEY `branch` (`branch`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repohistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `repo` mediumint(9) NOT NULL, + `revision` varchar(40) NOT NULL, + `commit` mediumint(8) unsigned NOT NULL, + `comment` text NOT NULL, + `committer` varchar(100) NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repofiles` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `path` varchar(255) NOT NULL, + `parent` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `action` char(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `path` (`path`), + KEY `parent` (`parent`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `account` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL DEFAULT '', + `method` varchar(30) NOT NULL, + `desc` varchar(250) NOT NULL DEFAULT '', + `before` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `after` int(11) NOT NULL DEFAULT '0', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`module`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`), + KEY `run` (`run`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testrun` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `assignedTo` char(30) NOT NULL DEFAULT '', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `task` (`task`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testsuite` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `type` varchar(20) NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testtask` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(90) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/zentao12.3.3.sql b/db/standard/zentao12.3.3.sql new file mode 100644 index 0000000000..8462ee6bf1 --- /dev/null +++ b/db/standard/zentao12.3.3.sql @@ -0,0 +1,1067 @@ +CREATE TABLE `zt_action` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` varchar(255) NOT NULL, + `project` mediumint(9) NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL default 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` text NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `program` mediumint(8) unsigned NOT NULL DEFAULT 0, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(255) NOT NULL, + `token` varchar(255) DEFAULT 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `marker` enum('0','1') NOT NULL DEFAULT '0', + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `leftBugs` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'normal', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `prefix` varchar(100) NOT NULL, + `encoding` varchar(20) NOT NULL, + `SCM` varchar(10) NOT NULL, + `client` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repobranch` ( + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `branch` varchar(255) NOT NULL, + UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), + KEY `branch` (`branch`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repohistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `repo` mediumint(9) NOT NULL, + `revision` varchar(40) NOT NULL, + `commit` mediumint(8) unsigned NOT NULL, + `comment` text NOT NULL, + `committer` varchar(100) NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repofiles` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `path` varchar(255) NOT NULL, + `parent` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `action` char(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `path` (`path`), + KEY `parent` (`parent`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `account` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL DEFAULT '', + `method` varchar(30) NOT NULL, + `desc` varchar(250) NOT NULL DEFAULT '', + `before` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `after` int(11) NOT NULL DEFAULT '0', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`module`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`), + KEY `run` (`run`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testrun` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `assignedTo` char(30) NOT NULL DEFAULT '', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `task` (`task`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testsuite` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `type` varchar(20) NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testtask` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(90) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/zentao12.4.1.sql b/db/standard/zentao12.4.1.sql new file mode 100644 index 0000000000..2bb35bfc92 --- /dev/null +++ b/db/standard/zentao12.4.1.sql @@ -0,0 +1,1067 @@ +CREATE TABLE `zt_action` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` varchar(255) NOT NULL, + `project` mediumint(9) NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL default 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` longtext NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `program` mediumint(8) unsigned NOT NULL DEFAULT 0, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(255) NOT NULL, + `token` varchar(255) DEFAULT 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `marker` enum('0','1') NOT NULL DEFAULT '0', + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `leftBugs` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'normal', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `prefix` varchar(100) NOT NULL, + `encoding` varchar(20) NOT NULL, + `SCM` varchar(10) NOT NULL, + `client` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repobranch` ( + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `branch` varchar(255) NOT NULL, + UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), + KEY `branch` (`branch`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repohistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `repo` mediumint(9) NOT NULL, + `revision` varchar(40) NOT NULL, + `commit` mediumint(8) unsigned NOT NULL, + `comment` text NOT NULL, + `committer` varchar(100) NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repofiles` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `path` varchar(255) NOT NULL, + `parent` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `action` char(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `path` (`path`), + KEY `parent` (`parent`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `account` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL DEFAULT '', + `method` varchar(30) NOT NULL, + `desc` varchar(250) NOT NULL DEFAULT '', + `before` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `after` int(11) NOT NULL DEFAULT '0', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`module`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`), + KEY `run` (`run`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testrun` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `assignedTo` char(30) NOT NULL DEFAULT '', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `task` (`task`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testsuite` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `type` varchar(20) NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testtask` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(90) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/standard/zentao12.4.sql b/db/standard/zentao12.4.sql new file mode 100644 index 0000000000..2bb35bfc92 --- /dev/null +++ b/db/standard/zentao12.4.sql @@ -0,0 +1,1067 @@ +CREATE TABLE `zt_action` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` varchar(255) NOT NULL, + `project` mediumint(9) NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL default 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` longtext NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `program` mediumint(8) unsigned NOT NULL DEFAULT 0, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(255) NOT NULL, + `token` varchar(255) DEFAULT 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `program` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL, + `AType` char(30) NOT NULL, + `AID` mediumint(8) NOT NULL, + `AVersion` char(30) NOT NULL, + `relation` char(30) NOT NULL, + `BType` char(30) NOT NULL, + `BID` mediumint(8) NOT NULL, + `BVersion` char(30) NOT NULL, + `extra` char(30) NOT NULL, + UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) +) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `marker` enum('0','1') NOT NULL DEFAULT '0', + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `leftBugs` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'normal', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `prefix` varchar(100) NOT NULL, + `encoding` varchar(20) NOT NULL, + `SCM` varchar(10) NOT NULL, + `client` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repobranch` ( + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `branch` varchar(255) NOT NULL, + UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), + KEY `branch` (`branch`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repohistory` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `repo` mediumint(9) NOT NULL, + `revision` varchar(40) NOT NULL, + `commit` mediumint(8) unsigned NOT NULL, + `comment` text NOT NULL, + `committer` varchar(100) NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_repofiles` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repo` mediumint(8) unsigned NOT NULL, + `revision` mediumint(8) unsigned NOT NULL, + `path` varchar(255) NOT NULL, + `parent` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `action` char(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `path` (`path`), + KEY `parent` (`parent`), + KEY `repo` (`repo`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_score` ( + `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, + `account` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL DEFAULT '', + `method` varchar(30) NOT NULL, + `desc` varchar(250) NOT NULL DEFAULT '', + `before` int(11) NOT NULL DEFAULT '0', + `score` int(11) NOT NULL DEFAULT '0', + `after` int(11) NOT NULL DEFAULT '0', + `time` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `model` (`module`), + KEY `method` (`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_story` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, + `parent` mediumint(9) NOT NULL default '0', + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`), + KEY `run` (`run`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testrun` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `assignedTo` char(30) NOT NULL DEFAULT '', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `task` (`task`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testsuite` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `type` varchar(20) NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testtask` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(90) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/update12.3.2.sql b/db/update12.3.2.sql new file mode 100644 index 0000000000..fb85878bf0 --- /dev/null +++ b/db/update12.3.2.sql @@ -0,0 +1,8 @@ +UPDATE `zt_story` SET `plan` = '' WHERE `parent` = '-1' AND `plan` != '0' AND `plan` != ''; + +DELETE FROM `zt_grouppriv` WHERE `module` = 'api' AND `method` = 'getModel'; +DELETE FROM `zt_grouppriv` WHERE `module` = 'api' AND `method` = 'sql'; + +ALTER TABLE `zt_jenkins` CHANGE `password` `password` varchar(255) COLLATE 'utf8_general_ci' NOT NULL AFTER `account`; + +ALTER TABLE `zt_group` ADD `program` mediumint(8) unsigned NOT NULL DEFAULT 0 AFTER `id`; diff --git a/db/update12.3.3.sql b/db/update12.3.3.sql new file mode 100644 index 0000000000..1c7c403e41 --- /dev/null +++ b/db/update12.3.3.sql @@ -0,0 +1,5 @@ +ALTER TABLE `zt_doccontent` CHANGE `content` `content` longtext NOT NULL AFTER `digest`; + +update zt_storystage as a, zt_story as b set a.stage = 'closed', b.stage = 'closed' where a.story = b.id and b.status = 'closed'; + +update zt_story set stage = 'closed' where status = 'closed'; diff --git a/db/update12.4.2.sql b/db/update12.4.2.sql new file mode 100644 index 0000000000..b96b93ec99 --- /dev/null +++ b/db/update12.4.2.sql @@ -0,0 +1,3 @@ +update zt_story set `plan`='' where `plan`=0; + +ALTER TABLE `zt_compile` ADD `times` tinyint unsigned NOT NULL DEFAULT '0' AFTER `tag`; diff --git a/db/update12.4.sql b/db/update12.4.sql new file mode 100644 index 0000000000..86a1e93519 --- /dev/null +++ b/db/update12.4.sql @@ -0,0 +1 @@ +update zt_action set `project` = `extra` where action = 'unlinkedfromproject' and `project` = 0; diff --git a/db/zentao.sql b/db/zentao.sql index 8347368167..e55511f374 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -377,7 +377,7 @@ CREATE TABLE IF NOT EXISTS `zt_doccontent` ( `doc` mediumint(8) unsigned NOT NULL, `title` varchar(255) NOT NULL, `digest` varchar(255) NOT NULL, - `content` text NOT NULL, + `content` longtext NOT NULL, `files` text NOT NULL, `type` varchar(10) NOT NULL, `version` smallint(5) unsigned NOT NULL, @@ -478,7 +478,7 @@ CREATE TABLE IF NOT EXISTS `zt_file` ( -- DROP TABLE IF EXISTS `zt_group`; CREATE TABLE IF NOT EXISTS `zt_group` ( `id` mediumint(8) unsigned NOT NULL auto_increment, - `program` mediumint(8) NOT NULL DEFAULT '0', + `program` mediumint(8) unsigned NOT NULL DEFAULT 0, `name` char(30) NOT NULL, `role` char(30) NOT NULL default '', `desc` char(255) NOT NULL default '', @@ -557,7 +557,7 @@ CREATE TABLE IF NOT EXISTS `zt_jenkins` ( `name` varchar(50) NOT NULL, `url` varchar(255) DEFAULT NULL, `account` varchar(30) DEFAULT NULL, - `password` varchar(30) NOT NULL, + `password` varchar(255) NOT NULL, `token` varchar(255) DEFAULT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 7f960cef18..1fe556de6b 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,254 @@ +2020-08-10 12.4.1 +完成的需求 +5113 将华宇的大数据优化代码合并到主干版本中对外发布 +5028 计划、发布、版本关联需求bug页面实现分页功能 +5027 将action模块的create拆分 +修复的Bug +2480 统一我的地盘需求和产品需求下的文案 +2486 任务列表区块优先级长度优化 +2488 数据库字段属性是int,搜索条件使用0条件不生效 +2499 创建用例优先级默认问题 +2500 bug列表的简单表格样式里bug类型列不能自动调节宽度 +2502 编辑bug,解决版本丢失。 +2504 我的地盘中还可以对父任务操作开始、记录工时等动作 +2523 编辑测试单修改所属项目,项目下版本无法显示 +2525 用例设置相关需求为必填项,用例库还是可以创建用例 +2532 批量编辑任务提示总消耗不能为空 +2534 需求分解的任务创建子任务,树状图中子任务不显示 +2552 提示信息没有规范统一位置 +2553 title可以显示为中文标题 +2560 必填项相关需求后无法导入用例 +2564 测试任务关联需求逻辑错误 +2565 待办区块展示超过边界 +2574 创建用例的时候优先级默认是1 +2592 项目取消需求的关联,项目概况动态没有记录此操作 +3130 代码中CHANGELOG与官网发布的不一致 +3284 svn注释解决bug历史记录显示优化 +3293 用户不是多人任务当前指派人,人可以对任务进行批量操作 +3313 无法展示删除bug的动作 +3315 组织动态中会将去年同一天的操作展示为今天 +3324 在搜索的bug列表中指派后自动返回未搜索的页面 +3335 不勾选比较项直接进入比较差异页面有错误信息 +2818 密码强度检查不符 +3023 富文本编辑器超链接标题显示优化 +3295 发布关联需求可以连续关联需求多次 +3317 批量添加bug/项目任务/项目需求待办名称下拉部分遮挡 +3337 导入单元测试结果页面抄送给默认样式问题 + +2020-07-27 12.4.stable +修复的Bug +3196 内网快速开发平台第二期排版错行 +2784 用户可以修改他人记录的工时信息 +2785 用户可以修改他人待办内容 +2944 报表导出的饼状图图像不清晰 +2948 执行搜索之后点击左侧的模块,检索标签没有高亮 +2953 列表页选中时,会出现选不中的情况 +2957 需求分组下执行用例后显示为空 +2964 bug转为任务时,自定义的必填项未起效 +2973 项目概况的燃尽图展示日期数据错位 +2975 升级程序对数据库结构检查不彻底 +3279 搜索中输入null时无法按字符串处理 +2915 文档中插入的表格删除行后保存不生效 +2987 编辑器设置合并单元格后表格样式问题 +3016 一天发布多个版本,路线图显示不全 +3021 相关用例弹窗中删除操作后页面样式问题 +3055 某一次提交的全部比较功能异常 +3095 富文本编辑器图片空间功能异常 +3105 发布关联关闭需求后需求阶段显示为已发布 +3106 部门删除没有返回json的逻辑 +3119 用例编辑可以把待评审状态修改掉 +3133 编辑子需求时更改所属产品后,父需求列表不会跟着更改 +3166 使用任务工作管理方式时区块会显示bug和发布的统计 +3168 ALM8.8.1pro版本中手册页面跳转链接不对。 +3175 父需求修改所属产品后子需求还在原产品下 +3176 关闭状态的需求的阶段不是已关闭 +3188 子任务中有同名任务提示优化 +3189 先执行测试,再执行开发任务,需求阶段展示不正确 +3190 优化一下禅道邮件内容的样式 +3191 用户填写任务工时后,列表下方数据未更新,还需手动刷新页面才可更新 +3199 测试单修改起止时间后生成测试报告测试范围内容不更新 +3211 父子需求名称相同页面卡死 +3222 多分支、平台产品,创建bug页面只选择分支,没法通过模块上的分支标识查询 +3254 父需求可以批量关闭 +3256 批量创建需求不输入需求名称就可以直接保存 +3265 编辑待办不支持修改待办类型 +3267 搜索框中输入内容含有空格时页面报Bad Request错误 +3226 数字浙江反馈xss漏洞 +3111 禅道帮助手册显示优化 +2925 富文本编辑器中的表格添加列功能异常 +3069 关闭的任务编辑指派人问题 +2642 任务报表的每日完成统计统计,不能按照日期排序 +2873 创建富文本文档时,黏贴文档长度超过限制导致界面显示问题 +2956 用例执行失败转bug步骤和预实际情况的序号不对应 +2960 只关联某个产品分支的项目模块显示问题 +2962 测试单关联用例搜索功能保存搜索条件无效 +2967 通过编辑上传附件,历史记录中记录动作不正确 +2970 将创建发布的版本字段设置为必填没有起效 +2986 维护模块负责人后,新建bug时指派者没有自动显示 +3031 无产品和项目的时候增加的文档库无法看到 +3209 使用故事概念后无法显示用户需求和软件需求 +3235 项目管理员创建的公开项目在我的地盘中看不到 +3248 父需求标题不显示 +3252 用例导出的模版文件无法选择子需求 +3260 切换工作方式后测试单无法正常显示 +3277 触发动作详情页面返回上一级页面跳转错误 +3283 bug列表的影响版本会显示数字 +2513 文档功能上传图片附件优化 +2515 使用搜狗浏览器提示栏没有关闭按钮 +2920 产品区块数据统计不准确 +2950 二次开发数据库表展示页面有表没有显示描述 +2985 集成到zdoo后执行需求复制操作后一级导航会丢失 +2995 项目-任务模块设置显示产品模块设置后无效 +2996 需要评审的需求操作按钮有换行 +2999 项目测试单页面排版样式问题 +3005 测试单用例删除,测试单报表中的《按用例执行人统计表》中还是统计了删除的用例数据 +3007 项目维护模块空格显示异常 +3008 项目团队增加成员角色显示default +3017 未关联需求时项目看板页面不显示分组选项 +3018 后台-二次开发-数据库点击zt_im_queue字段页面报错 +3024 关联相关bug搜索功能异常 +3031 无产品和项目的时候增加的文档库无法看到 +3042 两个用户分别启动任务,历史记录会记录两次启动 +3052 项目导入bug时,如果bug已经在之前导入了任务,无法再次导入 +3053 谷歌浏览器下富文本编辑器Bug +3056 批量创建bug时所属类型下拉菜单不对 +3057 项目关联多个产品,选中某一个产品后无法取消模块选择 +3059 需求详情页面创建用例无法保存 +3063 测试-bug-导入弹窗显示整个页面 +3064 任务编辑页面可以将任务编辑为子任务+多人任务 +3075 测试报告页面中上传的附件无法在文档视图的附件库中查看 +3077 在零用例需求下创建用例不会自动关联需求 +3082 添加模块时填写&符合可以被解析 +3084 自定义 bug类型 第一次保存未验证格式规则 +3091 需求详情页面弹窗多层嵌套 +3101 批量关闭需求页面字段距离需要调整 +3108 禅道列表页面下拉滚动的时候页面不应该有这么高的空白 +3113 bug导入任务后,通过记录工时为0完成任务,不触发同步bug状态提示 +3114 一个项目还没关联需求,通过创建测试任务的时候勾选“选择测试需求”,会导致该任务无法关联需求 +3120 项目 - 需求批量创建用例页面,修改部门用例的相关需求,没有生效 +3121 多分支产品列表中阶段处下拉按钮方向请保持一致,均朝下。 +3124 需求api介绍文档中没有是否评审的变量展示 +3131 进入变更【用户需求】界面,页面“影响的用户需求”区域会加载全部软需 +3135 项目概况页面 剩余工时、项目进度展示不准确 +3141 关闭状态的子任务,编辑页面,父任务下拉框丢失默认值 +3143 截至日期显示样式不一致 +3147 输入重启服务命令后显示的启动信息中英文拼写错误 +3148 任务详情页点击需求,添加备注后关闭按钮消失 +3150 员工负载表显示的工作日天数不准确 +3151 修改密码时的提示语不合适 +3152 12.3 版本 多分支下需求阶段,上拉框不展示问题 +3153 需求编辑页面删除所属计划,需求的阶段还是已计划 +3159 测试单中标题颜色设置后不变 +3160 按影响版本搜索bug,条件选择包含无法自定义输入内容 +3161 ALM一键安装包从11.6.5升级到12.3.1后,后台自定义流程页面默认组合方式需修改下。 +3162 用例上传不显示标题 +3163 运维项目的提示需要修改一下 +3165 复制bug后,bug所属版本字段消失 +3167 直接完成任务时,没有记录实际开始时间 +3172 测试报告统计数据不一致 +3180 jenkins服务密码中使用@导致集成失败 +3182 项目主页拖动进行中的项目区块燃尽图消失 +3198 空文件上传问题 +3200 批量添加待办窗口关闭按钮显示问题 +3201 产品经理角色我的地盘用户需求和研发需求菜单建议调整下 +3203 测试单中按需求分组查看用例时移除按钮没有显示 +3209 使用故事概念后无法显示用户需求和软件需求 +3218 测试人员设置为项目受限用户后还可以编辑与自己无关的bug +3220 单元测试页面执行时间显示错误 +3235 项目管理员创建的公开项目在我的地盘中看不到 +3240 除项目管理员分组外的其他分组,大项目的权限建议初始化默认值 +3241 可访问项目下拉窗口有遮挡 +3246 大项目未写入对应的项目管理员的可管理项目中 +3248 父需求标题不显示 +3277 触发动作详情页面返回上一级页面跳转错误 +3126 用户反馈测试报告页面存在反射型xss漏洞 + +2020-07-02 12.3.3 +修复的Bug +2916 在php-fpm模式下 .htaccess 文件读取失败, 页面500错误 +2966 多人任务转交显示错误 +2969 创建需求页面添加计划页面报错 +2972 项目概况项目剩余工时统计异常 +3009 项目字段存在SQL注入的问题 +3010 处理file-module任意目录创建和逻辑绕过的问题 +3011 禅道-client-module-任意文件读取漏洞 +3015 禅道项目管理软件存在代码执行漏洞 +3032 11.6.2存在任意文件读取漏洞 +3033 11.6.2存在代码安全执行漏洞 +3034 11.6.3存在SQL注入漏洞 +3041 php日志报错定时任务启动报错 +3127 父需求不能关联进计划和项目 +3132 创建用例选择模块后可以关联到模块下已关闭的需求 +3137 父子需求关联进计划后排列顺序不对 +3138 referer跳转错误 +3139 用例失败转bug没有带入版本信息 +3140 可以创建无产品的版本 +3142 免密登录最后登录时间没有记录 +3145 编辑用户把所有权限分组都去掉保存后权限还在 +3146 超级管理员没有显示所有的动态 +3149 后台二次开发应用配置后调用客户端聊天相关函数报错没有权限 +3156 未登录用户可以直接使用图片链接查看图片 +3157 发布关联需求bug问题 +3169 项目-版本在解决bug弹窗中添加备注后没有关闭弹窗按钮 +3171 多分支产品提bug页面选择分支后所属项目必填项失效 +3177 必填验证逻辑错误 +3178 私有产品权限没有生效 +3179 提bug重现步骤中代码标签导出时被过滤掉了 +3183 集成钉钉工作消息通知拉取部门1588个后超时卡死 +3195 编辑用例界面中点击bug菜单,跳转地址有误 +3215 删除项目再次还原项目,项目团队成员的访问权限失效 +3223 构建任务会额外触发不满足条件的构建 +3236 上传危险类型的附件提示信息没有展示 + +2020-05-15 12.3.1 +完成的需求: +4827 debug关闭状态网页上不显示任何报错信息 +4807 后台增加对用户需求和软件需求流程的自定义功能 +4771 安装的时候修改session path为空的语言提示 +4767 将然之改为zdoo +4696 备份附件过程中记录文件的数量和文件的大小 +4668 子任务增加批量折叠和记忆功能 +4612 一键安装包默认的php内存改为512M +4545 用例详情页面默认全屏 +修复的Bug +2919 通过计划创建项目保存后页面空白 +2984 解决bug时填写解决版本设为必填项后,无法在解决页面创建版本 +2994 视图维护报错 +3019 解决在php7.4下面的语法兼容问题 +3030 客户端查看需求 - 报表,任务 - 报表 都报错 +3037 还原备份报错 +3048 多人任务转交按钮逻辑问题 +3050 产品视图首页的统计区块高亮的产品和右边的数据对不上 +3054 QQ浏览器支持不是很好 +3058 项目需求按照计划关联会把已经关闭的需求关联上 +3061 文档详情页面点击删除附件无反应 +3062 svn提交注释解析问题 +3066 编辑已关闭bug后指派用户会自动变为当前用户 +3067 任务复制页面比较大渲染时间容易超时 +3073 相关需求设置为必填项运维类型项目无法创建任务 +3074 私有项目修改项目负责人后没有项目访问权限 +3076 集成git库后同步代码库时卡住 +3080 父需求名称过长无法显示展开子需求按钮 +3081 用例关联需求选择弹窗样式问题 +3082 添加模块时填写&符合可以被解析 +3083 需求列表阶段下拉框被遮挡 +3086 在首页点击“然之协同”页面跳转到了禅道官网。 +3087 升级结果页面、首页相关logo需更新为最新logo。 +3092 完成任务时消耗工时检查问题 +3093 用例库用例列表的所属模块无法展示 +3094 开始任务时填写的备注信息无法显示 +3096 产品概况页面的路线图区块展示问题 +3098 无法导入大量测试用例 +3100 用例覆盖率的计算公式问题 +3102 提bug页面设置所属项目必填无效 +3103 创建项目超时 +3104 图片上传xss漏洞 +3107 多人任务关闭后重新激活指派人不生效 +3109 地盘指派给我的用例报错 +3110 软件需求编辑页面父需求下拉需要过滤用户需求 +3112 集成svn库报错 +3114 一个项目还没关联需求,通过创建测试任务的时候勾选“选择测试需求”,会导致该任务无法关联需求 + 2020-04-08 12.3 完成的需求: 4711 地址类型为GET时,导出用例提示没有数据 @@ -307,7 +558,25 @@ 2744 添加用户页面和修改密码页面存在密码明文传输 2748 禅道翻译功能,翻译日语时, 当翻译结果与原文一致时,无法保存。 2754 翻译功能,新手教程中,创建账号,创建产品与创建需求,对照翻译时,复制到所翻译语言中的变量没有作用 +2756 测试单新关联的用例无法执行 +2757 创建项目关联产品计划会把未关联产品的需求关联到项目中 +2758 开始、完成任务时添加的备注无法在历史记录中显示 +2760 批量创建用户时密码无法使用 +2761 路线图名称显示优化 +2762 后台-二次开-发数据库 喧喧相关表显示异常 +2763 关闭测试单页面报错 +2764 批量创建任务及任务编辑页面没有检查起止日期是否合法 +2765 添加链接文档访问报错 2767 翻译功能限制打开无效 +2768 我的地盘待办和组织用户待办状态正好相反 +2769 产品-需求编辑页面无法修改需求所处阶段 +2771 免密登录未进行时间戳的校验 +2772 未关闭的产品列表下展示的当前项目名称有误 +2773 产品同步到bug中的模块无法设置模块负责人 +2774 通过免密登录禅道不会记录登录系统的动态 +2776 测试报告导出后用例的链接错误 +2778 11.6.3版本上传.csv批量用例导入,提示没有数据错误 +2781 后台的数据备份显示大小错误 2019-09-24 11.6.3 修复的Bug: diff --git a/framework/base/control.class.php b/framework/base/control.class.php index 522f4071dc..f5227132f3 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -783,6 +783,7 @@ class baseControl $moduleControlFile = $modulePath . 'control.php'; $actionExtPath = $this->app->getModuleExtPath($appName, $moduleName, 'control'); $file2Included = $moduleControlFile; + $classNameToFetch = $moduleName; if(!empty($actionExtPath)) { @@ -802,6 +803,9 @@ class baseControl $siteActionExtFile = $actionExtPath['site'] . strtolower($methodName) . '.php'; $file2Included = file_exists($siteActionExtFile) ? $siteActionExtFile : $file2Included; } + + /* If class name is my{$moduleName} then set classNameToFetch for include this file. */ + if(strpos($file2Included, DS . 'ext' . DS) !== false and stripos(file_get_contents($file2Included), "class my{$moduleName} extends $moduleName") !== false) $classNameToFetch = "my{$moduleName}"; } /** @@ -809,7 +813,7 @@ class baseControl * Load the control file. */ if(!is_file($file2Included)) $this->app->triggerError("The control file $file2Included not found", __FILE__, __LINE__, $exit = true); - if(!class_exists($moduleName)) + if(!class_exists($classNameToFetch)) { chdir(dirname($file2Included)); helper::import($file2Included); diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 8d74464930..d3fe92955d 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -257,6 +257,7 @@ class baseHelper return "IN ('" . join("','", $idList) . "')"; } + if(!is_string($idList)) $idList = json_encode($idList); if(!function_exists('get_magic_quotes_gpc') or !get_magic_quotes_gpc()) $idList = addslashes($idList); return "IN ('" . str_replace(',', "','", str_replace(' ', '', $idList)) . "')"; } diff --git a/framework/control.class.php b/framework/control.class.php index 9be5847283..f15c322e18 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -33,11 +33,12 @@ class control extends baseControl { parent::__construct($moduleName, $methodName, $appName); - if(!defined('IN_INSTALL') and !defined('IN_UPGRADE')) $this->setConcept(); + if(defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api')) $this->setConcept(); if(!isset($this->config->bizVersion)) return false; + /* Code for task #9224. Set requiredFields for workflow. */ - if($this->dbh and $this->moduleName != 'upgrade' and $this->moduleName != 'install') + if($this->dbh and (defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api'))) { $this->checkRequireFlowField(); @@ -235,9 +236,8 @@ class control extends baseControl { if(!isset($this->config->bizVersion)) return false; - $flow = $this->loadModel('workflow')->getByModule($this->moduleName); - $action = $this->loadModel('workflowaction')->getByModuleAndAction($this->moduleName, $this->methodName); - if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID); + $moduleName = $this->moduleName; + return $this->$moduleName->executeHooks($objectID); } /** @@ -302,21 +302,48 @@ class control extends baseControl if(!isset($this->config->bizVersion)) return false; if(empty($_POST)) return false; - $fields = $this->loadModel('workflowaction')->getFields($this->moduleName, $this->methodName); - $layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName); - $notEmptyRule = $this->loadModel('workflowrule')->getByTypeAndRule('system', 'notempty'); + $fields = $this->loadModel('workflowaction')->getFields($this->moduleName, $this->methodName); + $layouts = $this->loadModel('workflowlayout')->getFields($this->moduleName, $this->methodName); + $rules = $this->dao->select('*')->from(TABLE_WORKFLOWRULE)->orderBy('id_desc')->fetchAll('id'); $requiredFields = ''; $mustPostFields = ''; $numberFields = ''; + $message = array(); foreach($fields as $field) { if($field->buildin or !$field->show or !isset($layouts[$field->field])) continue; - if($notEmptyRule && strpos(",$field->rules,", ",$notEmptyRule->id,") !== false) + + $fieldRules = explode(',', trim($field->rules, ',')); + $fieldRules = array_unique($fieldRules); + foreach($fieldRules as $ruleID) { - $requiredFields .= ",{$field->field}"; - if($field->control == 'radio' or $field->control == 'checkbox') $mustPostFields .= ",{$field->field}"; - if(strpos($field->type, 'int') !== false and $field->control == 'select') $numberFields .= ",{$field->field}"; + if(!isset($rules[$ruleID])) continue; + if(!empty($_POST[$field->field]) and !is_string($_POST[$field->field])) continue; + + $rule = $rules[$ruleID]; + if($rule->type == 'system' and $rule->rule == 'notempty') + { + $requiredFields .= ",{$field->field}"; + if($field->control == 'radio' or $field->control == 'checkbox') $mustPostFields .= ",{$field->field}"; + if(strpos($field->type, 'int') !== false and $field->control == 'select') $numberFields .= ",{$field->field}"; + } + elseif($rule->type == 'system' and isset($_POST[$field->field])) + { + $checkFunc = 'check' . $rule->rule; + if(!validater::$checkFunc($_POST[$field->field])) + { + $error = zget($this->lang->error, $rule->rule, ''); + if($error) $error = sprintf($error, $field->name); + if(empty($error)) $error = sprintf($this->lang->error->reg, $field->name, $rule->rule); + + $message[$field->field][] = $error; + } + } + elseif($rule->type == 'regex' and isset($_POST[$field->field])) + { + if(!validater::checkREG($_POST[$field->field], $rule->rule)) $message[$field->field][] = sprintf($this->lang->error->reg, $field->name, $rule->rule); + } } } @@ -324,7 +351,6 @@ class control extends baseControl { if(isset($this->config->{$this->moduleName}->{$this->methodName}->requiredFields)) $requiredFields .= ',' . $this->config->{$this->moduleName}->{$this->methodName}->requiredFields; - $message = array(); foreach(explode(',', $requiredFields) as $requiredField) { if(empty($requiredField)) continue; @@ -341,7 +367,7 @@ class control extends baseControl $message[$requiredField][] = sprintf($this->lang->error->notempty, $fields[$requiredField]->name); } } - if($message) $this->send(array('result' => 'fail', 'message' => $message)); } + if($message) $this->send(array('result' => 'fail', 'message' => $message)); } } diff --git a/framework/model.class.php b/framework/model.class.php index 5132163f4c..cef2e8ae7b 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -65,4 +65,53 @@ class model extends baseModel return $this->loadModel('workflowfield')->processSubStatus($module, $record); } + + /** + * Get flow extend fields. + * + * @access public + * @return array + */ + public function getFlowExtendFields() + { + if(!isset($this->config->bizVersion)) return array(); + + return $this->loadModel('flow')->getExtendFields($this->app->getModuleName(), $this->app->getMethodName()); + } + + /** + * Check flow rule. + * + * @param object $field + * @param string $value + * @access public + * @return bool|string + */ + public function checkFlowRule($field, $value) + { + if(!isset($this->config->bizVersion)) return false; + + return $this->loadModel('flow')->checkRule($field, $value); + } + + /** + * Execute Hooks + * + * @param int $objectID + * @access public + * @return void + */ + public function executeHooks($objectID) + { + if(!isset($this->config->bizVersion)) return false; + + $moduleName = $this->app->getModuleName(); + $methodName = $this->app->getMethodName(); + + $action = $this->loadModel('workflowaction')->getByModuleAndAction($moduleName, $methodName); + if(empty($action) or $action->extensionType == 'none') return false; + + $flow = $this->loadModel('workflow')->getByModule($moduleName); + if($flow && $action) $this->loadModel('workflowhook')->execute($flow, $action, $objectID); + } } diff --git a/framework/router.class.php b/framework/router.class.php index f36b924e2c..83da1f1909 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -47,6 +47,14 @@ class router extends baseRouter */ public $rawParams; + /** + * 原始URI + * + * @var string + * @access public + */ + public $rawURI; + /** * 标记是否是工作流 * Whether the tag is a workflow @@ -56,6 +64,18 @@ class router extends baseRouter */ public $isFlow = false; + /** + * Get the $moduleRoot var. + * + * @param string $appName + * @access public + * @return string + */ + public function getModuleRoot($appName = '') + { + return $this->moduleRoot; + } + /** * Merge system and translated langs. * @@ -106,7 +126,7 @@ class router extends baseRouter $commonSettings = array(); try { - $commonSettings = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND `module`='custom' and `key` in ('productProject','urAndSr','storyRequirement','hourPoint')")->fetchAll(); + $commonSettings = $this->dbh->query('SELECT `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND `module`='custom' and `key` in ('productProject','URAndSR','URSRName','storyRequirement','hourPoint')")->fetchAll(); } catch (PDOException $exception) { @@ -134,7 +154,13 @@ class router extends baseRouter if($setting->key == 'productProject') list($productCommon, $projectCommon) = explode('_', $setting->value); if($setting->key == 'storyRequirement') $storyCommon = $setting->value; if($setting->key == 'hourPoint') $hourCommon = $setting->value; - if($setting->key == 'urAndSr') $config->urAndSr = $setting->value; + if($setting->key == 'URAndSR') $URAndSR = $setting->value; + if($setting->key == 'URSRName') + { + $URSRName = json_decode($setting->value, true); + if(isset($URSRName['urCommon'][$this->clientLang])) $lang->urCommon = $URSRName['urCommon'][$this->clientLang]; + if(isset($URSRName['srCommon'][$this->clientLang])) $lang->srCommon = $URSRName['srCommon'][$this->clientLang]; + } } if($this->session->program) @@ -150,6 +176,19 @@ class router extends baseRouter $lang->projectCommon = isset($this->config->projectCommonList[$this->clientLang][(int)$projectCommon]) ? $this->config->projectCommonList[$this->clientLang][(int)$projectCommon] : $this->config->projectCommonList['en'][(int)$projectCommon]; $lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$storyCommon] : $this->config->storyCommonList['en'][(int)$storyCommon]; $lang->hourCommon = isset($this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon]) ? $this->config->hourPointCommonList[$this->clientLang][(int)$hourCommon] : $this->config->hourPointCommonList['en'][(int)$hourCommon]; + + if($storyCommon == 0 and isset($URAndSR)) + { + $config->URAndSR = $URAndSR; + if(!empty($URAndSR) and !empty($lang->srCommon)) $lang->storyCommon = $lang->srCommon; + } + } + + /* When module is custom then reset storyCommon. */ + if($moduleName == 'custom') + { + global $config; + $lang->storyCommon = isset($this->config->storyCommonList[$this->clientLang][(int)$config->storyCommon]) ? $this->config->storyCommonList[$this->clientLang][(int)$config->storyCommon] : $this->config->storyCommonList['en'][(int)$config->storyCommon]; } parent::loadLang($moduleName, $appName); @@ -328,6 +367,7 @@ class router extends baseRouter /* Check if the requested module is defined in workflow. */ $flow = $this->dbh->query("SELECT * FROM " . TABLE_WORKFLOW . " WHERE `module` = '$this->moduleName'")->fetch(); if(!$flow) return parent::setControlFile($exitIfNone); + if($flow->status != 'normal') die("{$this->lang->flowNotRelease}"); /** * 工作流中配置的标签应该请求browse方法,而某些内置流程本身包含browse方法。在这里处理请求的时候会无法区分是内置的browse方法还是工作 @@ -404,6 +444,8 @@ class router extends baseRouter */ public function setFlowURI($moduleName, $methodName) { + $this->rawURI = $this->URI; + $this->setModuleName($moduleName); $this->setMethodName($methodName); @@ -477,6 +519,25 @@ class router extends baseRouter if($this->get->display == 'card') $this->viewType = 'xhtml'; } + /** + * 获取$URL。 + * Get the $URL. + * + * @param bool $full true, the URI contains the webRoot, else only hte URI. + * @access public + * @return string + */ + public function getURI($full = false) + { + $URI = !empty($this->rawURI) ? $this->rawURI : $this->URI; + if($full and $this->config->requestType == 'PATH_INFO') + { + if($URI) return $this->config->webRoot . $URI . '.' . $this->viewType; + return $this->config->webRoot; + } + return $URI; + } + /** * 如果$this->isFlow的值为true,说明这个请求需要工作流引擎来处理,则要根据工作流引擎的需要重新设置参数。 * If the values of $this->isFlow is true, indicating that the request needs to be processed diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 1b48c4cf45..48503963ef 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1067,8 +1067,8 @@ class baseDAO { $table = strtolower($this->table); } - $fieldLabel = isset($lang->$table->$fieldName) ? $lang->$table->$fieldName : $fieldName; - $value = isset($this->sqlobj->data->$fieldName) ? $this->sqlobj->data->$fieldName : null; + $fieldLabel = isset($lang->$table->$fieldName) ? $lang->$table->$fieldName : $fieldName; + $value = isset($this->sqlobj->data->$fieldName) ? $this->sqlobj->data->$fieldName : null; /* * 检查唯一性。 @@ -1103,6 +1103,7 @@ class baseDAO { ${"arg$i"} = isset($funcArgs[$i + 2]) ? $funcArgs[$i + 2] : null; } + $checkFunc = 'check' . $funcName; if(validater::$checkFunc($value, $arg0, $arg1, $arg2) === false) { diff --git a/lib/base/filter/filter.class.php b/lib/base/filter/filter.class.php index aa2ed028ef..c748063809 100644 --- a/lib/base/filter/filter.class.php +++ b/lib/base/filter/filter.class.php @@ -330,7 +330,7 @@ class baseValidater */ public static function checkNotEmpty($var) { - return strlen(trim($var)) != 0; + return !empty($var); } /** @@ -989,7 +989,11 @@ class baseFixer $fields = $this->processFields($fieldName); foreach($fields as $fieldName) { - if(empty($this->stripedFields) or !isset($this->stripedFields[$fieldName])) $this->data->$fieldName = $this->specialArray($this->data->$fieldName); + if(empty($this->stripedFields) or !isset($this->stripedFields[$fieldName])) + { + $this->data->$fieldName = $this->specialArray($this->data->$fieldName); + $this->stripedFields[$fieldName] = $fieldName; + } } return $this; } diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 17a71b75bc..f6227fc3c6 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -800,6 +800,18 @@ class baseJS */ static public function alert($message = '', $full = true) { + global $app; + + if($app->viewType == 'json') + { + $output = array(); + $output['status'] = 'success'; + $output['data'] = json_encode(array('message' => $message)); + $output['md5'] = md5($output['data']); + + return json_encode($output); + } + return self::start($full) . "alert('" . $message . "')" . self::end() . self::resetForm(); } @@ -828,6 +840,18 @@ class baseJS */ static public function error($message, $full = true) { + global $app; + + if($app->viewType == 'json') + { + $output = array(); + $output['status'] = 'success'; + $output['data'] = json_encode(array('result' => 'fail', 'message' => $message)); + $output['md5'] = md5($output['data']); + + return json_encode($output); + } + $alertMessage = ''; if(is_array($message)) { @@ -871,6 +895,24 @@ class baseJS */ static public function confirm($message = '', $okURL = '', $cancleURL = '', $okTarget = "self", $cancleTarget = "self") { + global $app; + if($app->viewType == 'json') + { + $data = array(); + $data['message'] = $message; + $data['okURL'] = common::getSysURL() . $okURL; + $data['cancleURL'] = common::getSysURL() . $cancleURL; + $data['okTarget'] = $okTarget; + $data['cancleTarget'] = $cancleTarget; + + $output = array(); + $output['status'] = 'success'; + $output['data'] = json_encode($data); + $output['md5'] = md5($output['data']); + + return json_encode($output); + } + $js = self::start(); $confirmAction = ''; @@ -919,6 +961,8 @@ EOT; */ static public function locate($url, $target = "self") { + global $app; + /* If the url if empty, goto the home page. */ if(!$url) { @@ -926,6 +970,18 @@ EOT; $url = $config->webRoot; } + if($app->viewType == 'json') + { + $data = strtolower($url) == 'back' ? array('locate' => 'back') : array('locate' => common::getSysURL() . $url); + + $output = array(); + $output['status'] = 'success'; + $output['data'] = json_encode($data); + $output['md5'] = md5($output['data']); + + return json_encode($output); + } + $js = self::start(); if(strtolower($url) == "back") { diff --git a/lib/dingapi/dingapi.class.php b/lib/dingapi/dingapi.class.php index fad581588e..f60eb7dabe 100644 --- a/lib/dingapi/dingapi.class.php +++ b/lib/dingapi/dingapi.class.php @@ -47,22 +47,29 @@ class dingapi } /** - * Get all users. + * Get users. * + * @param string $selectedDepts * @access public * @return array */ - public function getAllUsers() + public function getUsers($selectedDepts = '') { - $depts = $this->getAllDepts(); - if($this->isError()) return array('result' => 'fail', 'message' => $this->errors); + $depts = trim($selectedDepts); + if(empty($depts)) return array('result' => 'fail', 'message' => 'nodept'); set_time_limit(0); $users = array(); - foreach($depts as $deptID => $deptName) + foreach(explode(',', $depts) as $deptID) { + if(empty($deptID)) continue; + $response = $this->queryAPI($this->apiUrl . "user/simplelist?access_token={$this->token}&department_id={$deptID}"); - if($this->isError()) continue; + if($this->isError()) + { + $this->getErrors(); + continue; + } foreach($response->userlist as $user) $users[$user->name] = $user->userid; } @@ -71,19 +78,39 @@ class dingapi } /** - * Get all depts. + * Get dept tree. * * @access public * @return array */ - public function getAllDepts() + public function getDeptTree() { $response = $this->queryAPI($this->apiUrl . "department/list?access_token={$this->token}"); - if($this->isError()) return false; + if($this->isError()) return array('result' => 'fail', 'message' => $this->errors); - $deptPairs = array(); - foreach($response->department as $dept) $deptPairs[$dept->id] = $dept->name; - return $deptPairs; + $parentDepts = array(); + foreach($response->department as $dept) + { + $parentID = isset($dept->parentid) ? $dept->parentid : 0; + $parentDepts[$parentID][$dept->id] = $dept->name; + } + + $tree = array(); + foreach($parentDepts as $parentID => $depts) + { + foreach($depts as $deptID => $deptName) + { + $node = array(); + $node['id'] = $deptID; + $node['pId'] = $parentID; + $node['name'] = $deptName; + if($parentID == 0) $node['open'] = true; + + $tree[] = $node; + } + } + + return array('result' => 'success', 'data' => $tree); } /** diff --git a/lib/filter/filter.class.php b/lib/filter/filter.class.php index 7a24ee06cd..3c92af1281 100644 --- a/lib/filter/filter.class.php +++ b/lib/filter/filter.class.php @@ -60,6 +60,7 @@ class fixer extends baseFixer } if($canImplode) $this->data->$field = implode(',', $value); } + if(isset($flowFields[$field]) and $flowFields[$field]->control == 'textarea') $this->skipSpecial($field); $this->specialChars($field); } diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 04ed5837b8..2fb420bc1e 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -164,13 +164,29 @@ class html extends baseHTML $id = "id='{$id}'"; if(strpos($attrib, 'id=') !== false) $id = ''; - $string = "\n"; /* The options. */ - global $config; if(is_array($selectedItems)) $selectedItems = implode(',', $selectedItems); $selectedItems = ",$selectedItems,"; - $convertedPinYin = (empty($config->isINT) and class_exists('common')) ? common::convert2Pinyin($options) : array(); foreach($options as $key => $value) { $optionPinyin = zget($convertedPinYin, $value, ''); diff --git a/lib/phpmailer/class.smtp.php b/lib/phpmailer/class.smtp.php index e00ad79c4b..ec9026ae25 100644 --- a/lib/phpmailer/class.smtp.php +++ b/lib/phpmailer/class.smtp.php @@ -481,7 +481,7 @@ class SMTP { $max_line_length = 998; // used below; set here for ease in change - while(list(,$line) = each($lines)) { + foreach($lines as $line) { $lines_out = null; if($line == "" && $in_headers) { $in_headers = false; @@ -510,7 +510,7 @@ class SMTP { $lines_out[] = $line; // send the lines to the server - while(list(,$line_out) = each($lines_out)) { + foreach($lines_out as $line_out) { if(strlen($line_out) > 0) { if(substr($line_out, 0, 1) == ".") { diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 304c9dbce3..7f30f2e0d8 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -328,6 +328,19 @@ class GitRepo return $info; } + /** + * Exec git cmd. + * + * @param string $cmd + * @access public + * @return array + */ + public function exec($cmd) + { + chdir($this->root); + return execCmd(escapeCmd("$this->client $cmd"), 'array'); + } + /** * Parse diff. * diff --git a/lib/scm/scm.class.php b/lib/scm/scm.class.php index ed1ae252ce..c2818a6f3a 100644 --- a/lib/scm/scm.class.php +++ b/lib/scm/scm.class.php @@ -141,6 +141,18 @@ class scm return $this->engine->info($entry, $revision); } + /** + * Exec scm cmd. + * + * @param string $cmd + * @access public + * @return array + */ + public function exec($cmd) + { + return $this->engine->exec($cmd); + } + /** * Get commit count * diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index ac7afb777e..07465cc5c0 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -8,6 +8,7 @@ class Subversion public $ssh; public $remote; public $encoding; + public $svnVersion; /** * Construct @@ -23,7 +24,7 @@ class Subversion public function __construct($client, $root, $account, $password, $encoding = 'UTF-8') { putenv('LC_CTYPE=en_US.UTF-8'); - $this->root = str_replace(array('%3A', '%2F'), array(':', '/'), urlencode(rtrim($root, '/'))); + $this->root = str_replace(array('%3A', '%2F', '+'), array(':', '/', ' '), urlencode(rtrim($root, '/'))); $this->account = $account; $this->password = $password; $this->encoding = $encoding; @@ -31,6 +32,8 @@ class Subversion $this->remote = !(stripos($this->root, 'file') === 0); $this->client = $this->remote ? $client . " --username @account@ --password @password@" : $client; if($this->encoding == 'utf-8') $this->encoding = 'gbk'; + + $this->svnVersion = $this->getSVNVersion($client); } /** @@ -44,7 +47,7 @@ class Subversion public function ls($path, $revision = 'HEAD') { $resourcePath = $path; - $path = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($path)) . '"'; + $path = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($path)) . '"'; $cmd = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'ls', "-r $revision --xml"))); $list = execCmd($cmd, 'string', $result); if($result) @@ -142,7 +145,7 @@ class Subversion public function getLastLog($path, $count = 10) { $resourcePath = $path; - $path = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($path)) . '"'; + $path = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($path)) . '"'; $cmd = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'log', "--limit $count --xml"))); $comments = execCmd($cmd, 'string', $result); if($result) @@ -195,7 +198,7 @@ class Subversion $resourcePath = $path; $count = $count == 0 ? '' : "--limit $count"; $param = $quiet ? '-q' : '-v'; - $path = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($path)) . '"'; + $path = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($path)) . '"'; $cmd = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'log', "$count $param -r $fromRevision:$toRevision --xml"))); $comments = execCmd($cmd, 'string', $result); if($result) @@ -256,7 +259,7 @@ class Subversion public function blame($path, $revision) { $resourcePath = $path; - $path = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($path)) . '"'; + $path = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($path)) . '"'; $file = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'cat', "-r $revision"))); $blame = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'blame', "-r $revision --xml"))); $output = execCmd($blame, 'string', $result); @@ -326,7 +329,7 @@ class Subversion { $resourcePath = $path; if($fromRevision == '^') $fromRevision = $toRevision - 1; - $path = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($path)) . '"'; + $path = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($path)) . '"'; $cmd = $this->replaceAuth(escapeCmd($this->buildCMD($path, 'diff', "-r $fromRevision:$toRevision"))); $lines = execCmd($cmd, 'array', $result); if($result) @@ -349,7 +352,7 @@ class Subversion public function cat($entry, $revision = 'HEAD') { $resourcePath = $entry; - $entry = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($entry)) . '"'; + $entry = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($entry)) . '"'; $cmd = $this->replaceAuth(escapeCmd($this->buildCMD($entry, 'cat', "-r $revision"))); $content = execCmd($cmd, 'string', $result); if($result) @@ -372,7 +375,7 @@ class Subversion public function info($entry, $revision = 'HEAD') { $resourcePath = $entry; - $entry = '"' . $this->root . '/' . str_replace('%2F', '/', urlencode($entry)) . '"'; + $entry = '"' . $this->root . '/' . str_replace(array('%2F', '+'), array('/', ' '), urlencode($entry)) . '"'; $svnInfo = $this->replaceAuth(escapeCmd($this->buildCMD($entry, 'info', "-r $revision --xml"))); $svninfo = execCmd($svnInfo, 'string', $result); @@ -400,6 +403,19 @@ class Subversion return $info; } + /** + * Exec svn cmd. + * + * @param string $cmd + * @access public + * @return array + */ + public function exec($cmd) + { + $cmd = $this->replaceAuth(escapeCmd($this->buildCMD('', $cmd, ''))); + return execCmd($cmd, 'array'); + } + /** * Parse diff. * @@ -552,6 +568,7 @@ class Subversion if(stripos($this->root, 'https') === 0 or stripos($this->root, 'svn') === 0) { $comments = str_replace("\\", "/", "$this->client log $count -v -r $version:0 --non-interactive --trust-server-cert-failures=cn-mismatch --trust-server-cert --no-auth-cache --xml $path"); + if($this->svnVersion and version_compare($this->svnVersion, '1.9', '<')) $comments = str_replace("\\", "/", "$this->client log $count -v -r $version:0 --non-interactive --trust-server-cert --no-auth-cache --xml $path"); } else { @@ -619,6 +636,7 @@ class Subversion if($this->ssh) { $cmd = str_replace("\\", "/", "$this->client $action $param --non-interactive --trust-server-cert-failures=cn-mismatch --trust-server-cert --no-auth-cache $path"); + if($this->svnVersion and version_compare($this->svnVersion, '1.9', '<')) $cmd = str_replace("\\", "/", "$this->client $action $param --non-interactive --trust-server-cert --no-auth-cache $path"); } else { @@ -627,4 +645,20 @@ class Subversion return $cmd; } + + /** + * Get SVN version. + * + * @param string $client + * @access public + * @return string + */ + public function getSVNVersion($client) + { + $versionCommand = "$client --version --quiet 2>&1"; + exec($versionCommand, $versionOutput, $versionResult); + if($versionResult) return false; + + return end($versionOutput); + } } diff --git a/lib/zfile/zfile.class.php b/lib/zfile/zfile.class.php index 71ad07ce14..41e1261af2 100644 --- a/lib/zfile/zfile.class.php +++ b/lib/zfile/zfile.class.php @@ -16,50 +16,108 @@ class zfile * * @param string $from * @param string $to - * @param bool $showDetails + * @param bool $logLevel + * @param string $logFile * @access public - * @return array copied files. + * @return array copied files, count, size or message. */ - public function copyDir($from, $to, $showDetails = true) + public function copyDir($from, $to, $logLevel = false, $logFile = '') { static $copiedFiles = array(); + static $errorFiles = array(); $count = $size = 0; - if(!is_dir($from) or !is_readable($from)) return array($copiedFiles, $count, $size); - if(!is_dir($to)) + $log['copiedFiles'] = array(); + $log['count'] = 0; + $log['size'] = 0; + + if(!is_dir($from) or !is_readable($from)) { - if(!is_writable(dirname($to))) return array($copiedFiles, $count, $size); - mkdir($to); + if(!is_dir($from)) $log['message'] = "$from: Dir is not exists"; + if(!is_readable($from)) $log['message'] = "$from: Permission denied"; } + if(!is_dir($to) and !@mkdir($to, 0777, true)) $log['message'] = "$to: Permission denied"; + if(is_dir($to) and !is_writeable($to)) $log['message'] = "$to: Permission denied"; + if($logFile and !file_exists($logFile)) touch($logFile); + if(!empty($log['message'])) return $log; + + $from = realpath($from) . '/'; + $to = realpath($to) . '/'; - $from = realpath($from) . '/'; - $to = realpath($to) . '/'; $entries = scandir($from); - foreach($entries as $entry) { - if($entry == '.' or $entry == '..' or $entry == '.svn') continue; + if($entry == '.' or $entry == '..' or $entry == '.svn' or $entry == '.git') continue; $fullEntry = $from . $entry; if(is_file($fullEntry)) { if(file_exists($to . $entry)) unlink($to . $entry); - copy($fullEntry, $to . $entry); - if($showDetails) $copiedFiles[] = $to . $entry; - $count += 1; - $size += filesize($fullEntry); + if(copy($fullEntry, $to . $entry)) + { + if($logLevel) $copiedFiles[] = $to . $entry; + $count += 1; + $size += filesize($fullEntry); + + if($logFile and file_exists($logFile)) + { + $summary = json_decode(file_get_contents($logFile), true); + + if(empty($summary)) $summary = array(); + if(empty($summary['count'])) $summary['count'] = 0; + $summary['count'] += 1; + + file_put_contents($logFile, json_encode($summary)); + } + } + else + { + $errorFiles[] = $fullEntry; + } } else { - $nextFrom = $from . $entry; + $nextFrom = $fullEntry; $nextTo = $to . $entry; - $result = $this->copyDir($nextFrom, $nextTo, $showDetails); - $count += $result[1]; - $size += $result[2]; + $result = $this->copyDir($nextFrom, $nextTo, $logLevel, $logFile); + $count += $result['count']; + $size += $result['size']; } } - return array($copiedFiles, $count, $size); + + if($logLevel) $log['copiedFiles'] = $copiedFiles; + $log['errorFiles'] = $errorFiles; + $log['count'] = $count; + $log['size'] = $size; + $log['logFile'] = $logFile; + + return $log; + } + + /** + * Get count. + * + * @param string $dir + * @access public + * @return int + */ + public function getCount($dir) + { + if(!file_exists($dir)) return 0; + if(is_file($dir)) return 1; + + $count = 0; + $entries = scandir($dir); + foreach($entries as $entry) + { + if($entry == '.' or $entry == '..' or $entry == '.svn' or $entry == '.git') continue; + + $fullEntry = $dir . '/' . $entry; + $count += $this->getCount($fullEntry); + } + + return $count; } /** diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 42d458974e..ad6a983fe8 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -236,7 +236,6 @@ $lang->action->dynamicAction->todo['erased'] = 'Delete Todo'; $lang->action->dynamicAction->todo['finished'] = 'Finish Todo'; $lang->action->dynamicAction->todo['activated'] = 'Activate Todo'; $lang->action->dynamicAction->todo['closed'] = 'Close Todo'; -$lang->action->dynamicAction->todo['deleted'] = 'Delete Todo'; $lang->action->dynamicAction->todo['assigned'] = 'Assign Todo'; $lang->action->dynamicAction->todo['undeleted'] = 'Restore Todo'; $lang->action->dynamicAction->todo['hidden'] = 'Hide Todo'; @@ -323,6 +322,7 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = 'Confirm Bug'; $lang->action->dynamicAction->bug['resolved'] = 'Resolve Bug'; $lang->action->dynamicAction->bug['undeleted'] = 'Restore Bug'; $lang->action->dynamicAction->bug['hidden'] = 'Hide Bug'; +$lang->action->dynamicAction->bug['deleted'] = 'Delete Bug'; $lang->action->dynamicAction->bug['confirmed'] = 'Confirm Story Change'; $lang->action->dynamicAction->bug['tostory'] = 'Convert to Story'; $lang->action->dynamicAction->bug['totask'] = 'Convert to Task'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index fd92c5456e..d00da21068 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -236,7 +236,6 @@ $lang->action->dynamicAction->todo['erased'] = 'Delete Todo'; $lang->action->dynamicAction->todo['finished'] = 'Finish Todo'; $lang->action->dynamicAction->todo['activated'] = 'Activate Todo'; $lang->action->dynamicAction->todo['closed'] = 'Close Todo'; -$lang->action->dynamicAction->todo['deleted'] = 'Delete Todo'; $lang->action->dynamicAction->todo['assigned'] = 'Assign Todo'; $lang->action->dynamicAction->todo['undeleted'] = 'Restore Todo'; $lang->action->dynamicAction->todo['hidden'] = 'Hide Todo'; @@ -323,6 +322,7 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = 'Confirm Bug'; $lang->action->dynamicAction->bug['resolved'] = 'Resolve Bug'; $lang->action->dynamicAction->bug['undeleted'] = 'Restore Bug'; $lang->action->dynamicAction->bug['hidden'] = 'Hide Bug'; +$lang->action->dynamicAction->bug['deleted'] = 'Delete Bug'; $lang->action->dynamicAction->bug['confirmed'] = 'Confirm Story Change'; $lang->action->dynamicAction->bug['tostory'] = 'Convert to Story'; $lang->action->dynamicAction->bug['totask'] = 'Convert to Task'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index f31752eea1..71178150c4 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -137,15 +137,15 @@ $lang->action->desc->linkchildtask = '$date, $actor a racc $lang->action->desc->unlinkchildrentask = '$date, $actor a décroché une sous-tâche $extra。' . "\n"; $lang->action->desc->linkparenttask = '$date, $actor a accroché une tâche parent $extra。' . "\n"; $lang->action->desc->unlinkparenttask = '$date, $actor a décroché une tâche parent $extra。' . "\n"; -$lang->action->desc->deletechildrentask = '$date, $actor deleted a child task $extra。' . "\n"; +$lang->action->desc->deletechildrentask = '$date, $actor a supprimé une sous-tâche $extra。' . "\n"; /* 用来描述和父子需求相关的操作历史记录。*/ -$lang->action->desc->createchildrenstory = '$date, $actor created a child story $extra。' . "\n"; -$lang->action->desc->linkchildstory = '$date, $actor linked a child story $extra。' . "\n"; -$lang->action->desc->unlinkchildrenstory = '$date, $actor unlinked a child story $extra。' . "\n"; -$lang->action->desc->linkparentstory = '$date, $actor linked to a parent story $extra。' . "\n"; -$lang->action->desc->unlinkparentstory = '$date, $actor unlinked a parent story $extra。' . "\n"; -$lang->action->desc->deletechildrenstory = '$date, $actor deleted a child story $extra。' . "\n"; +$lang->action->desc->createchildrenstory = '$date, $actor a créé une sous-tory $extra。' . "\n"; +$lang->action->desc->linkchildstory = '$date, $actor a raccroché une sous-story $extra。' . "\n"; +$lang->action->desc->unlinkchildrenstory = '$date, $actor a décroché une sous-story $extra。' . "\n"; +$lang->action->desc->linkparentstory = '$date, $actor a raccroché à une story parent $extra。' . "\n"; +$lang->action->desc->unlinkparentstory = '$date, $actor a décroché de la story parent $extra。' . "\n"; +$lang->action->desc->deletechildrenstory = '$date, $actor a supprimé une sous-story $extra。' . "\n"; /* 关联用例和移除用例时的历史操作记录。*/ $lang->action->desc->linkrelatedcase = '$date, $actor a fait le lien avec un CasTest $extra.' . "\n"; @@ -178,8 +178,8 @@ $lang->action->label->frombug = 'a converti du Bug '; $lang->action->label->fromlib = 'a importé de la Library '; $lang->action->label->totask = 'a converti en Tâche '; $lang->action->label->svncommited = 'a committé SVN '; -$lang->action->label->gitcommited = 'a committé Git '; -$lang->action->label->linked2plan = 'a racordé au Plan '; +$lang->action->label->gitcommited = 'a committé GIT '; +$lang->action->label->linked2plan = 'a raccordé au Plan '; $lang->action->label->unlinkedfromplan = 'a extrait du plan '; $lang->action->label->changestatus = 'a changé le statut '; $lang->action->label->marked = 'a marqué'; @@ -218,13 +218,13 @@ $lang->action->label->unlinkparenttask = "a décroché de la tâche parent"; $lang->action->label->batchcreate = "a créé tâches par lot"; $lang->action->label->createchildren = "a créé sous-tâches par lot"; $lang->action->label->managed = "a managé"; -$lang->action->label->deletechildrentask = "delete children task"; -$lang->action->label->createchildrenstory = "create child stories"; -$lang->action->label->linkchildstory = "linked a child story"; -$lang->action->label->unlinkchildrenstory = "unlinked a child story"; -$lang->action->label->linkparentstory = "linked a parent story"; -$lang->action->label->unlinkparentstory = "unlink from parent story"; -$lang->action->label->deletechildrenstory = "delete children story"; +$lang->action->label->deletechildrentask = "a supprimé une sous-tâche"; +$lang->action->label->createchildrenstory = "a créé une sous-story"; +$lang->action->label->linkchildstory = "a raccroché à une sous-story"; +$lang->action->label->unlinkchildrenstory = "a décroché de la sous-story"; +$lang->action->label->linkparentstory = "a raccroché à une story parent"; +$lang->action->label->unlinkparentstory = "a décroché de la story parent"; +$lang->action->label->deletechildrenstory = "a supprimé la sous-story"; $lang->action->label->tracked = 'tracked'; $lang->action->label->hangup = 'hangup'; @@ -236,7 +236,6 @@ $lang->action->dynamicAction->todo['erased'] = 'Détruire Todo'; $lang->action->dynamicAction->todo['finished'] = 'Finir Todo'; $lang->action->dynamicAction->todo['activated'] = 'Activer Todo'; $lang->action->dynamicAction->todo['closed'] = 'Fermer Todo'; -$lang->action->dynamicAction->todo['deleted'] = 'Suppr Todo'; $lang->action->dynamicAction->todo['assigned'] = 'Assigner Todo'; $lang->action->dynamicAction->todo['undeleted'] = 'Restaurer Todo'; $lang->action->dynamicAction->todo['hidden'] = 'Masquer Todo'; @@ -302,15 +301,15 @@ $lang->action->dynamicAction->task['unlinkparenttask'] = 'Délier Tâche Par $lang->action->dynamicAction->task['deletechildrentask'] = 'Delete children task'; $lang->action->dynamicAction->task['linkparenttask'] = 'Lier Tâche Parent'; $lang->action->dynamicAction->task['linkchildtask'] = 'Lier sous-tâche'; -$lang->action->dynamicAction->task['createchildrenstory'] = 'Create Child Story'; -$lang->action->dynamicAction->task['unlinkparentstory'] = 'Unlink Parent Story'; -$lang->action->dynamicAction->task['deletechildrenstory'] = 'Delete children story'; -$lang->action->dynamicAction->task['linkparentstory'] = 'Link Parent Story'; -$lang->action->dynamicAction->task['linkchildstory'] = 'Link Child Story'; +$lang->action->dynamicAction->task['createchildrenstory'] = 'Créer sous-story'; +$lang->action->dynamicAction->task['unlinkparentstory'] = 'Délier Story Parent'; +$lang->action->dynamicAction->task['deletechildrenstory'] = 'Supprimer sous-story'; +$lang->action->dynamicAction->task['linkparentstory'] = 'Lier Story Parent'; +$lang->action->dynamicAction->task['linkchildstory'] = 'Lier sous-Story'; $lang->action->dynamicAction->task['undeleted'] = 'Restaurer Tâche'; $lang->action->dynamicAction->task['hidden'] = 'Masquer Tâche'; -$lang->action->dynamicAction->task['svncommited'] = 'SVN Commit'; -$lang->action->dynamicAction->task['gitcommited'] = 'GIT Commit'; +$lang->action->dynamicAction->task['svncommited'] = 'Committer SVN'; +$lang->action->dynamicAction->task['gitcommited'] = 'Committer GIT'; $lang->action->dynamicAction->build['opened'] = 'Créer Build'; $lang->action->dynamicAction->build['edited'] = 'Editer Build'; @@ -323,7 +322,8 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = 'Confirmer Bug'; $lang->action->dynamicAction->bug['resolved'] = 'Resolu Bug'; $lang->action->dynamicAction->bug['undeleted'] = 'Restaurer Bug'; $lang->action->dynamicAction->bug['hidden'] = 'Masquer Bug'; -$lang->action->dynamicAction->bug['confirmed'] = 'Confirme Chang Story'; +$lang->action->dynamicAction->bug['deleted'] = 'Supprimé Bug'; +$lang->action->dynamicAction->bug['confirmed'] = 'Confirme Chang.Story'; $lang->action->dynamicAction->bug['tostory'] = 'Converti en Story'; $lang->action->dynamicAction->bug['totask'] = 'Converti en Tâche'; $lang->action->dynamicAction->bug['linked2plan'] = 'Lié au Plan'; @@ -377,7 +377,7 @@ $lang->action->dynamicAction->user['login'] = 'Connexion'; $lang->action->dynamicAction->user['logout'] = 'Déconnexion'; $lang->action->dynamicAction->user['undeleted'] = 'Restaure User'; $lang->action->dynamicAction->user['hidden'] = 'Masquer User'; -$lang->action->dynamicAction->user['loginxuanxuan'] = 'Login Desktop'; +$lang->action->dynamicAction->user['loginxuanxuan'] = 'Connexion Desktop'; $lang->action->dynamicAction->entry['created'] = 'Ajouter Application'; $lang->action->dynamicAction->entry['edited'] = 'Editer Application'; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index c719b20d01..5d7e06eef1 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -236,7 +236,6 @@ $lang->action->dynamicAction->todo['erased'] = 'Xóa việc làm'; $lang->action->dynamicAction->todo['finished'] = 'Kết thúc việc làm'; $lang->action->dynamicAction->todo['activated'] = 'Kích hoạt việc làm'; $lang->action->dynamicAction->todo['closed'] = 'Đóng việc làm'; -$lang->action->dynamicAction->todo['deleted'] = 'Xóa việc làm'; $lang->action->dynamicAction->todo['assigned'] = 'Bàn giao việc làm'; $lang->action->dynamicAction->todo['undeleted'] = 'Khôi phục việc làm'; $lang->action->dynamicAction->todo['hidden'] = 'Ẩn việc làm'; @@ -323,6 +322,7 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = 'Xác nhận Bug'; $lang->action->dynamicAction->bug['resolved'] = 'Giải quyết Bug'; $lang->action->dynamicAction->bug['undeleted'] = 'Khôi phục Bug'; $lang->action->dynamicAction->bug['hidden'] = 'Ẩn Bug'; +$lang->action->dynamicAction->bug['deleted'] = 'Xóa tìBug'; $lang->action->dynamicAction->bug['confirmed'] = 'Xác nhận thay đổi câu chuyện'; $lang->action->dynamicAction->bug['tostory'] = 'Chuyển thành câu chuyện'; $lang->action->dynamicAction->bug['totask'] = 'Chuyển thành nhiệm vụ'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index ee5b61aca7..61d3321531 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -236,7 +236,6 @@ $lang->action->dynamicAction->todo['erased'] = '删除待办'; $lang->action->dynamicAction->todo['finished'] = '完成待办'; $lang->action->dynamicAction->todo['activated'] = '激活待办'; $lang->action->dynamicAction->todo['closed'] = '关闭待办'; -$lang->action->dynamicAction->todo['deleted'] = '删除待办'; $lang->action->dynamicAction->todo['assigned'] = '指派待办'; $lang->action->dynamicAction->todo['undeleted'] = '还原待办'; $lang->action->dynamicAction->todo['hidden'] = '隐藏待办'; @@ -323,6 +322,7 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = '确认Bug'; $lang->action->dynamicAction->bug['resolved'] = '解决Bug'; $lang->action->dynamicAction->bug['undeleted'] = '还原Bug'; $lang->action->dynamicAction->bug['hidden'] = '隐藏Bug'; +$lang->action->dynamicAction->bug['deleted'] = '删除Bug'; $lang->action->dynamicAction->bug['confirmed'] = "确认{$lang->storyCommon}变更"; $lang->action->dynamicAction->bug['tostory'] = "转{$lang->storyCommon}"; $lang->action->dynamicAction->bug['totask'] = '转任务'; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index 1718c581d3..6c97960673 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -235,7 +235,6 @@ $lang->action->dynamicAction->todo['erased'] = '刪除待辦'; $lang->action->dynamicAction->todo['finished'] = '完成待辦'; $lang->action->dynamicAction->todo['activated'] = '激活待辦'; $lang->action->dynamicAction->todo['closed'] = '關閉待辦'; -$lang->action->dynamicAction->todo['deleted'] = '刪除待辦'; $lang->action->dynamicAction->todo['assigned'] = '指派待辦'; $lang->action->dynamicAction->todo['undeleted'] = '還原待辦'; $lang->action->dynamicAction->todo['hidden'] = '隱藏待辦'; @@ -322,6 +321,7 @@ $lang->action->dynamicAction->bug['bugconfirmed'] = '確認Bug'; $lang->action->dynamicAction->bug['resolved'] = '解決Bug'; $lang->action->dynamicAction->bug['undeleted'] = '還原Bug'; $lang->action->dynamicAction->bug['hidden'] = '隱藏Bug'; +$lang->action->dynamicAction->bug['deleted'] = '刪除Bug'; $lang->action->dynamicAction->bug['confirmed'] = "確認{$lang->storyCommon}變更"; $lang->action->dynamicAction->bug['tostory'] = "轉{$lang->storyCommon}"; $lang->action->dynamicAction->bug['totask'] = '轉任務'; diff --git a/module/action/model.php b/module/action/model.php index 3994659793..9ad34a1a44 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -51,18 +51,21 @@ class actionModel extends model $action->comment = fixer::stripDataTags($comment); /* Process action. */ - $action = $this->loadModel('file')->processImgURL($action, 'comment', $this->post->uid); - if($autoDelete) $this->file->autoDelete($this->post->uid); + if($this->post->uid) + { + $action = $this->loadModel('file')->processImgURL($action, 'comment', $this->post->uid); + if($autoDelete) $this->file->autoDelete($this->post->uid); + } /* Get product and project for this object. */ $productAndProject = $this->getProductAndProject($action->objectType, $objectID); $action->product = $productAndProject['product']; - $action->project = (int) $productAndProject['project']; + $action->project = $actionType == 'unlinkedfromproject' ? (int)$extra : (int)$productAndProject['project']; $this->dao->insert(TABLE_ACTION)->data($action)->autoCheck()->exec(); $actionID = $this->dbh->lastInsertID(); - $this->file->updateObjectID($this->post->uid, $objectID, $objectType); + if($this->post->uid) $this->file->updateObjectID($this->post->uid, $objectID, $objectType); $this->loadModel('message')->send($objectType, $objectID, $actionType, $actionID, $actor); @@ -370,7 +373,7 @@ class actionModel extends model } } } - elseif(($actionName == 'opened' or $actionName == 'managed') and $objectType == 'project') + elseif(($actionName == 'opened' or $actionName == 'managed' or $actionName == 'edited') and $objectType == 'project') { $linkedProducts = $this->dao->select('id,name')->from(TABLE_PRODUCT)->where('id')->in($action->extra)->fetchPairs('id', 'name'); $action->extra = ''; @@ -677,6 +680,8 @@ class actionModel extends model */ public function getActionCondition() { + if($this->app->user->admin) return ''; + $actionCondition = ''; if(isset($this->app->user->rights['acls']['actions'])) { @@ -842,7 +847,7 @@ class actionModel extends model } /* If action type is login or logout, needn't link. */ - if($actionType == 'svncommited') + if($actionType == 'svncommited' or $actionType == 'gitcommited') { $action->actor = isset($commiters[$action->actor]) ? $commiters[$action->actor] : $action->actor; } @@ -851,12 +856,6 @@ class actionModel extends model if(strpos($action->objectLabel, '|') !== false) { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); - $action->objectLink = ''; - if(!common::hasPriv($moduleName, $methodName)) - { - unset($actions[$i]); - continue; - } $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectName)); @@ -967,23 +966,25 @@ class actionModel extends model if($action->action != 'deleted') return; if($action->objectType == 'product') { - $product = $this->dao->select('name,code')->from(TABLE_PRODUCT)->where('id')->eq($action->objectID)->fetch(); + $product = $this->dao->select('id,name,code,acl')->from(TABLE_PRODUCT)->where('id')->eq($action->objectID)->fetch(); $count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->andWhere("(`name`='{$product->name}' OR `code`='{$product->code}')")->fetch('count'); if($count > 0) { echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['product'])); die(js::locate(helper::createLink('product', 'edit', "productID=$action->objectID&action=undelete&extra=$actionID"), 'parent')); } + if($product->acl != 'open') $this->loadModel('user')->updateUserView($product->id, 'product'); } elseif($action->objectType == 'project') { - $project = $this->dao->select('name,code')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch(); + $project = $this->dao->select('id,name,code,acl')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch(); $count = $this->dao->select('COUNT(*) AS count')->from(TABLE_PROJECT)->where('deleted')->eq('0')->andWhere("(`name`='{$project->name}' OR `code`='{$project->code}')")->fetch('count'); if($count > 0) { echo js::alert(sprintf($this->lang->action->needEdit, $this->lang->action->objectTypes['project'])); die(js::locate(helper::createLink('project', 'edit', "projectID=$action->objectID&action=undelete&extra=$actionID"), 'parent')); } + if($project->acl != 'open') $this->loadModel('user')->updateUserView($project->id, 'project'); } elseif($action->objectType == 'module') { @@ -1072,16 +1073,17 @@ class actionModel extends model * * @param array $actions * @param string $direction + * @param string $type all|today|yesterday|thisweek|lastweek|thismonth|lastmonth * @access public * @return array */ - public function buildDateGroup($actions, $direction = 'next') + public function buildDateGroup($actions, $direction = 'next', $type = 'today') { $dateGroup = array(); foreach($actions as $action) { $timeStamp = strtotime(isset($action->originalDate) ? $action->originalDate : $action->date); - $date = date(DT_DATE4, $timeStamp); + $date = $type == 'all' ? date(DT_DATE3, $timeStamp) : date(DT_DATE4, $timeStamp); $action->time = date(DT_TIME2, $timeStamp); $dateGroup[$date][] = $action; } @@ -1096,7 +1098,7 @@ class actionModel extends model foreach($lastDateActions as $action) { $timeStamp = strtotime(isset($action->originalDate) ? $action->originalDate : $action->date); - $date = date(DT_DATE4, $timeStamp); + $date = $type == 'all' ? date(DT_DATE3, $timeStamp) : date(DT_DATE4, $timeStamp); $action->time = date(DT_TIME2, $timeStamp); $dateGroup[$date][] = $action; } diff --git a/module/admin/control.php b/module/admin/control.php index 78a15bbbe0..ba5c22e328 100644 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -328,7 +328,7 @@ class admin extends control $this->loadModel('setting')->setItem('system.admin.log.saveDays', $this->post->days); if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } $this->loadModel('message'); diff --git a/module/admin/lang/zh-cn.php b/module/admin/lang/zh-cn.php index d5765300d1..b622f08be9 100644 --- a/module/admin/lang/zh-cn.php +++ b/module/admin/lang/zh-cn.php @@ -12,8 +12,8 @@ $lang->admin->common = '后台管理'; $lang->admin->index = '后台管理首页'; $lang->admin->checkDB = '检查数据库'; -$lang->admin->sso = '然之集成'; -$lang->admin->ssoAction = '然之集成'; +$lang->admin->sso = 'ZDOO集成'; +$lang->admin->ssoAction = 'ZDOO集成'; $lang->admin->safeIndex = '安全'; $lang->admin->checkWeak = '弱口令检查'; $lang->admin->certifyMobile = '认证手机'; diff --git a/module/admin/lang/zh-tw.php b/module/admin/lang/zh-tw.php index 0aac8e0be6..8d66fa868d 100644 --- a/module/admin/lang/zh-tw.php +++ b/module/admin/lang/zh-tw.php @@ -12,8 +12,8 @@ $lang->admin->common = '後台管理'; $lang->admin->index = '後台管理首頁'; $lang->admin->checkDB = '檢查資料庫'; -$lang->admin->sso = '然之整合'; -$lang->admin->ssoAction = '然之整合'; +$lang->admin->sso = 'ZDOO整合'; +$lang->admin->ssoAction = 'ZDOO整合'; $lang->admin->safeIndex = '安全'; $lang->admin->checkWeak = '弱口令檢查'; $lang->admin->certifyMobile = '認證手機'; diff --git a/module/admin/view/log.html.php b/module/admin/view/log.html.php index 1ec9ff5ea9..b538b90b11 100644 --- a/module/admin/view/log.html.php +++ b/module/admin/view/log.html.php @@ -17,7 +17,7 @@

webhook->setting;?>

-
+ diff --git a/module/backup/control.php b/module/backup/control.php index 7890b95777..946bcb2663 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -53,13 +53,13 @@ class backup extends control $backupFile = new stdclass(); $backupFile->time = filemtime($file); $backupFile->name = substr($fileName, 0, strpos($fileName, '.')); - $backupFile->files[$file] = abs(filesize($file)); + $backupFile->files[$file] = $this->backup->getBackupSummary($file); $fileBackup = $this->backup->getBackupFile($backupFile->name, 'file'); - if($fileBackup) $backupFile->files[$fileBackup] = $this->backup->getBackupSize($fileBackup); + if($fileBackup) $backupFile->files[$fileBackup] = $this->backup->getBackupSummary($fileBackup); $codeBackup = $this->backup->getBackupFile($backupFile->name, 'code'); - if($codeBackup) $backupFile->files[$codeBackup] = $this->backup->getBackupSize($codeBackup); + if($codeBackup) $backupFile->files[$codeBackup] = $this->backup->getBackupSummary($codeBackup); $backups[$backupFile->name] = $backupFile; } @@ -151,7 +151,7 @@ class backup extends control { $rmFunc = is_file($file) ? 'removeFile' : 'removeDir'; $zfile->{$rmFunc}($file); - if($rmFunc == 'removeDir') $this->backup->processSummary($file, 0, 0, 'delete'); + if($rmFunc == 'removeDir') $this->backup->processSummary($file, 0, 0, array(), 0, 'delete'); } } } @@ -275,7 +275,7 @@ class backup extends control { $zfile = $this->app->loadClass('zfile'); $zfile->removeDir($this->backupPath . $fileName . '.file'); - $this->backup->processSummary($this->backupPath . $fileName . '.file', 0, 0, 'delete'); + $this->backup->processSummary($this->backupPath . $fileName . '.file', 0, 0, array(), 0, 'delete'); } /* Delete code file. */ @@ -291,7 +291,7 @@ class backup extends control { $zfile = $this->app->loadClass('zfile'); $zfile->removeDir($this->backupPath . $fileName . '.code'); - $this->backup->processSummary($this->backupPath . $fileName . '.code', 0, 0, 'delete'); + $this->backup->processSummary($this->backupPath . $fileName . '.code', 0, 0, array(), 0, 'delete'); } die(js::reload('parent')); @@ -371,15 +371,23 @@ class backup extends control $sqlFileName = $this->backup->getBackupFile($fileName, 'sql'); if($sqlFileName) { - $fileSize = $this->backup->getBackupSize($sqlFileName); - $message = sprintf($this->lang->backup->progressSQL, $this->backup->processFileSize($fileSize)); + $summary = $this->backup->getBackupSummary($sqlFileName); + $message = sprintf($this->lang->backup->progressSQL, $this->backup->processFileSize($summary['size'])); } $attachFileName = $this->backup->getBackupFile($fileName, 'file'); - if($attachFileName) $message = sprintf($this->lang->backup->progressAttach); + if($attachFileName) + { + $log = $this->backup->getBackupDirProgress($attachFileName); + $message = sprintf($this->lang->backup->progressAttach, zget($log, 'allCount', 0), zget($log, 'count', 0)); + } $codeFileName = $this->backup->getBackupFile($fileName, 'code'); - if($codeFileName) $message = sprintf($this->lang->backup->progressCode); + if($codeFileName) + { + $log = $this->backup->getBackupDirProgress($codeFileName); + $message = sprintf($this->lang->backup->progressCode, zget($log, 'allCount', 0), zget($log, 'count', 0)); + } die($message); } diff --git a/module/backup/css/index.css b/module/backup/css/index.css new file mode 100644 index 0000000000..03a438082f --- /dev/null +++ b/module/backup/css/index.css @@ -0,0 +1 @@ +.errorFiles{text-align:left;padding:5px;} diff --git a/module/backup/lang/de.php b/module/backup/lang/de.php index d07f835311..78e5f84752 100644 --- a/module/backup/lang/de.php +++ b/module/backup/lang/de.php @@ -9,9 +9,15 @@ $lang->backup->change = 'Ablaufdatum'; $lang->backup->changeAB = 'Bearbeiten'; $lang->backup->rmPHPHeader = 'Remove PHP header'; -$lang->backup->time = 'Datum'; -$lang->backup->files = 'Dateien'; -$lang->backup->size = 'Größe'; +$lang->backup->time = 'Datum'; +$lang->backup->files = 'Dateien'; +$lang->backup->allCount = 'All Count'; +$lang->backup->count = 'Backup Count'; +$lang->backup->size = 'Größe'; +$lang->backup->status = 'Status'; + +$lang->backup->statusList['success'] = 'Success'; +$lang->backup->statusList['fail'] = 'Fail'; $lang->backup->setting = 'Settings'; $lang->backup->settingDir = 'Backup Directory'; @@ -25,6 +31,7 @@ $lang->backup->progressCode = '

SQL backup is completed.

Attachment ba $lang->backup->confirmDelete = 'Möchten Sie das Backup löschen?'; $lang->backup->confirmRestore = 'Möchten Sie das Backup wiederherstellen?'; $lang->backup->holdDays = 'Behalten der letzen %s Tage der Backups'; +$lang->backup->copiedFail = 'Copy failed files: '; $lang->backup->restoreTip = 'Nur Dateien und Datenbanken können wiederhergestellt werden. Code kann manuell wieder hergestellt werden.'; $lang->backup->success = new stdclass(); diff --git a/module/backup/lang/en.php b/module/backup/lang/en.php index d9ea65e77b..230cf42c20 100644 --- a/module/backup/lang/en.php +++ b/module/backup/lang/en.php @@ -9,9 +9,15 @@ $lang->backup->change = 'Edit Expiration'; $lang->backup->changeAB = 'Edit'; $lang->backup->rmPHPHeader = 'Remove PHP header'; -$lang->backup->time = 'Date'; -$lang->backup->files = 'Files'; -$lang->backup->size = 'Size'; +$lang->backup->time = 'Date'; +$lang->backup->files = 'Files'; +$lang->backup->allCount = 'All Count'; +$lang->backup->count = 'Backup Count'; +$lang->backup->size = 'Size'; +$lang->backup->status = 'Status'; + +$lang->backup->statusList['success'] = 'Success'; +$lang->backup->statusList['fail'] = 'Fail'; $lang->backup->setting = 'Settings'; $lang->backup->settingDir = 'Backup Directory'; @@ -25,6 +31,7 @@ $lang->backup->progressCode = '

SQL backup is completed.

Attachment ba $lang->backup->confirmDelete = 'Do you want to delete the backup?'; $lang->backup->confirmRestore = 'Do you want to restore the backup?'; $lang->backup->holdDays = 'Hold last %s days of backup'; +$lang->backup->copiedFail = 'Copy failed files: '; $lang->backup->restoreTip = 'Only files and databases can be restored by clicking Restore. Code can be restored manually.'; $lang->backup->success = new stdclass(); diff --git a/module/backup/lang/fr.php b/module/backup/lang/fr.php index a70c0afa9e..57e23458e8 100644 --- a/module/backup/lang/fr.php +++ b/module/backup/lang/fr.php @@ -9,9 +9,15 @@ $lang->backup->change = 'Editer Expiration'; $lang->backup->changeAB = 'Editer'; $lang->backup->rmPHPHeader = 'Enlever PHP header'; -$lang->backup->time = 'Date'; -$lang->backup->files = 'Fichiers'; -$lang->backup->size = 'Taille'; +$lang->backup->time = 'Date'; +$lang->backup->files = 'Fichiers'; +$lang->backup->allCount = 'Tous les Compteurs'; +$lang->backup->count = 'Compteur Backup'; +$lang->backup->size = 'Taille'; +$lang->backup->status = 'Statut'; + +$lang->backup->statusList['success'] = 'Succès'; +$lang->backup->statusList['fail'] = 'Echec'; $lang->backup->setting = 'Paramétrage'; $lang->backup->settingDir = 'Répertoire Backup'; @@ -20,11 +26,12 @@ $lang->backup->settingList['nosafe'] = 'Ne pas prévenir du téléchargement par $lang->backup->waitting = ' est en cours. Patientez s´il vous plait...'; $lang->backup->progressSQL = '

SQL backup: %s est sauvegardé.

'; -$lang->backup->progressAttach = '

SQL backup est terminé.

Attachment backing up.

'; -$lang->backup->progressCode = '

SQL backup est terminé.

Attachment backup est terminé.

Code backing up.

'; +$lang->backup->progressAttach = '

SQL backup est terminé.

Les fichiers sont en cours de sauvegarde.

'; +$lang->backup->progressCode = '

SQL backup est terminé.

Sauvegarde des fichiers terminée.

Sauvegarde du code en cours.

'; $lang->backup->confirmDelete = 'Voulez-vous supprimer la sauvegarde ?'; $lang->backup->confirmRestore = 'Voulez-vous restaurer la sauvegarde ?'; $lang->backup->holdDays = 'conserver les derniers %s jours de backup'; +$lang->backup->copiedFail = 'Fichiers en échec de copie : '; $lang->backup->restoreTip = 'Seulement les fichiers et les bases peuvent être restaurées en cliquant sur Restaurer. Le code doit être restauré manuellement.'; $lang->backup->success = new stdclass(); diff --git a/module/backup/lang/vi.php b/module/backup/lang/vi.php index 1e497c8c55..095b3f6454 100644 --- a/module/backup/lang/vi.php +++ b/module/backup/lang/vi.php @@ -9,9 +9,15 @@ $lang->backup->change = 'Sửa Expiration'; $lang->backup->changeAB = 'Sửa'; $lang->backup->rmPHPHeader = 'Xóa PHP header'; -$lang->backup->time = 'Ngày'; -$lang->backup->files = 'Files'; -$lang->backup->size = 'Size'; +$lang->backup->time = 'Ngày'; +$lang->backup->files = 'Files'; +$lang->backup->allCount = 'All Count'; +$lang->backup->count = 'Backup Count'; +$lang->backup->size = 'Size'; +$lang->backup->status = 'Status'; + +$lang->backup->statusList['success'] = 'Success'; +$lang->backup->statusList['fail'] = 'Fail'; $lang->backup->setting = 'Thiết lập'; $lang->backup->settingDir = 'Thư mục sao lưu'; @@ -25,6 +31,7 @@ $lang->backup->progressCode = '

Sao lưu SQL đã hoàn thành.

Sao l $lang->backup->confirmDelete = 'Bạn có muốn xóa sao lưu này?'; $lang->backup->confirmRestore = 'Bạn có muốn khôi phục sao lưu này?'; $lang->backup->holdDays = 'Giữ ít nhất %s ngày sao lưu'; +$lang->backup->copiedFail = 'Copy failed files: '; $lang->backup->restoreTip = 'Chỉ tập tin và CSDL có thể được khôi phục bằng cách Click Khôi phục. Mã nguồn có thể khôi phục thủ công.'; $lang->backup->success = new stdclass(); diff --git a/module/backup/lang/zh-cn.php b/module/backup/lang/zh-cn.php index b41bf77e8d..2b16e8cf41 100644 --- a/module/backup/lang/zh-cn.php +++ b/module/backup/lang/zh-cn.php @@ -9,9 +9,15 @@ $lang->backup->change = '保留时间'; $lang->backup->changeAB = '修改'; $lang->backup->rmPHPHeader = '去除安全设置'; -$lang->backup->time = '备份时间'; -$lang->backup->files = '备份文件'; -$lang->backup->size = '大小'; +$lang->backup->time = '备份时间'; +$lang->backup->files = '备份文件'; +$lang->backup->allCount = '总文件数'; +$lang->backup->count = '备份文件数'; +$lang->backup->size = '大小'; +$lang->backup->status = '状态'; + +$lang->backup->statusList['success'] = '成功'; +$lang->backup->statusList['fail'] = '失败'; $lang->backup->setting = '设置'; $lang->backup->settingDir = '备份目录'; @@ -20,11 +26,12 @@ $lang->backup->settingList['nosafe'] = '不需要防下载PHP文件头'; $lang->backup->waitting = '正在进行中,请稍候...'; $lang->backup->progressSQL = '

SQL备份中,已备份%s

'; -$lang->backup->progressAttach = '

SQL备份完成

附件备份中

'; -$lang->backup->progressCode = '

SQL备份完成

附件备份完成

代码备份中

'; +$lang->backup->progressAttach = '

SQL备份完成

附件备份中,共有%s个文件,已经备份%s个

'; +$lang->backup->progressCode = '

SQL备份完成

附件备份完成

代码备份中,共有%s个文件,已经备份%s个

'; $lang->backup->confirmDelete = '是否删除备份?'; $lang->backup->confirmRestore = '是否还原该备份?'; $lang->backup->holdDays = '备份保留最近 %s 天'; +$lang->backup->copiedFail = '复制失败的文件:'; $lang->backup->restoreTip = '还原功能只还原附件和数据库,如果需要还原代码,可以手动还原。'; $lang->backup->success = new stdclass(); diff --git a/module/backup/lang/zh-tw.php b/module/backup/lang/zh-tw.php index 9104eff58a..6eb3443ae3 100644 --- a/module/backup/lang/zh-tw.php +++ b/module/backup/lang/zh-tw.php @@ -9,9 +9,15 @@ $lang->backup->change = '保留時間'; $lang->backup->changeAB = '修改'; $lang->backup->rmPHPHeader = '去除安全設置'; -$lang->backup->time = '備份時間'; -$lang->backup->files = '備份檔案'; -$lang->backup->size = '大小'; +$lang->backup->time = '備份時間'; +$lang->backup->files = '備份檔案'; +$lang->backup->allCount = '總檔案數'; +$lang->backup->count = '備份檔案數'; +$lang->backup->size = '大小'; +$lang->backup->status = '狀態'; + +$lang->backup->statusList['success'] = '成功'; +$lang->backup->statusList['fail'] = '失敗'; $lang->backup->setting = '設置'; $lang->backup->settingDir = '備份目錄'; @@ -20,11 +26,12 @@ $lang->backup->settingList['nosafe'] = '不需要防下載PHP檔案頭'; $lang->backup->waitting = '正在進行中,請稍候...'; $lang->backup->progressSQL = '

SQL備份中,已備份%s

'; -$lang->backup->progressAttach = '

SQL備份完成

附件備份中,已備份%s

'; -$lang->backup->progressCode = '

SQL備份完成

附件備份完成

代碼備份中,已備份%s

'; +$lang->backup->progressAttach = '

SQL備份完成

附件備份中,共有%s個檔案,已經備份%s個

'; +$lang->backup->progressCode = '

SQL備份完成

附件備份完成

代碼備份中,共有%s個檔案,已經備份%s個

'; $lang->backup->confirmDelete = '是否刪除備份?'; $lang->backup->confirmRestore = '是否還原該備份?'; $lang->backup->holdDays = '備份保留最近 %s 天'; +$lang->backup->copiedFail = '複製失敗的檔案:'; $lang->backup->restoreTip = '還原功能只還原附件和資料庫,如果需要還原代碼,可以手動還原。'; $lang->backup->success = new stdclass(); diff --git a/module/backup/model.php b/module/backup/model.php index 5faa4ca6cc..a5059d8a36 100644 --- a/module/backup/model.php +++ b/module/backup/model.php @@ -33,14 +33,21 @@ class backupModel extends model */ public function backFile($backupFile) { + $zfile = $this->app->loadClass('zfile'); $return = new stdclass(); $return->result = true; $return->error = ''; if(!is_dir($backupFile)) mkdir($backupFile, 0777, true); - $zfile = $this->app->loadClass('zfile'); - $result = $zfile->copyDir($this->app->getAppRoot() . 'www/data/', $backupFile, $showDetails = false); - $this->processSummary($backupFile, $result[1], $result[2]); + + $tmpLogFile = $this->getTmpLogFile($backupFile); + $dataDir = $this->app->getAppRoot() . 'www/data/'; + $count = $zfile->getCount($dataDir); + file_put_contents($tmpLogFile, json_encode(array('allCount' => $count))); + + $result = $zfile->copyDir($dataDir, $backupFile, $logLevel = false, $tmpLogFile); + $this->processSummary($backupFile, $result['count'], $result['size'], $result['errorFiles'], $count); + unlink($tmpLogFile); return $return; } @@ -54,10 +61,12 @@ class backupModel extends model */ public function backCode($backupFile) { + $zfile = $this->app->loadClass('zfile'); $return = new stdclass(); $return->result = true; $return->error = ''; + $tmpLogFile = $this->getTmpLogFile($backupFile); $appRoot = $this->app->getAppRoot(); $fileList = glob($appRoot . '*'); $wwwFileList = glob($appRoot . 'www/*'); @@ -72,29 +81,43 @@ class backupModel extends model $fileList = array_merge($fileList, $wwwFileList); if(!is_dir($backupFile)) mkdir($backupFile, 0777, true); - $zfile = $this->app->loadClass('zfile'); + $allCount = 0; - $allSize = 0; + foreach($fileList as $codeFile) $allCount += $zfile->getCount($codeFile); + file_put_contents($tmpLogFile, json_encode(array('allCount' => $allCount))); + + $copiedCount = 0; + $copiedSize = 0; + $errorFiles = array(); foreach($fileList as $codeFile) { $file = trim(str_replace($appRoot, '', $codeFile), DS); if(is_dir($codeFile)) { if(!is_dir($backupFile . DS . $file)) mkdir($backupFile . DS . $file, 0777, true); - $result = $zfile->copyDir($codeFile, $backupFile . DS . $file, $showDetails = false); - $allCount += $result[1]; - $allSize += $result[2]; + $result = $zfile->copyDir($codeFile, $backupFile . DS . $file, $logLevel = false, $tmpLogFile); + $copiedCount += $result['count']; + $copiedSize += $result['size']; + $errorFiles += $result['errorFiles']; } else { $dirName = dirname($file); if(!is_dir($backupFile . DS . $dirName)) mkdir($backupFile . DS . $dirName, 0777, true); - $zfile->copyFile($codeFile, $backupFile . DS . $file); - $allCount += 1; - $allSize += filesize($codeFile); + if($zfile->copyFile($codeFile, $backupFile . DS . $file)) + { + $copiedCount += 1; + $copiedSize += filesize($codeFile); + } + else + { + $errorFiles[] = $codeFile; + } } } - $this->processSummary($backupFile, $allCount, $allSize); + + $this->processSummary($backupFile, $copiedCount, $copiedSize, $errorFiles, $allCount); + unlink($tmpLogFile); return $return; } @@ -255,24 +278,28 @@ class backupModel extends model /** * Get dir size. * - * @param string $backupFile + * @param string $backup * @access public * @return int */ - public function getBackupSize($backupFile) + public function getBackupSummary($backup) { $zfile = $this->app->loadClass('zfile'); - if(!is_dir($backupFile)) return $zfile->getFileSize($backupFile); - - $summaryFile = dirname($backupFile) . DS . 'summary'; - if(file_exists($summaryFile)) + if(is_file($backup)) { - $summary = json_decode(file_get_contents(dirname($backupFile) . DS . 'summary'), 'true'); - $fileName = basename($backupFile); + $summary = array(); + $summary['allCount'] = 1; + $summary['count'] = 1; + $summary['size'] = $zfile->getFileSize($backup); - if(isset($summary[$fileName])) return $summary[$fileName]['size']; + return $summary; } - return 0; + + $summaryFile = dirname($backup) . DS . 'summary'; + if(!file_exists($summaryFile)) return array(); + + $summary = json_decode(file_get_contents(dirname($backup) . DS . 'summary'), 'true'); + return isset($summary[basename($backup)]) ? $summary[basename($backup)] : array(); } /** @@ -313,6 +340,33 @@ class backupModel extends model return false; } + /** + * Get tmp log file. + * + * @param string $backupFile + * @access public + * @return string + */ + public function getTmpLogFile($backupFile) + { + $backupDir = dirname($backupFile); + return $backupDir . DS . basename($backupFile) . '.tmp.summary'; + } + + /** + * Get backup dir progress. + * + * @param string $backup + * @access public + * @return array + */ + public function getBackupDirProgress($backup) + { + $tmpLogFile = $this->getTmpLogFile($backup); + if(file_exists($tmpLogFile)) return json_decode(file_get_contents($tmpLogFile), true); + return array(); + } + /** * Process filesize. * @@ -344,11 +398,13 @@ class backupModel extends model * @param string $file * @param int $count * @param int $size - * @param string $action + * @param array $errorFiles + * @param int $allCount + * @param string $action add|delete * @access public * @return bool */ - public function processSummary($file, $count, $size, $action = 'add') + public function processSummary($file, $count, $size, $errorFiles = array(), $allCount = 0, $action = 'add') { $backupPath = dirname($file); $fileName = basename($file); @@ -361,8 +417,10 @@ class backupModel extends model if($action == 'add') { - $summary[$fileName]['count'] = $count; - $summary[$fileName]['size'] = $size; + $summary[$fileName]['allCount'] = $allCount; + $summary[$fileName]['errorFiles'] = $errorFiles; + $summary[$fileName]['count'] = $count; + $summary[$fileName]['size'] = $size; } else { diff --git a/module/backup/view/index.html.php b/module/backup/view/index.html.php index 8c1f585ac8..98ee6d49cf 100644 --- a/module/backup/view/index.html.php +++ b/module/backup/view/index.html.php @@ -35,7 +35,10 @@ - + + + + @@ -44,14 +47,32 @@ files);?> - files as $file => $size):?> + files as $file => $summary):?> - + + + + - stories},", ",{$story->id},") !== false) continue; ?> - product != $story->product) continue; ?>
admin->days;?>
backup->time?> backup->files?>backup->size?>backup->allCount?>backup->count?>backup->size?>backup->status?> actions?>
1) echo "rowspan='$rowspan'"?>>time);?> = 1024 ? round($size / 1024 / 1024 / 1024, 2) . 'GB' : ($size / 1024 >= 1024 ? round($size / 1024 / 1024, 2) . 'MB' : round($size / 1024, 2) . 'KB');?> + backup->processFileSize($size); + ?> + + + + + backup->statusList[$status];?> + + 1) echo "rowspan='$rowspan'"?>> + EOD; } @@ -1598,7 +1622,7 @@ EOD; $method = $this->app->rawMethod; } - if(!empty($this->app->user->modifyPassword) and (($module != 'my' or $method != 'changepassword') and ($module != 'user' or $method != 'logout'))) die(js::locate(helper::createLink('my', 'changepassword'))); + if(!empty($this->app->user->modifyPassword) and (($module != 'my' or $method != 'changepassword') and ($module != 'user' or $method != 'logout'))) die(js::locate(helper::createLink('my', 'changepassword', '', '', true))); if($this->isOpenMethod($module, $method)) return true; if(!$this->loadModel('user')->isLogon() and $this->server->php_auth_user) $this->user->identifyByPhpAuth(); if(!$this->loadModel('user')->isLogon() and $this->cookie->za) $this->user->identifyByCookie(); @@ -1953,16 +1977,19 @@ EOD; $isFreepasswd = ($_GET['m'] == 'user' and strtolower($_GET['f']) == 'apilogin' and $_GET['account'] and $entry->freePasswd); if($isFreepasswd) $entry->account = $_GET['account']; - $user = $this->dao->findByAccount($entry->account)->from(TABLE_USER)->fetch(); + $user = $this->dao->findByAccount($entry->account)->from(TABLE_USER)->andWhere('deleted')->eq(0)->fetch(); if(!$user) $this->response('INVALID_ACCOUNT'); $this->loadModel('user'); + $user->last = time(); $user->rights = $this->user->authorize($user->account); $user->groups = $this->user->getGroups($user->account); $user->view = $this->user->grantUserView($user->account, $user->rights['acls']); $user->admin = strpos($this->app->company->admins, ",{$user->account},") !== false; $this->session->set('user', $user); $this->app->user = $user; + + $this->dao->update(TABLE_USER)->set('last')->eq($user->last)->where('account')->eq($user->account)->exec(); $this->loadModel('action')->create('user', $user->id, 'login'); $this->loadModel('score')->create('user', 'login'); @@ -2051,11 +2078,13 @@ EOD; * * @param string $url * @param string|array $data + * @param bool $optHeader + * @param string $userPWD * @static * @access public * @return string */ - public static function http($url, $data = null, $optHeader = false) + public static function http($url, $data = null, $optHeader = false, $userPWD = '') { global $lang, $app; if(!extension_loaded('curl')) return json_encode(array('result' => 'fail', 'message' => $lang->error->noCurlExt)); @@ -2083,6 +2112,8 @@ EOD; curl_setopt($curl, CURLOPT_POSTFIELDS, $data); } + if(!empty($userPWD)) curl_setopt($curl, CURLOPT_USERPWD, $userPWD); + $response = curl_exec($curl); $errors = curl_error($curl); curl_close($curl); diff --git a/module/common/view/chosen.html.php b/module/common/view/chosen.html.php index 73bcf4f74d..609eb59081 100755 --- a/module/common/view/chosen.html.php +++ b/module/common/view/chosen.html.php @@ -1,9 +1,22 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> + + + diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index 3e8b90b882..a558034779 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -9,16 +9,21 @@ $(function() $('#sidebar .cell .text-center:last').append("datatable->moduleSetting?>
"); - var $btnToolbar = $('#main .table-header .btn-toolbar:first'); - if($btnToolbar.length > 0) + var addSettingButton = function() { - datatable->$datatableId->mode) ? $config->datatable->$datatableId->mode : 'table';?> - var $dropdown = $(''); - var $dropmenu = $(''); - $dropmenu.append("
  • datatable->custom?>
  • "); - $dropmenu.append("
  • \", true);' id='switchToDatatable'>datatable->switchToDatatable : $lang->datatable->switchToTable;?>
  • "); - $dropdown.append($dropmenu).appendTo($btnToolbar); - } + var $btnToolbar = $('#main .table-header .btn-toolbar:first'); + if($btnToolbar.length > 0) + { + datatable->$datatableId->mode) ? $config->datatable->$datatableId->mode : 'table';?> + var $dropdown = $(''); + var $dropmenu = $(''); + $dropmenu.append("
  • datatable->custom?>
  • "); + $dropmenu.append("
  • \", true);' id='switchToDatatable'>datatable->switchToDatatable : $lang->datatable->switchToTable;?>
  • "); + $dropdown.append($dropmenu).appendTo($btnToolbar); + } + }; + $('#main .main-table').on('tableReload', addSettingButton); + addSettingButton(); $('#setShowModule').click(function() { @@ -31,12 +36,12 @@ $(function() { type: "POST", dataType: 'json', - data: + data: { - target: datatableId, - name: 'showModule', - value: value, - allModule: allModule, + target: datatableId, + name: 'showModule', + value: value, + allModule: allModule, }, success:function(){window.location.reload();}, url: 'createLink('datatable', 'ajaxSave')?>' @@ -72,12 +77,12 @@ $(function()
    @@ -77,9 +75,14 @@ id&type=story"), $lang->goback, '', "class='btn'");?>
    + show('right', 'pagerjs');?> diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 6a9439fd60..997a4b13ae 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -70,12 +70,15 @@
    - + id}&type=story&link=$link¶m=$param&orderBy=%s";?>
    - +
    @@ -96,7 +99,7 @@ createLink('story', 'view', "storyID=$story->id", '', true);?>
    - +
    @@ -130,8 +133,8 @@
    - -
    ' id='bugs'> @@ -215,15 +223,20 @@
    - -
    ' id='leftBugs'> @@ -301,15 +314,20 @@ - -
    diff --git a/module/repo/control.php b/module/repo/control.php index bd60bf9216..d14d5e90e8 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -79,7 +79,7 @@ class repo extends control { $repoID = $this->repo->create(); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); $link = $this->repo->createLink('showSyncCommit', "repoID=$repoID"); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link)); @@ -112,7 +112,8 @@ class repo extends control if($_POST) { $noNeedSync = $this->repo->update($repoID); - if(dao::isError()) die(js::error(dao::getError())); + if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError())); + if(!$noNeedSync) { $link = $this->repo->createLink('showSyncCommit', "repoID=$repoID"); @@ -408,10 +409,26 @@ class repo extends control $history = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('revision')->eq($log[0]->revision)->andWhere('repo')->eq($repoID)->fetch(); if($history) { - $oldRevision = $this->dao->select('revision')->from(TABLE_REPOHISTORY)->where('commit')->eq($history->commit - 1)->andWhere('repo')->eq($repoID)->fetch('revision'); + if($repo->SCM == 'Git') + { + $thisAndPrevRevisions = $this->scm->exec("rev-list -n 2 {$history->revision} --"); + + array_shift($thisAndPrevRevisions); + if($thisAndPrevRevisions) $oldRevision = array_shift($thisAndPrevRevisions); + } + else + { + $oldRevision = $this->dao->select('*')->from(TABLE_REPOHISTORY)->where('revision')->lt($history->revision)->andWhere('repo')->eq($repoID)->orderBy('revision_desc')->limit(1)->fetch('revision'); + } + $log[0]->commit = $history->commit; } - if(empty($oldRevision)) $oldRevision = '^'; + + if(empty($oldRevision)) + { + $oldRevision = '^'; + if($history and $repo->SCM == 'Git') $oldRevision = "{$history->revision}^"; + } $changes = array(); $viewPriv = common::hasPriv('repo', 'view'); @@ -533,7 +550,7 @@ class repo extends control if(isset($pathInfo["extension"])) $suffix = strtolower($pathInfo["extension"]); $arrange = $this->cookie->arrange ? $this->cookie->arrange : 'inline'; - if(!empty($_POST)) + if($this->server->request_method == 'POST') { $oldRevision = isset($this->post->revision[1]) ?$this->post->revision[1] : ''; $newRevision = isset($this->post->revision[0]) ?$this->post->revision[0] : ''; @@ -717,19 +734,21 @@ class repo extends control /* Init branchID. */ if($this->cookie->syncBranch) $branchID = $this->cookie->syncBranch; if(!isset($branches[$branchID])) $branchID = ''; - if(empty($branchID)) $branchID = reset($branches); + if(empty($branchID)) $branchID = 'master'; /* Get unsynced branches. */ - foreach($branches as $branch) + unset($branches['master']); + if($branchID != 'master') { - unset($branches[$branch]); - if($branch == $branchID) + foreach($branches as $branch) { - $this->repo->setRepoBranch($branchID); - setcookie("syncBranch", $branchID, 0, $this->config->webRoot); - break; + unset($branches[$branch]); + if($branch == $branchID) break; } } + + $this->repo->setRepoBranch($branchID); + setcookie("syncBranch", $branchID, 0, $this->config->webRoot); } } diff --git a/module/repo/css/common.css b/module/repo/css/common.css index 5b76cbfba2..0f12f1ea3e 100644 --- a/module/repo/css/common.css +++ b/module/repo/css/common.css @@ -179,3 +179,5 @@ h3 {font-size:16px;} #sidebar>.sidebar-toggle>.icon{right:-4px; left:auto;} #logForm .fixed-footer a.allLogs{color:#fff !important;} + +#submitLabel{text-align:left;} diff --git a/module/repo/js/create.js b/module/repo/js/create.js index 808e0ec8dd..d1a57c1374 100644 --- a/module/repo/js/create.js +++ b/module/repo/js/create.js @@ -1,6 +1,11 @@ $(function() { scmChanged(scm); + $('#submit').mousedown(function() + { + $form = $(this).closest('form'); + $form.css('min-height', $form.height()); + }) }); function scmChanged(scm) { @@ -17,4 +22,4 @@ function scmChanged(scm) { $('.tips-git').addClass('hidden'); $('.tips-svn').removeClass('hidden'); } -} \ No newline at end of file +} diff --git a/module/repo/js/edit.js b/module/repo/js/edit.js index 808e0ec8dd..d1a57c1374 100644 --- a/module/repo/js/edit.js +++ b/module/repo/js/edit.js @@ -1,6 +1,11 @@ $(function() { scmChanged(scm); + $('#submit').mousedown(function() + { + $form = $(this).closest('form'); + $form.css('min-height', $form.height()); + }) }); function scmChanged(scm) { @@ -17,4 +22,4 @@ function scmChanged(scm) { $('.tips-git').addClass('hidden'); $('.tips-svn').removeClass('hidden'); } -} \ No newline at end of file +} diff --git a/module/repo/js/setrules.js b/module/repo/js/setrules.js index 095f4b0aa3..beca7997ef 100644 --- a/module/repo/js/setrules.js +++ b/module/repo/js/setrules.js @@ -7,7 +7,7 @@ $(function() function replaceExample() { var html = ''; - var startTask = $('[id*=start').val().split(';'); + var startTask = $('[id*=start]').val().split(';'); var taskModule = $('[id*=module][id*=task]').val().split(';'); var idMark = $('[id*=id][id*=mark]').val().split(';'); var idSplit = $('[id*=id][id*=split]').val().split(';'); @@ -45,9 +45,9 @@ function replaceExample() for(q in cunits) { cunit = cunits[q]; - for(r in cunits) + for(r in lunits) { - lunit = lunits[q]; + lunit = lunits[r]; html += '
    ' + rulesExample['task']['start'].replace('%start%', start) .replace('%task%', task) .replace('%id%', id) @@ -69,7 +69,7 @@ function replaceExample() } } - var finishTask = $('[id*=finish').val().split(';'); + var finishTask = $('[id*=finish]').val().split(';'); for(i in finishTask) { finish = finishTask[i]; @@ -91,18 +91,13 @@ function replaceExample() for(o in cunits) { cunit = cunits[o]; - for(p in cunits) - { - lunit = lunits[p]; - html += '
    ' + rulesExample['task']['finish'].replace('%finish%', finish) - .replace('%task%', task) - .replace('%id%', id) - .replace('%split%', split) - .replace('%cost%', cost) - .replace('%consumedmark%', consumed) - .replace('%cunit%', cunit) - .replace('%lunit%', lunit); - } + html += '
    ' + rulesExample['task']['finish'].replace('%finish%', finish) + .replace('%task%', task) + .replace('%id%', id) + .replace('%split%', split) + .replace('%cost%', cost) + .replace('%consumedmark%', consumed) + .replace('%cunit%', cunit); } } } @@ -111,7 +106,7 @@ function replaceExample() } } - var effortTask = $('[id*=logEfforts').val().split(';'); + var effortTask = $('[id*=logEfforts]').val().split(';'); for(i in effortTask) { effort = effortTask[i]; @@ -139,7 +134,7 @@ function replaceExample() for(q in cunits) { cunit = cunits[q]; - for(r in cunits) + for(r in lunits) { lunit = lunits[r]; html += '
    ' + rulesExample['task']['effort'].replace('%effort%', effort) diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index 40559f5441..665f9d017d 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -105,7 +105,7 @@ $lang->repo->objectIdRule = 'Object ID Rule'; $lang->repo->actionRule = 'Action Rule'; $lang->repo->manHourRule = 'Man-hour Rule'; $lang->repo->ruleUnit = "Unit"; -$lang->repo->ruleSplit = "Multiple keywords are divided by ';'. For example: task multiple keywords: Task;task"; +$lang->repo->ruleSplit = "Multiple keywords are divided by ';', e.g. task multiple keywords: Task;task"; $lang->repo->viewDiffList['inline'] = 'Inline'; $lang->repo->viewDiffList['appose'] = 'Parallel'; @@ -158,10 +158,10 @@ $lang->repo->error->noFile = '%s does not exist.'; $lang->repo->error->noPriv = 'The program does not have the privilege to switch to %s'; $lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n"; $lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client"; -$lang->repo->error->encoding = "The encoding maybe wrong. Please change the encoding and try again."; +$lang->repo->error->encoding = "The encoding might be wrong. Please change the encoding and try again."; $lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; -$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated values,e.g. utf-8"; +$lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8."; $lang->repo->example = new stdclass(); $lang->repo->example->client = new stdclass(); diff --git a/module/repo/lang/fr.php b/module/repo/lang/fr.php index dfa54c0ded..707fed5936 100644 --- a/module/repo/lang/fr.php +++ b/module/repo/lang/fr.php @@ -1,102 +1,102 @@ repo->common = 'Repo'; -$lang->repo->browse = 'View'; -$lang->repo->viewRevision = 'View Revision'; +$lang->repo->common = 'Référentiel'; +$lang->repo->browse = 'Aff'; +$lang->repo->viewRevision = 'Aff Modifs'; $lang->repo->program = 'Program'; -$lang->repo->create = 'Create'; -$lang->repo->createAction = 'Create Repo'; -$lang->repo->maintain = 'Repo List'; -$lang->repo->edit = 'Edit'; -$lang->repo->editAction = 'Edit Repo'; -$lang->repo->delete = 'Delete Repo'; -$lang->repo->showSyncCommit = 'Display Synchronization'; +$lang->repo->create = 'Créer'; +$lang->repo->createAction = 'Créer Ref'; +$lang->repo->maintain = 'Liste Ref'; +$lang->repo->edit = 'Editer'; +$lang->repo->editAction = 'Editer Ref'; +$lang->repo->delete = 'Suppr. Ref'; +$lang->repo->showSyncCommit = 'Afficher Synchronisation'; $lang->repo->ajaxSyncCommit = 'Interface: Ajax Sync Note'; -$lang->repo->setRules = 'Set rules'; +$lang->repo->setRules = 'Fixer règles'; $lang->repo->download = 'Download File'; $lang->repo->downloadDiff = 'Download Diff'; -$lang->repo->diffAction = 'Revision Diff'; -$lang->repo->revisionAction = 'Revision Detail'; -$lang->repo->blameAction = 'Repo Blame'; -$lang->repo->addBug = 'Add Review'; -$lang->repo->editBug = 'Edit Bug'; -$lang->repo->deleteBug = 'Delete Bug'; -$lang->repo->addComment = 'Add Comment'; -$lang->repo->editComment = 'Edit Comment'; -$lang->repo->deleteComment = 'Delete Comment'; +$lang->repo->diffAction = 'Révision Diff'; +$lang->repo->revisionAction = 'Détail Révision'; +$lang->repo->blameAction = 'Blâme du Référentiel'; +$lang->repo->addBug = 'Ajout Révision'; +$lang->repo->editBug = 'Editer Bug'; +$lang->repo->deleteBug = 'Suppr. Bug'; +$lang->repo->addComment = 'Ajout Comment.'; +$lang->repo->editComment = 'Edit. Comment'; +$lang->repo->deleteComment = 'Suppr. Comment'; -$lang->repo->submit = 'Submit'; -$lang->repo->cancel = 'Cancel'; -$lang->repo->addComment = 'Add Comment'; +$lang->repo->submit = 'Soumettre'; +$lang->repo->cancel = 'Annuler'; +$lang->repo->addComment = 'Ajout Comment'; $lang->repo->product = $lang->productCommon; $lang->repo->module = 'Module'; $lang->repo->project = $lang->projectCommon; $lang->repo->type = 'Type'; -$lang->repo->assign = 'AssignTo'; -$lang->repo->title = 'Title'; -$lang->repo->detile = 'Detail'; -$lang->repo->lines = 'Lines'; -$lang->repo->line = 'Line'; -$lang->repo->expand = 'Unfold'; -$lang->repo->collapse = 'Fold'; +$lang->repo->assign = 'Assigner à'; +$lang->repo->title = 'Titre'; +$lang->repo->detile = 'Détail'; +$lang->repo->lines = 'Lignes'; +$lang->repo->line = 'Ligne'; +$lang->repo->expand = 'Déplier'; +$lang->repo->collapse = 'Replier'; $lang->repo->id = 'ID'; $lang->repo->SCM = 'Type'; -$lang->repo->name = 'Name'; -$lang->repo->path = 'Path'; -$lang->repo->prefix = 'Prefix'; +$lang->repo->name = 'Nom'; +$lang->repo->path = 'Chemin'; +$lang->repo->prefix = 'Préfixe'; $lang->repo->config = 'Config'; $lang->repo->desc = 'Description'; -$lang->repo->account = 'Username'; +$lang->repo->account = 'Nom Utilisateur'; $lang->repo->password = 'Password'; -$lang->repo->encoding = 'Encoding'; -$lang->repo->client = 'Client Path'; -$lang->repo->size = 'Size'; -$lang->repo->revision = 'Revision'; -$lang->repo->revisionA = 'Revision'; -$lang->repo->revisions = 'Revision'; +$lang->repo->encoding = 'Encodage'; +$lang->repo->client = 'Chemin Client'; +$lang->repo->size = 'Taille'; +$lang->repo->revision = 'Révision'; +$lang->repo->revisionA = 'Révision'; +$lang->repo->revisions = 'Révision'; $lang->repo->time = 'Date'; -$lang->repo->committer = 'Committer'; +$lang->repo->committer = 'Committeur'; $lang->repo->commits = 'Commits'; -$lang->repo->synced = 'Initialize Sync'; -$lang->repo->lastSync = 'Last Sync'; -$lang->repo->deleted = 'Deleted'; +$lang->repo->synced = 'Initialise Sync'; +$lang->repo->lastSync = 'Dern Sync'; +$lang->repo->deleted = 'Supprimé'; $lang->repo->commit = 'Commit'; $lang->repo->comment = 'Comment'; -$lang->repo->view = 'View File'; -$lang->repo->viewA = 'View'; -$lang->repo->log = 'Revision Log'; -$lang->repo->blame = 'Blame'; +$lang->repo->view = 'Voir Fichier'; +$lang->repo->viewA = 'Voir'; +$lang->repo->log = 'Log Révision'; +$lang->repo->blame = 'Blâme'; $lang->repo->date = 'Date'; $lang->repo->diff = 'Diff'; $lang->repo->diffAB = 'Diff'; -$lang->repo->diffAll = 'Diff All'; -$lang->repo->viewDiff = 'View diff'; -$lang->repo->allLog = 'All Revisions'; -$lang->repo->location = 'Location'; -$lang->repo->file = 'File'; +$lang->repo->diffAll = 'Toutes Diff'; +$lang->repo->viewDiff = 'Voir diff'; +$lang->repo->allLog = 'Toutes Révisions'; +$lang->repo->location = 'Localisation'; +$lang->repo->file = 'Fichier'; $lang->repo->action = 'Action'; $lang->repo->code = 'Code'; -$lang->repo->review = 'Repo Review'; -$lang->repo->acl = 'Privilege'; -$lang->repo->group = 'Group'; +$lang->repo->review = 'Révision Ref'; +$lang->repo->acl = 'Privilège'; +$lang->repo->group = 'Groupe'; $lang->repo->user = 'User'; -$lang->repo->info = 'Version Info'; +$lang->repo->info = 'Info Version'; -$lang->repo->title = 'Title'; -$lang->repo->status = 'Status'; -$lang->repo->openedBy = 'CreatedBy'; -$lang->repo->assignedTo = 'AssignedTo'; -$lang->repo->openedDate = 'CreatedDate'; +$lang->repo->title = 'Titre'; +$lang->repo->status = 'Statut'; +$lang->repo->openedBy = 'Créé par'; +$lang->repo->assignedTo = 'Assigné à'; +$lang->repo->openedDate = 'Date Création'; -$lang->repo->latestRevision = 'Latest Revision'; -$lang->repo->actionInfo = "Add by %s in %s"; +$lang->repo->latestRevision = 'Dernière Révision'; +$lang->repo->actionInfo = "Ajouté par %s dans %s"; $lang->repo->changes = "Change Log"; -$lang->repo->reviewLocation = "File: %s@%s, line:%s - %s"; +$lang->repo->reviewLocation = "Fichier: %s@%s, ligne:%s - %s"; $lang->repo->commentEdit = ''; $lang->repo->commentDelete = ''; -$lang->repo->allChanges = "Other Changes"; -$lang->repo->commitTitle = "The %sth Commit"; +$lang->repo->allChanges = "Autres Changements"; +$lang->repo->commitTitle = "Le %sème Commit"; $lang->repo->mark = "Mark Tag"; $lang->repo->split = "Split Mark"; @@ -105,17 +105,17 @@ $lang->repo->objectIdRule = 'Object ID Rule'; $lang->repo->actionRule = 'Action Rule'; $lang->repo->manHourRule = 'Man-hour Rule'; $lang->repo->ruleUnit = "Unit"; -$lang->repo->ruleSplit = "Multiple keywords are divided by ';'. For example: task multiple keywords: Task;task"; +$lang->repo->ruleSplit = "Plusieurs mots-clés sont séparés par ';'. Par exemple : plusieurs mots clés tâche : Tâche;tâche"; -$lang->repo->viewDiffList['inline'] = 'Inline'; -$lang->repo->viewDiffList['appose'] = 'Parallel'; +$lang->repo->viewDiffList['inline'] = 'Interligne'; +$lang->repo->viewDiffList['appose'] = 'Parallèle'; -$lang->repo->encryptList['plain'] = 'No encryption'; +$lang->repo->encryptList['plain'] = "Pas d'encodage"; $lang->repo->encryptList['base64'] = 'BASE64'; -$lang->repo->logStyles['A'] = 'Add'; +$lang->repo->logStyles['A'] = 'Ajout'; $lang->repo->logStyles['M'] = 'Modification'; -$lang->repo->logStyles['D'] = 'Delete'; +$lang->repo->logStyles['D'] = 'Suppression'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; @@ -124,57 +124,57 @@ $lang->repo->scmList['Git'] = 'Git'; $lang->repo->scmList['Subversion'] = 'Subversion'; $lang->repo->notice = new stdclass(); -$lang->repo->notice->syncing = 'Synchronizing. Please wait ...'; -$lang->repo->notice->syncComplete = 'Synchronized. Now redirecting ...'; -$lang->repo->notice->syncedCount = 'The number of records synchronized is '; -$lang->repo->notice->delete = 'Are you sure delete this repo?'; -$lang->repo->notice->successDelete = 'Repository is removed.'; -$lang->repo->notice->commentContent = 'Comment'; -$lang->repo->notice->deleteBug = 'Are you sure to delete this bug?'; -$lang->repo->notice->deleteComment = 'Are you sure to delete this comment?'; -$lang->repo->notice->lastSyncTime = 'Last Sync:'; +$lang->repo->notice->syncing = 'Synchronisation en cours. Veuillez patienter ...'; +$lang->repo->notice->syncComplete = 'Synchronisé. Vous allez être redirigé ...'; +$lang->repo->notice->syncedCount = "Le nombre d'enregistrements synchronisés est "; +$lang->repo->notice->delete = 'Etes vous certain de vouloir supprimer ce référentiel ?'; +$lang->repo->notice->successDelete = 'Le référentiel est supprimé.'; +$lang->repo->notice->commentContent = 'Commentaire'; +$lang->repo->notice->deleteBug = 'Êtes-vous sûr de vouloir supprimer ce bug ?'; +$lang->repo->notice->deleteComment = 'Êtes-vous certain de vouloir supprimer ce commentaire ?'; +$lang->repo->notice->lastSyncTime = 'Dern Sync:'; $lang->repo->rules = new stdclass(); -$lang->repo->rules->exampleLabel = "Comment Example"; +$lang->repo->rules->exampleLabel = "Comment Exemple"; $lang->repo->rules->example['task']['start'] = "%start% %task% %id%1%split%2 %cost%%consumedmark%1%cunit% %left%%leftmark%3%lunit%"; $lang->repo->rules->example['task']['finish'] = "%finish% %task% %id%1%split%2 %cost%%consumedmark%10%cunit%"; $lang->repo->rules->example['task']['effort'] = "%effort% %task% %id%1%split%2 %cost%%consumedmark%1%cunit% %left%%leftmark%3%lunit%"; $lang->repo->rules->example['bug']['resolve'] = "%resolve% %bug% %id%1%split%2"; $lang->repo->error = new stdclass(); -$lang->repo->error->useless = 'Your server disabled exec and shell_exec, so it cannot be applied.'; -$lang->repo->error->connect = 'Connection to the repo failed. Please enter username, password and repo address correctly!'; -$lang->repo->error->version = 'Version 1.8+ of https and svn protocol is required. Please update to latest version! Go to http://subversion.apache.org/'; -$lang->repo->error->path = 'Repo address is the file path, e.g. /home/test.'; -$lang->repo->error->cmd = 'Client Error!'; -$lang->repo->error->diff = 'Two versions must be selected.'; -$lang->repo->error->product = "Please select {$lang->productCommon}!"; -$lang->repo->error->commentText = 'Please enter content for review!'; -$lang->repo->error->comment = 'Please enter content!'; -$lang->repo->error->title = 'Please enter title!'; -$lang->repo->error->accessDenied = 'You do not have the privilege to access the repository.'; -$lang->repo->error->noFound = 'The repo is not found.'; -$lang->repo->error->noFile = '%s does not exist.'; -$lang->repo->error->noPriv = 'The program does not have the privilege to switch to %s'; -$lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n"; -$lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client"; -$lang->repo->error->encoding = "The encoding maybe wrong. Please change the encoding and try again."; +$lang->repo->error->useless = 'Votre serveur a désactivé exec et shell_exec, il ne peut donc pas être appliqué.'; +$lang->repo->error->connect = "La connexion au référentiel a échoué. Veuillez saisir correctement le nom d'utilisateur, le mot de passe et l'adresse du référentiel !"; +$lang->repo->error->version = 'Version 1.8+ de https et du protocole svn est requis. Veuillez mettre à jour vers la dernière version ! Allez à http://subversion.apache.org/'; +$lang->repo->error->path = "L'adresse du référentiel est le chemin du fichier, ex: /home/test"; +$lang->repo->error->cmd = 'Erreur du Client !'; +$lang->repo->error->diff = 'Deux version doivent être sélectionnées.'; +$lang->repo->error->product = "Veuillez sélectionner un {$lang->productCommon}!"; +$lang->repo->error->commentText = 'Veuillez entrer du contenu pour une révision !'; +$lang->repo->error->comment = 'Veuillez entrer le contenu du commentaire !'; +$lang->repo->error->title = 'Veuillez saisir un titre !'; +$lang->repo->error->accessDenied = "Vous n'avez pas les privilèges d'accéder au référentiel."; +$lang->repo->error->noFound = 'Le référentiel est non trouvé.'; +$lang->repo->error->noFile = "%s n'existe pas."; +$lang->repo->error->noPriv = "Le programme n'a pas les privilèges pour basculer vers %s"; +$lang->repo->error->output = "La commande est: %s\nL'erreur est (%s): %s\n"; +$lang->repo->error->clientVersion = "La version du client est trop ancienne, veuillez mettre à niveau ou changer le client SVN"; +$lang->repo->error->encoding = "L'encodage est peut-être erroné. Veuillez modifier l'encodage et réessayer."; -$lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; -$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated values,e.g. utf-8"; +$lang->repo->syncTips = 'Vous pouvez trouver la référence sur la façon de définir la synchronisation Git à partir de la page se trouvant ici.'; +$lang->repo->encodingsTips = "Les encodages des commentaires de validation peuvent être des valeurs séparées par des virgules,ex: utf-8"; $lang->repo->example = new stdclass(); $lang->repo->example->client = new stdclass(); $lang->repo->example->path = new stdclass(); -$lang->repo->example->client->git = "e.g. /usr/bin/git"; -$lang->repo->example->client->svn = "e.g. /usr/bin/svn"; -$lang->repo->example->path->git = "e.g. /home/user/myproject"; -$lang->repo->example->path->svn = "e.g. http://example.googlecode.com/svn/trunk/myproject"; -$lang->repo->example->config = "Config directory is required in https. Use '--config-dir' to generate config dir."; -$lang->repo->example->encoding = "input encoding of files"; +$lang->repo->example->client->git = "ex: /usr/bin/git"; +$lang->repo->example->client->svn = "ex: /usr/bin/svn"; +$lang->repo->example->path->git = "ex: /home/user/myproject"; +$lang->repo->example->path->svn = "ex: http://example.googlecode.com/svn/trunk/myproject"; +$lang->repo->example->config = "Le répertoire de configuration est requis en https. Utilisez '--config-dir' pour générer le répertoire de configuration."; +$lang->repo->example->encoding = "encodage d'entrée des fichiers"; $lang->repo->typeList['standard'] = 'Standard'; $lang->repo->typeList['performance'] = 'Performance'; -$lang->repo->typeList['security'] = 'Security'; -$lang->repo->typeList['redundancy'] = 'Redundancy'; -$lang->repo->typeList['logicError'] = 'Logic Error'; +$lang->repo->typeList['security'] = 'Securité'; +$lang->repo->typeList['redundancy'] = 'Redondance'; +$lang->repo->typeList['logicError'] = 'Erreur Logique'; diff --git a/module/repo/model.php b/module/repo/model.php index c6eee0d991..fc124ad120 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -190,11 +190,12 @@ class repoModel extends model */ public function create() { - $this->checkConnection(); + if(!$this->checkConnection()) return false; $data = fixer::input('post') ->skipSpecial('path,client,account,password') ->join('program', ',') ->get(); + $data->acl = empty($data->acl) ? '' : json_encode($data->acl); if(empty($data->client)) $data->client = 'svn'; @@ -225,7 +226,7 @@ class repoModel extends model */ public function update($id) { - $this->checkConnection(); + if(!$this->checkConnection()) return false; $data = fixer::input('post') ->skipSpecial('path,client,account,password') ->join('program', ',') @@ -681,7 +682,7 @@ class repoModel extends model $scm = $this->app->loadClass('scm'); $scm->setEngine($repo); - $logs = $scm->log('', $lastInDB->revision); + $logs = $scm->log('', $lastInDB ? $lastInDB->revision : 0); if(empty($logs)) return false; /* Process logs. */ @@ -937,59 +938,82 @@ class repoModel extends model if($scm == 'Subversion') { - $path = '"' . str_replace(array('%3A', '%2F'), array(':', '/'), urlencode($path)) . '"'; + /* Get svn version. */ + $versionCommand = "$client --version --quiet 2>&1"; + exec($versionCommand, $versionOutput, $versionResult); + if($versionResult) + { + $message = sprintf($this->lang->repo->error->output, $versionCommand, $versionResult, join("
    ", $versionOutput)); + dao::$errors['client'] = $this->lang->repo->error->cmd . "
    " . nl2br($message); + return false; + } + $svnVersion = end($versionOutput); + + $path = '"' . str_replace(array('%3A', '%2F', '+'), array(':', '/', ' '), urlencode($path)) . '"'; if(stripos($path, 'https://') === 1 or stripos($path, 'svn://') === 1) { - $ssh = true; - $remote = true; + if(version_compare($svnVersion, '1.6', '<')) + { + dao::$errors['client'] = $this->lang->repo->error->version; + return false; + } + $command = "$client info --username $account --password $password --non-interactive --trust-server-cert-failures=cn-mismatch --trust-server-cert --no-auth-cache $path 2>&1"; + if(version_compare($svnVersion, '1.9', '<')) $command = "$client info --username $account --password $password --non-interactive --trust-server-cert --no-auth-cache $path 2>&1"; } else if(stripos($path, 'file://') === 1) { - $ssh = false; - $remote = false; $command = "$client info --non-interactive --no-auth-cache $path 2>&1"; } else { - $ssh = false; - $remote = true; $command = "$client info --username $account --password $password --non-interactive --no-auth-cache $path 2>&1"; } + exec($command, $output, $result); if($result) { - $versionCommand = "$client --version --quiet 2>&1"; - exec($versionCommand, $versionOutput, $versionResult); - if($versionResult) + $message = sprintf($this->lang->repo->error->output, $command, $result, join("
    ", $output)); + if(stripos($message, 'Expected FS format between') !== false and strpos($message, 'found format') !== false) { - $message = sprintf($this->lang->repo->error->output, $versionCommand, $versionResult, join("\n", $versionOutput)); - echo $message; - die(js::alert($this->lang->repo->error->cmd . '\n' . str_replace(array("\n", "'"), array('\n', '"'), $message))); + dao::$errors['client'] = $this->lang->repo->error->clientVersion; + return false; } - if($ssh and version_compare(end($versionOutput), '1.6', '<')) die(js::alert($this->lang->repo->error->version)); - $message = sprintf($this->lang->repo->error->output, $command, $result, join("\n", $output)); - echo $message; - if(stripos($message, 'Expected FS format between') !== false and strpos($message, 'found format') !== false) die(js::alert($this->lang->repo->error->clientVersion)); - if(preg_match('/[^\:\/\\A-Za-z0-9_\-\'\"]/', $path)) die(js::alert($this->lang->repo->error->encoding . '\n' . str_replace(array("\n", "'"), array('\n', '"'), $message))); - die(js::alert($this->lang->repo->error->connect . '\n' . str_replace(array("\n", "'"), array('\n', '"'), $message))); + if(preg_match('/[^\:\/\\A-Za-z0-9_\-\'\"\.]/', $path)) + { + dao::$errors['encoding'] = $this->lang->repo->error->encoding . "
    " . nl2br($message); + return false; + } + + dao::$errors['submit'] = $this->lang->repo->error->connect . "
    " . nl2br($message); + return false; } } elseif($scm == 'Git') { + if(!is_dir($path)) + { + dao::$errors['path'] = sprintf($this->lang->repo->error->noFile, $path); + return false; + } + if(!chdir($path)) { - if(!is_dir($path)) die(js::alert(sprintf($this->lang->repo->error->noFile, $path))); - if(!is_executable($path)) die(js::alert(sprintf($this->lang->repo->error->noPriv, $path))); - die(js::alert($this->lang->repo->error->path)); + if(!is_executable($path)) + { + dao::$errors['path'] = sprintf($this->lang->repo->error->noPriv, $path); + return false; + } + dao::$errors['path'] = $this->lang->repo->error->path; + return false; } $command = "$client tag 2>&1"; exec($command, $output, $result); if($result) { - echo sprintf($this->lang->repo->error->output, $command, $result, join("\n", $output)); - die(js::alert($this->lang->repo->error->connect)); + dao::$errors['submit'] = $this->lang->repo->error->connect . "
    " . sprintf($this->lang->repo->error->output, $command, $result, join("
    ", $output)); + return false; } } return true; @@ -1265,15 +1289,22 @@ class repoModel extends model $productsAndProjects = $this->getTaskProductsAndProjects($objects['tasks']); foreach($actions['task'] as $taskID => $taskActions) { + $task = $this->task->getById($taskID); + if(empty($task)) continue; + $action->objectType = 'task'; $action->objectID = $taskID; $action->product = $productsAndProjects[$taskID]['product']; $action->project = $productsAndProjects[$taskID]['project']; + $action->comment = $this->lang->repo->revisionA . ': #' . $action->extra . "
    " . $action->comment; foreach($taskActions as $taskAction => $params) { + $_POST = array(); foreach($params as $field => $param) $this->post->set($field, $param); - if($taskAction == 'start') + + if($taskAction == 'start' and $task->status == 'wait') { + $this->post->set('consumed', $this->post->consumed + $task->consumed); $this->post->set('realStarted', date('Y-m-d')); $changes = $this->task->start($taskID); foreach($this->createActionChanges($log, $repoRoot, $scm) as $change) $changes[] = $change; @@ -1283,15 +1314,18 @@ class repoModel extends model $this->saveRecord($action, $changes); } } - elseif($taskAction == 'effort') + elseif($taskAction == 'effort' and in_array($task->status, array('wait', 'pause', 'doing'))) { + unset($_POST['consumed']); + unset($_POST['left']); + $_POST['id'][1] = 1; $_POST['dates'][1] = date('Y-m-d'); $_POST['consumed'][1] = $params['consumed']; $_POST['left'][1] = $params['left']; $_POST['objectType'][1] = 'task'; $_POST['objectID'][1] = $taskID; - $_POST['work'][1] = $action->comment; + $_POST['work'][1] = str_replace('
    ', "\n", $action->comment); if(is_dir($this->app->getModuleRoot() . 'effort')) { $this->loadModel('effort')->batchCreate(); @@ -1310,9 +1344,8 @@ class repoModel extends model $changes = $this->createActionChanges($log, $repoRoot, $scm); $this->saveRecord($action, $changes); } - elseif($taskAction == 'finish') + elseif($taskAction == 'finish' and in_array($task->status, array('wait', 'pause', 'doing'))) { - $task = $this->task->getById($taskID); $this->post->set('finishedDate', date('Y-m-d')); $this->post->set('currentConsumed', $this->post->consumed); $this->post->set('consumed', $this->post->consumed + $task->consumed); @@ -1334,13 +1367,17 @@ class repoModel extends model $productsAndProjects = $this->getBugProductsAndProjects($objects['bugs']); foreach($actions['bug'] as $bugID => $bugActions) { + $bug = $this->bug->getByID($bugID); + if(empty($bug)) continue; + $action->objectType = 'bug'; $action->objectID = $bugID; $action->product = $productsAndProjects[$bugID]->product; $action->project = $productsAndProjects[$bugID]->project; foreach($bugActions as $bugAction => $params) { - if($bugAction == 'resolve') + $_POST = array(); + if($bugAction == 'resolve' and $bug->status == 'active') { $this->post->set('resolvedBuild', 'trunk'); $this->post->set('resolution', 'fixed'); @@ -1349,6 +1386,7 @@ class repoModel extends model if($changes) { $action->action = 'resolved'; + $action->extra = 'fixed'; $this->saveRecord($action, $changes); } } @@ -1360,6 +1398,23 @@ class repoModel extends model $action->action = $scm == 'svn' ? 'svncommited' : 'gitcommited'; $changes = $this->createActionChanges($log, $repoRoot, $scm); + if($objects['stories']) + { + $productsAndProjects = $this->getTaskProductsAndProjects($objects['stories']); + foreach($objects['stories'] as $storyID) + { + $storyID = (int)$storyID; + if(!isset($productsAndProjects[$storyID])) continue; + + $action->objectType = 'story'; + $action->objectID = $storyID; + $action->product = $productsAndProjects[$storyID]['product']; + $action->project = $productsAndProjects[$storyID]['project']; + + $this->saveRecord($action, $changes); + } + } + if($objects['tasks']) { $productsAndProjects = $this->getTaskProductsAndProjects($objects['tasks']); @@ -1407,6 +1462,9 @@ class repoModel extends model */ public function saveRecord($action, $changes) { + /* Remove sql error. */ + dao::getError(); + $record = $this->dao->select('*')->from(TABLE_ACTION) ->where('objectType')->eq($action->objectType) ->andWhere('objectID')->eq($action->objectID) diff --git a/module/repo/view/browse.html.php b/module/repo/view/browse.html.php index ee29bdbb42..74461ce349 100644 --- a/module/repo/view/browse.html.php +++ b/module/repo/view/browse.html.php @@ -30,7 +30,7 @@
    - repo->notice->lastSyncTime . $cacheTime?> + repo->notice->lastSyncTime . $cacheTime?> repo->createLink('browse', "repoID=$repoID&path=&revision=$revision&refresh=1", "path=" . $this->repo->encodePath($path)), " ". $lang->refresh, '', "class='btn btn-primary'");?>
    diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index cd7a3e42c1..576bd7b8a1 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -92,7 +92,7 @@ - + diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index 128d644321..b0160796b9 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -97,7 +97,7 @@ - + diff --git a/module/repo/view/showsynccommit.html.php b/module/repo/view/showsynccommit.html.php index f2d8b4f848..52d1a20158 100644 --- a/module/repo/view/showsynccommit.html.php +++ b/module/repo/view/showsynccommit.html.php @@ -37,7 +37,7 @@ $(function(){ if(data == 'finish') { $('#caption').text('repo->notice->syncComplete?>'); - return self.location = createLink('repo', 'maintain'); + return self.location = createLink('repo', 'browse', "repoID="); } $('#commits').html(parseInt($('#commits').html()) + parseInt(data)); setTimeout(syncComments, 10); diff --git a/module/report/js/workload.js b/module/report/js/workload.js index 95e0528791..aa06a0916a 100644 --- a/module/report/js/workload.js +++ b/module/report/js/workload.js @@ -51,12 +51,12 @@ function diffDate(date1, date2) { date1 = convertStringToDate(date1); date2 = convertStringToDate(date2); - delta = (date2 - date1) / (1000 * 60 * 60 * 24); + delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; weekEnds = 0; - for(i = 0; i < delta + 1; i++) + for(i = 0; i < delta; i++) { - if(date1.getDay() == 0 || date1.getDay() == 6) weekEnds ++; + if((weekend == 2 && date1.getDay() == 6) || date1.getDay() == 0) weekEnds ++; date1 = date1.valueOf(); date1 += 1000 * 60 * 60 * 24; date1 = new Date(date1); diff --git a/module/report/lang/fr.php b/module/report/lang/fr.php index 6d9aebb90c..6f7e65368a 100644 --- a/module/report/lang/fr.php +++ b/module/report/lang/fr.php @@ -16,8 +16,8 @@ $lang->report->item = 'Item'; $lang->report->value = 'Valeur'; $lang->report->percent = '%'; $lang->report->undefined = 'N/D'; -$lang->report->query = 'Query'; -$lang->report->annual = 'Annual Summary'; +$lang->report->query = 'Requête'; +$lang->report->annual = 'Résumé Annuel'; $lang->report->colors[] = 'AFD8F8'; $lang->report->colors[] = 'F6BD0F'; @@ -99,5 +99,5 @@ $lang->report->mailTitle->task = " Tâches (%s),"; $lang->report->mailTitle->todo = " Agenda (%s),"; $lang->report->mailTitle->testTask = " Recettes (%s),"; -$lang->report->proVersion = 'Try ZenTao Pro for more!'; +$lang->report->proVersion = 'Essayez ZenTao Pro pour en savoir plus !'; $lang->report->proVersionEn = 'Try ZenTao Pro for more!'; diff --git a/module/report/model.php b/module/report/model.php index 72ea75c5c2..50a4960675 100644 --- a/module/report/model.php +++ b/module/report/model.php @@ -310,16 +310,27 @@ class reportModel extends model $stmt = $this->dao->select('t1.*, t2.name as projectName')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.deleted')->eq(0) - ->andWhere('t1.status')->notin('cancel, closed, done, pause') + ->andWhere('t1.status')->in('wait,doing') ->andWhere('t2.deleted')->eq(0) - ->andWhere('t2.status')->notin('cancel, closed, done, suspended') + ->andWhere('t2.status')->in('wait, doing') ->andWhere('assignedTo')->ne(''); $allTasks = $stmt->fetchAll('id'); - $tasks = $stmt->beginIF($dept)->andWhere('t1.assignedTo')->in(array_keys($deptUsers))->fi()->fetchAll('id'); - if(empty($allTasks)) return array(); + $tasks = array(); + if(empty($dept)) + { + $tasks = $allTasks; + } + else + { + foreach($allTasks as $taskID => $task) + { + if(isset($deptUsers[$task->assignedTo])) $tasks[$taskID] = $task; + } + } + /* Fix bug for children. */ $parents = array(); $taskIdList = array(); @@ -477,8 +488,8 @@ class reportModel extends model ->from(TABLE_TODO)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2') ->on('t1.account = t2.account') - ->where('t1.status')->eq('wait') - ->orWhere('t1.status')->eq('doing') + ->where('t1.cycle')->eq(0) + ->andWhere('t1.status')->in('wait,doing') ->query(); $todos = array(); diff --git a/module/report/view/bugassign.html.php b/module/report/view/bugassign.html.php index e37bc2111f..efe10ee87d 100644 --- a/module/report/view/bugassign.html.php +++ b/module/report/view/bugassign.html.php @@ -4,7 +4,7 @@
    - PRO  isINT) and $config->isINT) ? $lang->report->proVersionEn : $lang->report->proVersion; ?> + PRO  isINT)) ? $lang->report->proVersionEn : $lang->report->proVersion; ?>
    diff --git a/module/report/view/bugcreate.html.php b/module/report/view/bugcreate.html.php index e676afd26b..996f27975b 100644 --- a/module/report/view/bugcreate.html.php +++ b/module/report/view/bugcreate.html.php @@ -5,7 +5,7 @@
    - PRO  isINT) and $config->isINT) ? $lang->report->proVersionEn : $lang->report->proVersion; ?> + PRO  isINT)) ? $lang->report->proVersionEn : $lang->report->proVersion; ?>
    diff --git a/module/report/view/productsummary.html.php b/module/report/view/productsummary.html.php index 5500aaec92..b850fd4574 100644 --- a/module/report/view/productsummary.html.php +++ b/module/report/view/productsummary.html.php @@ -7,7 +7,7 @@
    - PRO  isINT) and $config->isINT) ? $lang->report->proVersionEn : $lang->report->proVersion;?> + PRO  isINT)) ? $lang->report->proVersionEn : $lang->report->proVersion;?>
    diff --git a/module/report/view/projectdeviation.html.php b/module/report/view/projectdeviation.html.php index d285320435..dcf0784902 100644 --- a/module/report/view/projectdeviation.html.php +++ b/module/report/view/projectdeviation.html.php @@ -6,7 +6,7 @@
    - PRO  isINT) and $config->isINT) ? $lang->report->proVersionEn : $lang->report->proVersion; ?> + PRO  isINT)) ? $lang->report->proVersionEn : $lang->report->proVersion; ?>
    diff --git a/module/report/view/workload.html.php b/module/report/view/workload.html.php index 6704a59106..af9ae20f12 100644 --- a/module/report/view/workload.html.php +++ b/module/report/view/workload.html.php @@ -1,11 +1,12 @@ +project->weekend);?>
    - PRO  isINT) and $config->isINT) ? $lang->report->proVersionEn : $lang->report->proVersion; ?> + PRO  isINT)) ? $lang->report->proVersionEn : $lang->report->proVersion; ?>
    diff --git a/module/search/lang/de.php b/module/search/lang/de.php index 572c692027..8f963c748a 100644 --- a/module/search/lang/de.php +++ b/module/search/lang/de.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = 'Und'; $lang->search->andor['or'] = 'Oder'; $lang->search->null = 'Null'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = 'Title'; diff --git a/module/search/lang/en.php b/module/search/lang/en.php index 45e90134bc..556fcb55bc 100644 --- a/module/search/lang/en.php +++ b/module/search/lang/en.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = 'And'; $lang->search->andor['or'] = 'Or'; $lang->search->null = 'Null'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = 'Title'; diff --git a/module/search/lang/fr.php b/module/search/lang/fr.php index 34fda4d586..2c11d75360 100644 --- a/module/search/lang/fr.php +++ b/module/search/lang/fr.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = 'And'; $lang->search->andor['or'] = 'Or'; $lang->search->null = 'Null'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = 'Title'; diff --git a/module/search/lang/vi.php b/module/search/lang/vi.php index b0ac4bd027..9932ea02bb 100644 --- a/module/search/lang/vi.php +++ b/module/search/lang/vi.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = 'Và'; $lang->search->andor['or'] = 'Hoặc'; $lang->search->null = 'Null'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = 'Title'; diff --git a/module/search/lang/zh-cn.php b/module/search/lang/zh-cn.php index f40b49d08e..934566ac63 100644 --- a/module/search/lang/zh-cn.php +++ b/module/search/lang/zh-cn.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = '并且'; $lang->search->andor['or'] = '或者'; $lang->search->null = '空'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = '标题'; diff --git a/module/search/lang/zh-tw.php b/module/search/lang/zh-tw.php index 04d91ce366..b84a26f902 100644 --- a/module/search/lang/zh-tw.php +++ b/module/search/lang/zh-tw.php @@ -48,3 +48,6 @@ $lang->search->andor['and'] = '並且'; $lang->search->andor['or'] = '或者'; $lang->search->null = '空'; + +$lang->userquery = new stdclass(); +$lang->userquery->title = '標題'; diff --git a/module/search/model.php b/module/search/model.php index 19c558fbf9..1dbe454c55 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -34,6 +34,8 @@ class searchModel extends model foreach($fields as $field) { + if($field->canSearch == 0) continue; + /* The built-in modules and user defined modules all have the subStatus field, so set its configuration first. */ if($field->field == 'subStatus') { @@ -52,9 +54,11 @@ class searchModel extends model $operator = ($field->control == 'input' or $field->control == 'textarea') ? 'include' : '='; $control = ($field->control == 'select' or $field->control == 'radio' or $field->control == 'checkbox') ? 'select' : 'input'; $options = $this->workflowfield->getFieldOptions($field); + /* Set date zui for date and datetime control. */ + $class = ($field->control == 'date' or $field->control == 'datetime') ? 'date' : ''; $searchConfig['fields'][$field->field] = $field->name; - $searchConfig['params'][$field->field] = array('operator' => $operator, 'control' => $control, 'values' => $options); + $searchConfig['params'][$field->field] = array('operator' => $operator, 'control' => $control, 'values' => $options, 'class' => $class); } } @@ -103,11 +107,12 @@ class searchModel extends model /* Fix bug #2704. */ $field = $this->post->$fieldName; if(isset($fieldParams->$field) and $fieldParams->$field->control == 'input' and $this->post->$valueName === '0') $this->post->$valueName = 'ZERO'; + if($field == 'id' and $this->post->$valueName === '0') $this->post->$valueName = 'ZERO'; /* Skip empty values. */ if($this->post->$valueName == false) continue; - if($this->post->$valueName == 'null') $this->post->$valueName = ''; // Null is special, stands to empty. if($this->post->$valueName == 'ZERO') $this->post->$valueName = 0; // ZERO is special, stands to 0. + if(isset($fieldParams->$field) and $fieldParams->$field->control == 'select' and $this->post->$valueName == 'null') $this->post->$valueName = ''; // Null is special, stands to empty if control is select. Fix bug #3279. $scoreNum += 1; @@ -230,6 +235,23 @@ class searchModel extends model $hasProject = false; $hasUser = false; + $appendUsers = array(); + $module = $_SESSION['searchParams']['module']; + $formSessionName = $module . 'Form'; + if(isset($_SESSION[$formSessionName])) + { + for($i = 1; $i <= $this->config->search->groupItems; $i ++) + { + $fieldName = 'field' . $i; + $valueName = 'value' . $i; + $fieldName = $_SESSION[$formSessionName][$fieldName]; + if(isset($params[$fieldName]) and $params[$fieldName]['values'] == 'users') + { + if($_SESSION[$formSessionName][$valueName]) $appendUsers[] = $_SESSION[$formSessionName][$valueName]; + } + } + } + $fields = array_keys($fields); foreach($fields as $fieldName) { @@ -241,7 +263,7 @@ class searchModel extends model if($hasUser) { - $users = $this->loadModel('user')->getPairs('realname|noclosed'); + $users = $this->loadModel('user')->getPairs('realname|noclosed', $appendUsers, $this->config->maxCount); $users['$@me'] = $this->lang->search->me; } if($hasProduct) $products = array('' => '') + $this->loadModel('product')->getPairs(); @@ -250,7 +272,11 @@ class searchModel extends model foreach($fields as $fieldName) { if(!isset($params[$fieldName])) $params[$fieldName] = array('operator' => '=', 'control' => 'input', 'values' => ''); - if($params[$fieldName]['values'] == 'users') $params[$fieldName]['values'] = $users; + if($params[$fieldName]['values'] == 'users') + { + if(!empty($this->config->user->moreLink)) $this->config->moreLinks["field{$fieldName}"] = $this->config->user->moreLink; + $params[$fieldName]['values'] = $users; + } if($params[$fieldName]['values'] == 'products') $params[$fieldName]['values'] = $products; if($params[$fieldName]['values'] == 'projects') $params[$fieldName]['values'] = $projects; if(is_array($params[$fieldName]['values'])) diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index f2f67baec0..32b06cdb46 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -123,6 +123,7 @@ foreach($fieldParams as $fieldName => $param) /* Print value. */ echo ""; + if(isset($config->moreLinks["field{$currentField}"])) $config->moreLinks["value$fieldNO"] = $config->moreLinks["field{$currentField}"]; if($param['control'] == 'select') echo html::select("value$fieldNO", $param['values'], $formSession["value$fieldNO"], "class='form-control searchSelect chosen'"); if($param['control'] == 'input') { @@ -183,6 +184,11 @@ foreach($fieldParams as $fieldName => $param) /* Print value. */ echo ""; + if(isset($config->moreLinks["field{$currentField}"])) + { + $selected = $formSession["value$fieldNO"]; + if(!isset($param['values'][$selected])) $config->moreLinks["value$fieldNO"] = $config->moreLinks["field{$currentField}"]; + } if($param['control'] == 'select') echo html::select("value$fieldNO", $param['values'], $formSession["value$fieldNO"], "class='form-control searchSelect chosen'"); if($param['control'] == 'input') @@ -447,13 +453,19 @@ $(function() } else if(params[fieldName]['control'] == 'select') { - $searchForm.find("#value" + fieldNO).chosen().on('chosen:showing_dropdown', function() + $searchForm.find(".picker#value" + fieldNO).remove(); + if($searchForm.find("#value" + fieldNO).attr('data-pickertype') == 'remote') { - var $this = $(this); - var $chosen = $this.next('.chosen-container').removeClass('chosen-up'); - var $drop = $chosen.find('.chosen-drop'); - $chosen.toggleClass('chosen-up', $drop.height() + $drop.offset().top - $(document).scrollTop() > $(window).height()); - }); + $searchForm.find("#value" + fieldNO).picker( + { + chosenMode: true, + remote: $searchForm.find("#value" + fieldNO).attr('data-pickerremote') + }); + } + else + { + $searchForm.find("#value" + fieldNO).picker({chosenMode: true}); + } } }; diff --git a/module/sso/control.php b/module/sso/control.php index cbeb8ddd77..75753dd982 100644 --- a/module/sso/control.php +++ b/module/sso/control.php @@ -190,7 +190,7 @@ class sso extends control $user->rights = $this->user->authorize($user->account); $user->groups = $this->user->getGroups($user->account); - $user->last = date(DT_DATETIME1, $last); + $user->last = date(DT_DATETIME1); $this->session->set('user', $user); $this->app->user = $this->session->user; $this->loadModel('action')->create('user', $user->id, 'login'); diff --git a/module/sso/lang/zh-cn.php b/module/sso/lang/zh-cn.php index ad5a7033c0..c8c3fbd11b 100644 --- a/module/sso/lang/zh-cn.php +++ b/module/sso/lang/zh-cn.php @@ -12,7 +12,7 @@ $lang->sso = new stdclass(); $lang->sso->settings = '配置'; $lang->sso->turnon = '是否打开'; -$lang->sso->redirect = '自动跳回然之'; +$lang->sso->redirect = '自动跳回ZDOO'; $lang->sso->code = '代号'; $lang->sso->key = '密钥'; $lang->sso->addr = '接口地址'; @@ -30,8 +30,8 @@ $lang->sso->bindTypeList['bind'] = '绑定已有用户'; $lang->sso->bindTypeList['add'] = '添加新用户'; $lang->sso->help = <<1、接口地址的填写,如果是PATH_INFO :http://然之网址/sys/sso-check.html,如果是GET:http://然之网址/sys/index.php?m=sso&f=check

    -

    2、代号和密钥必须与然之后台设置的一致。

    +

    1、接口地址的填写,如果是PATH_INFO :http://ZDOO网址/sys/sso-check.html,如果是GET:http://ZDOO网址/sys/index.php?m=sso&f=check

    +

    2、代号和密钥必须与ZDOO后台设置的一致。

    EOD; $lang->sso->bindNotice = '添加的新用户暂时没有权限,需要联系禅道管理员,给该用户分配权限。'; $lang->sso->bindNoPassword = '密码不能为空'; diff --git a/module/sso/lang/zh-tw.php b/module/sso/lang/zh-tw.php index 94cc6b6345..49ae9aac99 100644 --- a/module/sso/lang/zh-tw.php +++ b/module/sso/lang/zh-tw.php @@ -12,7 +12,7 @@ $lang->sso = new stdclass(); $lang->sso->settings = '配置'; $lang->sso->turnon = '是否打開'; -$lang->sso->redirect = '自動跳迥然之'; +$lang->sso->redirect = '自動跳回ZDOO'; $lang->sso->code = '代號'; $lang->sso->key = '密鑰'; $lang->sso->addr = '介面地址'; @@ -30,8 +30,8 @@ $lang->sso->bindTypeList['bind'] = '綁定已有用戶'; $lang->sso->bindTypeList['add'] = '添加新用戶'; $lang->sso->help = <<1、介面地址的填寫,如果是PATH_INFO :http://然之網址/sys/sso-check.html,如果是GET:http://然之網址/sys/index.php?m=sso&f=check

    -

    2、代號和密鑰必須與然之後台設置的一致。

    +

    1、介面地址的填寫,如果是PATH_INFO :http://ZDOO網址/sys/sso-check.html,如果是GET:http://ZDOO網址/sys/index.php?m=sso&f=check

    +

    2、代號和密鑰必須與ZDOO後台設置的一致。

    EOD; $lang->sso->bindNotice = '添加的新用戶暫時沒有權限,需要聯繫禪道管理員,給該用戶分配權限。'; $lang->sso->bindNoPassword = '密碼不能為空'; diff --git a/module/story/control.php b/module/story/control.php index 5e953e7a69..595c869c1e 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -311,18 +311,19 @@ class story extends control if($project) $this->loadModel('project')->linkStory($project, $stories); /* If storyID not equal zero, subdivide this story to child stories and close it. */ - if($storyID) + if($storyID and !empty($mails)) { - if(empty($mails)) die(js::closeModal('parent.parent', 'this')); $this->story->subdivide($storyID, $stories); - if(dao::isError()) die(js::error(dao::getError())); - - if(isonlybody()) die(js::closeModal('parent.parent', 'this')); - die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); } - if($project) + if(isonlybody()) die(js::closeModal('parent.parent', 'this')); + + if($storyID) + { + die(js::locate(inlink('view', "storyID=$storyID"), 'parent')); + } + elseif($project) { setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, false); die(js::locate($this->createLink('project', 'story', "projectID=$project&orderBy=id_desc&browseType=unclosed"), 'parent')); @@ -478,10 +479,13 @@ class story extends control /* Assign. */ $story = $this->story->getById($storyID, 0, true); $product = $this->loadModel('product')->getById($story->product); + $stories = $this->story->getParentStoryPairs($story->product, $story->parent); + if(isset($stories[$storyID])) unset($stories[$storyID]); + $this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title; $this->view->position[] = $this->lang->story->edit; $this->view->story = $story; - $this->view->stories = $this->story->getParentStoryPairs($story->product, $story->parent); + $this->view->stories = $stories; $this->view->users = $this->user->getPairs('pofirst|nodeleted', "$story->assignedTo,$story->openedBy,$story->closedBy"); $this->view->product = $product; $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product); @@ -944,6 +948,7 @@ class story extends control { if($this->post->comments) { + $data = fixer::input('post')->get(); $allChanges = $this->story->batchClose(); if($allChanges) @@ -954,6 +959,7 @@ class story extends control $this->action->logHistory($actionID, $changes); } } + if(!dao::isError()) $this->loadModel('score')->create('ajax', 'batchOther'); die(js::locate($this->session->storyList, 'parent')); } @@ -965,9 +971,22 @@ class story extends control $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($storyIdList)->fetchAll('id'); foreach($stories as $story) { - if($story->status == 'closed') unset($stories[$story->id]); + if($story->parent == -1) + { + $skipStory[] = $story->id; + unset($stories[$story->id]); + } + if($story->status == 'closed') + { + $closedStory[] = $story->id; + unset($stories[$story->id]); + } } - if(empty($stories)) die(js::alert($this->lang->story->notice->closed) . js::locate($this->session->storyList, 'parent')); + + $errorTips = ''; + if(isset($closedStory)) $errorTips .= sprintf($this->lang->story->closedStory, join(',', $closedStory)); + if(isset($skipStory)) $errorTips .= sprintf($this->lang->story->skipStory, join(',', $skipStory)); + if(isset($skipStory) || isset($closedStory)) echo js::alert($errorTips); /* The stories of a product. */ if($productID) diff --git a/module/story/css/view.css b/module/story/css/view.css index 1bad5467aa..ac588d5f1f 100644 --- a/module/story/css/view.css +++ b/module/story/css/view.css @@ -2,3 +2,4 @@ .side-col #legendProjectAndTask .list-unstyled{padding:10px; border-top:0px; margin:0px;} .col-4 .cell .tab-content .text-top{padding-top: 1px} #legendStories ul li{padding: 10px 0 0 12px; line-height: 20px} +.main-actions .btn-toolbar .btn{padding-right: 6px; padding-left: 6px;} diff --git a/module/story/js/batchcreate.js b/module/story/js/batchcreate.js index 3122a78161..1bee68b060 100644 --- a/module/story/js/batchcreate.js +++ b/module/story/js/batchcreate.js @@ -54,6 +54,7 @@ function setModuleAndPlan(branchID, productID, num) if(!modules) modules = ''; $('#module' + num).replaceWith(modules); $("#module" + num + "_chosen").remove(); + $("#module" + num).next('.picker').remove(); $("#module" + num).chosen(); }); @@ -63,6 +64,7 @@ function setModuleAndPlan(branchID, productID, num) if(!plans) plans = ''; $('#plan' + num).replaceWith(plans); $("#plan" + num + "_chosen").remove(); + $("#plan" + num).next('.picker').remove(); $("#plan" + num).chosen(); }); } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 9a8105b66b..2c0da38a00 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -65,6 +65,8 @@ $lang->story->batchChangeStage = "Mehere Phasen ändern"; $lang->story->batchAssignTo = "Mehere zuordnen"; $lang->story->batchChangeModule = "Mehere Module ändern"; $lang->story->viewAll = "Alle"; +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -136,6 +138,9 @@ $lang->story->noRequirement = 'No Requirements'; $lang->story->ditto = 'Dito'; $lang->story->dittoNotice = 'Die Story gehört nicht zum Projekt wie die vorherige!'; +$lang->story->needNotReviewList[0] = 'Need Review'; +$lang->story->needNotReviewList[1] = 'Need Not Review'; + $lang->story->useList[0] = 'Ja'; $lang->story->useList[1] = 'Nein'; @@ -233,8 +238,9 @@ $lang->story->errorNotSubdivide = "If the status is not active, or the stage $lang->story->mustChooseResult = 'Ergebnis wählen'; $lang->story->mustChoosePreVersion = 'Version wählen um es umzukhren.'; $lang->story->noStory = 'Keine Storys. '; -$lang->story->ignoreChangeStage = 'Story %s is a draft. Please review it..'; +$lang->story->ignoreChangeStage = 'Story %s is in Draft or Closed status. Please review it..'; $lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}"; +$lang->story->moveChildrenTips = "Its Child {$lang->storyCommon} will be moved to the selected product when editing the linked product of Parent {$lang->storyCommon}."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Story Bereich'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index e7aa3ee3df..8b815dee17 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -65,6 +65,8 @@ $lang->story->batchChangeStage = "Batch Change Phases"; $lang->story->batchAssignTo = "Batch Assign"; $lang->story->batchChangeModule = "Batch Change Modules"; $lang->story->viewAll = "See All"; +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -107,7 +109,7 @@ $lang->story->rejectedReason = 'Reject Reason'; $lang->story->reviewedBy = 'ReviewedBy'; $lang->story->reviewedDate = 'ReviewedDate'; $lang->story->version = 'Version'; -$lang->story->plan = 'Linked Plans'; +$lang->story->plan = 'Linked Plan'; $lang->story->planAB = 'Plan'; $lang->story->comment = 'Comment'; $lang->story->children = "Child {$lang->storyCommon}"; @@ -136,6 +138,9 @@ $lang->story->noRequirement = 'No Requirements'; $lang->story->ditto = 'Ditto'; $lang->story->dittoNotice = 'This story is not linked to the same product as the last one is!'; +$lang->story->needNotReviewList[0] = 'Need Review'; +$lang->story->needNotReviewList[1] = 'Need Not Review'; + $lang->story->useList[0] = 'Yes'; $lang->story->useList[1] = 'No'; @@ -160,11 +165,11 @@ $lang->story->stageList['closed'] = 'Closed'; $lang->story->reasonList[''] = ''; $lang->story->reasonList['done'] = 'Already Done'; $lang->story->reasonList['subdivided'] = 'Decomposed'; -$lang->story->reasonList['duplicate'] = 'Duplicated'; +$lang->story->reasonList['duplicate'] = 'Duplicate'; $lang->story->reasonList['postponed'] = 'Postponed'; $lang->story->reasonList['willnotdo'] = "Won't Do"; $lang->story->reasonList['cancel'] = 'Cancelled'; -$lang->story->reasonList['bydesign'] = 'As Design'; +$lang->story->reasonList['bydesign'] = 'As Designed'; //$lang->story->reasonList['isbug'] = 'Bug!'; $lang->story->reviewResultList[''] = ''; @@ -233,8 +238,9 @@ $lang->story->errorNotSubdivide = "If the status is not active, or the stage $lang->story->mustChooseResult = 'Select Result'; $lang->story->mustChoosePreVersion = 'Select a version to revert to.'; $lang->story->noStory = 'No stories yet. '; -$lang->story->ignoreChangeStage = 'Story %s is a draft. Please review it..'; +$lang->story->ignoreChangeStage = 'Story %s is in Draft or Closed status. Please review it..'; $lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}"; +$lang->story->moveChildrenTips = "Its Child {$lang->storyCommon} will be moved to the selected product when editing the linked product of Parent {$lang->storyCommon}."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Scope'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 0d9c744bad..4ca6297487 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -31,7 +31,7 @@ $lang->story->link = 'Link'; $lang->story->unlink = 'Unlink'; $lang->story->track = 'Track'; $lang->story->subdivideAction = 'Décomposer Story'; -$lang->story->splitRequirent = 'Decompose'; +$lang->story->splitRequirent = 'Décompose'; $lang->story->close = 'Fermer'; $lang->story->closeAction = 'Fermer Story'; $lang->story->batchClose = 'Fermer par Lot'; @@ -65,6 +65,8 @@ $lang->story->batchChangeStage = "Changer Phases par lot"; $lang->story->batchAssignTo = "Affecter par lot"; $lang->story->batchChangeModule = "Changer Modules par lot"; $lang->story->viewAll = "Voir Tout"; +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -79,8 +81,8 @@ $lang->story->sourceNote = 'Note'; $lang->story->fromBug = 'Depuis Bug'; $lang->story->title = 'Titre'; $lang->story->type = 'Type'; -$lang->story->color = 'Color'; -$lang->story->toBug = 'ToBug'; +$lang->story->color = 'Couleur'; +$lang->story->toBug = 'Vers Bug'; $lang->story->spec = 'Description'; $lang->story->assign = 'Affecter'; $lang->story->verify = 'Acceptance'; @@ -89,7 +91,7 @@ $lang->story->estimate = 'Estimation'; $lang->story->estimateAB = 'Esti.(h)'; $lang->story->hour = 'Heures'; $lang->story->status = 'Statut'; -$lang->story->subStatus = 'Sub Status'; +$lang->story->subStatus = 'Sous-statut'; $lang->story->stage = 'Phase'; $lang->story->stageAB = 'Phase'; $lang->story->stagedBy = 'Fixé par'; @@ -110,7 +112,7 @@ $lang->story->version = 'Version'; $lang->story->plan = 'Intégrée Plans'; $lang->story->planAB = 'Plan'; $lang->story->comment = 'Commentaire'; -$lang->story->children = "Child {$lang->storyCommon}"; +$lang->story->children = "Enfant {$lang->storyCommon}"; $lang->story->childrenAB = "C"; $lang->story->linkStories = 'Stories Liées'; $lang->story->childStories = 'Stories Décomposées'; @@ -136,6 +138,9 @@ $lang->story->noRequirement = 'No Requirements'; $lang->story->ditto = 'Idem'; $lang->story->dittoNotice = "La story n'est pas associée au même product que la précédente !"; +$lang->story->needNotReviewList[0] = 'Need Review'; +$lang->story->needNotReviewList[1] = 'Need Not Review'; + $lang->story->useList[0] = 'Oui'; $lang->story->useList[1] = 'Non'; @@ -229,12 +234,13 @@ $lang->story->needNotReview = 'Aucune Validation Requise'; $lang->story->successSaved = "Story est sauvegardée !"; $lang->story->confirmDelete = "Voulez-vous vraiment supprimer cette story ?"; $lang->story->errorEmptyChildStory = '『Decomposed Stories』ne peuvent être vides.'; -$lang->story->errorNotSubdivide = "If the status is not active, or the stage is not wait, or a sub story, it cannot be subdivided."; +$lang->story->errorNotSubdivide = "Si le statut n'est pas actif, ou l'étape n'est pas en attente, ou si c'est une sous-story, elle ne peut pas être subdivisée."; $lang->story->mustChooseResult = 'Sélect Résultat'; $lang->story->mustChoosePreVersion = 'Sélect une version pour revenir en arrière.'; $lang->story->noStory = "Aucune story pour l'instant. "; -$lang->story->ignoreChangeStage = "Story %s est à l'état brouillon et nécessite d'être complétée et validée..."; -$lang->story->cannotDeleteParent = "Can not delete parent {$lang->storyCommon}"; +$lang->story->ignoreChangeStage = 'Story %s is in Draft or Closed status. Please review it..'; +$lang->story->cannotDeleteParent = "Impossible de supprimer {$lang->storyCommon} parent"; +$lang->story->moveChildrenTips = "Its Child {$lang->storyCommon} will be moved to the selected product when editing the linked product of Parent {$lang->storyCommon}."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Périmètre'; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index 5d66d01037..77f3b30c7a 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -65,6 +65,8 @@ $lang->story->batchChangeStage = "Thay đổi giai đoạn hàng loạt"; $lang->story->batchAssignTo = "Bàn giao hàng loạt"; $lang->story->batchChangeModule = "Thay đổi Module hàng loạt"; $lang->story->viewAll = "Xem tất cả"; +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->common = 'Câu chuyện'; $lang->story->id = 'ID'; @@ -136,6 +138,9 @@ $lang->story->noRequirement = 'No Requirements'; $lang->story->ditto = 'Như trên'; $lang->story->dittoNotice = 'Câu chuyện này chưa liên kết tới cùng sản phẩm bởi bởi vì nó là cuối cùng!'; +$lang->story->needNotReviewList[0] = 'Need Review'; +$lang->story->needNotReviewList[1] = 'Need Not Review'; + $lang->story->useList[0] = 'Có'; $lang->story->useList[1] = 'Không'; @@ -233,8 +238,9 @@ $lang->story->errorNotSubdivide = "Nếu tình trạng này là chưa kích h $lang->story->mustChooseResult = 'Chọn kết quả'; $lang->story->mustChoosePreVersion = 'Chọn một phiên bản để chuyển thành.'; $lang->story->noStory = 'Không có câu chuyện nào'; -$lang->story->ignoreChangeStage = 'Câu chuyện %s là bản nháp. Vui lòng xét duyệt nó..'; +$lang->story->ignoreChangeStage = 'Story %s is in Draft or Closed status. Please review it..'; $lang->story->cannotDeleteParent = "Không thể xóa {$lang->storyCommon} mẹ"; +$lang->story->moveChildrenTips = "Its Child {$lang->storyCommon} will be moved to the selected product when editing the linked product of Parent {$lang->storyCommon}."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Phạm vi'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 9aadb39595..f1ee3e6313 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -65,6 +65,8 @@ $lang->story->batchChangeStage = "批量修改阶段"; $lang->story->batchAssignTo = "批量指派"; $lang->story->batchChangeModule = "批量修改模块"; $lang->story->viewAll = '查看全部'; +$lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。'; +$lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。'; $lang->story->common = $lang->storyCommon; $lang->story->id = '编号'; @@ -136,6 +138,9 @@ $lang->story->noRequirement = '无需求'; $lang->story->ditto = '同上'; $lang->story->dittoNotice = "该{$lang->storyCommon}与上一{$lang->storyCommon}不属于同一产品!"; +$lang->story->needNotReviewList[0] = '需要评审'; +$lang->story->needNotReviewList[1] = '不需要评审'; + $lang->story->useList[0] = '不使用'; $lang->story->useList[1] = '使用'; @@ -233,8 +238,9 @@ $lang->story->errorNotSubdivide = "状态不是激活,或者阶段不是 $lang->story->mustChooseResult = '必须选择评审结果'; $lang->story->mustChoosePreVersion = '必须选择回溯的版本'; $lang->story->noStory = "暂时没有{$lang->storyCommon}。"; -$lang->story->ignoreChangeStage = "{$lang->storyCommon} %s 为草稿状态,没有修改其阶段。"; +$lang->story->ignoreChangeStage = "{$lang->storyCommon} %s 为草稿状态或已关闭状态,没有修改其阶段。"; $lang->story->cannotDeleteParent = "不能删除父{$lang->storyCommon}"; +$lang->story->moveChildrenTips = "修改父{$lang->storyCommon}的所属产品会将其下的子{$lang->storyCommon}也移动到所选产品下。"; $lang->story->form = new stdclass(); $lang->story->form->area = "该{$lang->storyCommon}所属范围"; diff --git a/module/story/lang/zh-tw.php b/module/story/lang/zh-tw.php index efda7136e4..26eeea5c62 100644 --- a/module/story/lang/zh-tw.php +++ b/module/story/lang/zh-tw.php @@ -58,6 +58,8 @@ $lang->story->batchChangeStage = "批量修改階段"; $lang->story->batchAssignTo = "批量指派"; $lang->story->batchChangeModule = "批量修改模組"; $lang->story->viewAll = '查看全部'; +$lang->story->skipStory = '需求:%s 為父需求,將不會被關閉。'; +$lang->story->closedStory = '需求:%s 已關閉,將不會被關閉。'; $lang->story->common = $lang->storyCommon; $lang->story->id = '編號'; @@ -123,6 +125,9 @@ $lang->story->released = "已發佈{$lang->storyCommon}數"; $lang->story->ditto = '同上'; $lang->story->dittoNotice = "該{$lang->storyCommon}與上一{$lang->storyCommon}不屬於同一產品!"; +$lang->story->needNotReviewList[0] = '需要評審'; +$lang->story->needNotReviewList[1] = '不需要評審'; + $lang->story->useList[0] = '不使用'; $lang->story->useList[1] = '使用'; @@ -220,8 +225,9 @@ $lang->story->errorNotSubdivide = "狀態不是激活,或者階段不是 $lang->story->mustChooseResult = '必須選擇評審結果'; $lang->story->mustChoosePreVersion = '必須選擇回溯的版本'; $lang->story->noStory = "暫時沒有{$lang->storyCommon}。"; -$lang->story->ignoreChangeStage = "{$lang->storyCommon} %s 為草稿狀態,沒有修改其階段。"; +$lang->story->ignoreChangeStage = "{$lang->storyCommon} %s 為草稿狀態或已關閉狀態,沒有修改其階段。"; $lang->story->cannotDeleteParent = "不能刪除父{$lang->storyCommon}"; +$lang->story->moveChildrenTips = "修改父{$lang->storyCommon}的所屬產品會將其下的子{$lang->storyCommon}也移動到所選產品下。"; $lang->story->form = new stdclass(); $lang->story->form->area = "該{$lang->storyCommon}所屬範圍"; diff --git a/module/story/model.php b/module/story/model.php index b3ce037e8f..288e2964f5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -193,7 +193,19 @@ class storyModel extends model if($this->checkForceReview()) $story->status = 'draft'; if($story->status == 'draft') $story->stage = $this->post->plan > 0 ? 'planned' : 'wait'; $story = $this->loadModel('file')->processImgURL($story, $this->config->story->editor->create['id'], $this->post->uid); - $this->dao->insert(TABLE_STORY)->data($story, 'spec,verify')->autoCheck()->batchCheck($this->config->story->create->requiredFields, 'notempty')->exec(); + + $requiredFields = "," . $this->config->story->create->requiredFields . ","; + + if($story->type == 'requirement') $requiredFields = str_replace(',plan,', ',', $requiredFields); + if(strpos($requiredFields, ',estimate,') !== false) + { + if(strlen(trim($story->estimate)) == 0) dao::$errors['estimate'] = sprintf($this->lang->error->notempty, $this->lang->story->estimate); + $requiredFields = str_replace(',estimate,', ',', $requiredFields); + } + + $requiredFields = trim($requiredFields, ','); + + $this->dao->insert(TABLE_STORY)->data($story, 'spec,verify')->autoCheck()->batchCheck($requiredFields, 'notempty')->exec(); if(!dao::isError()) { $storyID = $this->dao->lastInsertID(); @@ -302,8 +314,9 @@ class storyModel extends model if(isset($stories->uploadImage)) $this->loadModel('file'); - $forceReview = $this->checkForceReview(); - $data = array(); + $extendFields = $this->getFlowExtendFields(); + $forceReview = $this->checkForceReview(); + $data = array(); foreach($stories->title as $i => $title) { if(empty($title)) continue; @@ -319,16 +332,32 @@ class storyModel extends model $story->estimate = $stories->estimate[$i]; $story->status = ($stories->needReview[$i] == 0 and !$forceReview) ? 'active' : 'draft'; $story->keywords = $stories->keywords[$i]; + $story->sourceNote = $stories->sourceNote[$i]; $story->product = $productID; $story->program = $this->session->program; $story->openedBy = $this->app->user->account; $story->openedDate = $now; $story->version = 1; + foreach($extendFields as $extendField) + { + $story->{$extendField->field} = htmlspecialchars($this->post->{$extendField->field}[$i]); + $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); + if($message) die(js::alert($message)); + } + foreach(explode(',', $this->config->story->create->requiredFields) as $field) { $field = trim($field); - if($field and empty($story->$field)) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->story->$field))); + if(empty($field)) continue; + if($type == 'requirement' and $field == 'plan') continue; + + if(!isset($story->$field)) continue; + if(!empty($story->$field)) continue; + if($field == 'estimate' and strlen(trim($story->estimate)) != 0) continue; + + dao::$errors['message'][] = sprintf($this->lang->error->notempty, $this->lang->story->$field); + return false; } $data[$i] = $story; @@ -336,9 +365,7 @@ class storyModel extends model foreach($data as $i => $story) { - $this->dao->insert(TABLE_STORY)->data($story)->autoCheck() - ->batchCheck($this->config->story->create->requiredFields, 'notempty') - ->exec(); + $this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->exec(); if(dao::isError()) { echo js::error(dao::getError()); @@ -366,7 +393,7 @@ class storyModel extends model unset($file['realpath']); if(!is_dir($this->file->savePath)) mkdir($this->file->savePath, 0777, true); - if(rename($realPath, $this->file->savePath . $this->file->getSaveName($file['pathname']))) + if($realPath and rename($realPath, $this->file->savePath . $this->file->getSaveName($file['pathname']))) { $file['addedBy'] = $this->app->user->account; $file['addedDate'] = $now; @@ -389,6 +416,8 @@ class storyModel extends model $this->dao->insert(TABLE_STORYSPEC)->data($specData)->exec(); + $this->executeHooks($storyID); + $actionID = $this->action->create('story', $storyID, 'Opened', ''); if(!dao::isError()) $this->loadModel('score')->create('story', 'create',$storyID); $mails[$i] = new stdclass(); @@ -518,7 +547,8 @@ class storyModel extends model ->setIF($this->post->closedReason != false and $oldStory->closedDate == '', 'closedDate', $now) ->setIF($this->post->closedBy != false or $this->post->closedReason != false, 'status', 'closed') ->setIF($this->post->closedReason != false and $this->post->closedBy == false, 'closedBy', $this->app->user->account) - ->setIF($this->post->plan[0] and ($oldStory->stage == 'wait'), 'stage', 'planned') + ->setIF(!empty($_POST['plan'][0]) and $oldStory->stage == 'wait', 'stage', 'planned') + ->stripTags($this->config->story->editor->edit['id'], $this->config->allowedTags) ->join('reviewedBy', ',') ->join('mailto', ',') ->join('linkStories', ',') @@ -539,9 +569,9 @@ class storyModel extends model foreach($this->post->stages as $branch => $stage) { $newStage = new stdclass(); - $newStage->story = $storyID; - $newStage->branch = $branch; - $newStage->stage = $stage; + $newStage->story = $storyID; + $newStage->branch = $branch; + $newStage->stage = $stage; if(isset($oldStages[$branch])) { $oldStage = $oldStages[$branch]; @@ -557,7 +587,7 @@ class storyModel extends model } $story->stage = $minStage; } - if($oldStory->stage != $story->stage) $story->stagedBy = (strpos('tested|verified|released|closed', $story->stage) !== false) ? $this->app->user->account : ''; + if(isset($story->stage) and $oldStory->stage != $story->stage) $story->stagedBy = (strpos('tested|verified|released|closed', $story->stage) !== false) ? $this->app->user->account : ''; $this->dao->update(TABLE_STORY) ->data($story) @@ -571,16 +601,11 @@ class storyModel extends model { if($story->product != $oldStory->product) { - $this->dao->update(TABLE_PROJECTSTORY)->set('product')->eq($story->product)->where('story')->eq($storyID)->exec(); - $storyProjects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->orderBy('project')->fetchPairs('project', 'project'); - $linkedProjects = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('project')->in($storyProjects)->andWhere('product')->eq($story->product)->orderBy('project')->fetchPairs('project','project'); - $unlinkedProjects = array_diff($storyProjects, $linkedProjects); - foreach($unlinkedProjects as $projectID) + $this->updateStoryProduct($storyID, $story->product); + if($oldStory->parent == '-1') { - $data = new stdclass(); - $data->project = $projectID; - $data->product = $story->product; - $this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec(); + $childStories = $this->dao->select('id')->from(TABLE_STORY)->where('parent')->eq($storyID)->andWhere('deleted')->eq(0)->fetchPairs('id'); + foreach($childStories as $childStoryID) $this->updateStoryProduct($childStoryID, $story->product); } } @@ -634,12 +659,39 @@ class storyModel extends model if(isset($story->closedReason) and $story->closedReason == 'done') $this->loadModel('score')->create('story', 'close'); + /* Fix bug #3153. */ + if($oldStory->plan != $story->plan and (empty($oldStory->plan) or empty($story->plan))) $this->setStage($storyID); + unset($oldStory->parent); unset($story->parent); return common::createChanges($oldStory, $story); } } + /** + * Update story product. + * + * @param int $storyID + * @param int $productID + * @access public + * @return void + */ + public function updateStoryProduct($storyID, $productID) + { + $this->dao->update(TABLE_STORY)->set('product')->eq($productID)->where('id')->eq($storyID)->exec(); + $this->dao->update(TABLE_PROJECTSTORY)->set('product')->eq($productID)->where('story')->eq($storyID)->exec(); + $storyProjects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($storyID)->orderBy('project')->fetchPairs('project', 'project'); + $linkedProjects = $this->dao->select('project')->from(TABLE_PROJECTPRODUCT)->where('project')->in($storyProjects)->andWhere('product')->eq($productID)->orderBy('project')->fetchPairs('project','project'); + $unlinkedProjects = array_diff($storyProjects, $linkedProjects); + foreach($unlinkedProjects as $projectID) + { + $data = new stdclass(); + $data->project = $projectID; + $data->product = $productID; + $this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec(); + } + } + /** * Update parent status. * @@ -782,7 +834,7 @@ class storyModel extends model if($data->pris[$storyID] == 'ditto') $data->pris[$storyID] = isset($prev['pri']) ? $prev['pri'] : 0; if(isset($data->branches) and $data->branches[$storyID] == 'ditto') $data->branches[$storyID] = isset($prev['branch']) ? $prev['branch'] : 0; if($data->modules[$storyID] == 'ditto') $data->modules[$storyID] = isset($prev['module']) ? $prev['module'] : 0; - if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : 0; + if($data->plans[$storyID] == 'ditto') $data->plans[$storyID] = isset($prev['plan']) ? $prev['plan'] : ''; if($data->sources[$storyID] == 'ditto') $data->sources[$storyID] = isset($prev['source']) ? $prev['source'] : ''; if(isset($data->stages[$storyID]) and ($data->stages[$storyID] == 'ditto')) $data->stages[$storyID] = isset($prev['stage']) ? $prev['stage'] : ''; if(isset($data->closedBys[$storyID]) and ($data->closedBys[$storyID] == 'ditto')) $data->closedBys[$storyID] = isset($prev['closedBy']) ? $prev['closedBy'] : ''; @@ -798,6 +850,7 @@ class storyModel extends model if(isset($data->closedReasons[$storyID])) $prev['closedReason'] = $data->closedReasons[$storyID]; } + $extendFields = $this->getFlowExtendFields(); foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; @@ -825,13 +878,19 @@ class storyModel extends model $story->version = $story->title == $oldStory->title ? $oldStory->version : $oldStory->version + 1; if($story->stage != $oldStory->stage) $story->stagedBy = (strpos('tested|verified|released|closed', $story->stage) !== false) ? $this->app->user->account : ''; - if($story->title != $oldStory->title) $story->status = 'changed'; - if($story->plan !== false and $story->plan == '') $story->plan = 0; + if($story->title != $oldStory->title and $story->status != draft) $story->status = 'changed'; if($story->closedBy != false and $oldStory->closedDate == '') $story->closedDate = $now; if($story->closedReason != false and $oldStory->closedDate == '') $story->closedDate = $now; if($story->closedBy != false or $story->closedReason != false) $story->status = 'closed'; if($story->closedReason != false and $story->closedBy == false) $story->closedBy = $this->app->user->account; + foreach($extendFields as $extendField) + { + $story->{$extendField->field} = htmlspecialchars($this->post->{$extendField->field}[$storyID]); + $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); + if($message) die(js::alert($message)); + } + $stories[$storyID] = $story; } @@ -859,6 +918,8 @@ class storyModel extends model if(!dao::isError()) { + $this->executeHooks($storyID); + $this->setStage($storyID); if($story->closedReason == 'done') $this->loadModel('score')->create('story', 'close'); $allChanges[$storyID] = common::createChanges($oldStory, $story); @@ -895,10 +956,10 @@ class storyModel extends model $now = helper::now(); $date = helper::today(); $story = fixer::input('post') - ->remove('result,preVersion,comment') ->setDefault('reviewedDate', $date) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) + ->setDefault('reviewedBy', '') ->setIF($this->post->result == 'pass' and $oldStory->status == 'draft', 'status', 'active') ->setIF($this->post->result == 'pass' and $oldStory->status == 'changed', 'status', 'active') ->setIF($this->post->result == 'reject', 'closedBy', $this->app->user->account) @@ -913,6 +974,7 @@ class storyModel extends model ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'duplicate', 'duplicateStory') ->removeIF($this->post->result == 'reject' and $this->post->closedReason != 'subdivided', 'childStories') ->join('reviewedBy', ',') + ->remove('result,preVersion,comment') ->get(); /* fix bug #671. */ @@ -928,7 +990,12 @@ class storyModel extends model { $preTitle = $this->dao->select('title')->from(TABLE_STORYSPEC)->where('story')->eq($storyID)->andWHere('version')->eq($this->post->preVersion)->fetch('title'); $this->dao->update(TABLE_STORY)->set('title')->eq($preTitle)->where('id')->eq($storyID)->exec(); - $this->dao->delete()->from(TABLE_STORYSPEC)->where('story')->eq($storyID)->andWHere('version')->eq($oldStory->version)->exec(); + + /* Delete versions that is after this version. */ + $deleteVersion = array(); + for($version = $oldStory->version; $version > $story->version; $version --) $deleteVersion[] = $version; + if($deleteVersion) $this->dao->delete()->from(TABLE_STORYSPEC)->where('story')->eq($storyID)->andWHere('version')->in($deleteVersion)->exec(); + $this->dao->delete()->from(TABLE_FILE)->where('objectType')->eq('story')->andWhere('objectID')->eq($storyID)->andWhere('extra')->eq($oldStory->version)->exec(); } if($this->post->result != 'reject') $this->setStage($storyID); @@ -1085,7 +1152,7 @@ class storyModel extends model /* Update parent story status. */ if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent); - + $this->setStage($storyID); if(!dao::isError()) $this->loadModel('score')->create('story', 'close', $storyID); return common::createChanges($oldStory, $story); } @@ -1105,10 +1172,11 @@ class storyModel extends model $data = fixer::input('post')->get(); $storyIdList = $data->storyIdList ? $data->storyIdList : array(); - $oldStories = $this->getByList($storyIdList); + $oldStories = $this->getByList($storyIdList); foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; + if($oldStory->parent == -1) continue; if($oldStory->status == 'closed') continue; $story = new stdclass(); @@ -1146,7 +1214,7 @@ class storyModel extends model { /* Update parent story status. */ if($oldStory->parent > 0) $this->updateParentStatus($storyID, $oldStory->parent); - + $this->setStage($storyID); $allChanges[$storyID] = common::createChanges($oldStory, $story); } else @@ -1275,7 +1343,7 @@ class storyModel extends model foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; - if($oldStory->status == 'draft') + if($oldStory->status == 'draft' or $oldStory->status == 'closed') { $ignoreStories .= "#{$storyID} "; continue; @@ -1393,13 +1461,14 @@ class storyModel extends model public function setStage($storyID) { $storyID = (int)$storyID; + $account = $this->app->user->account; /* Get projects which status is doing. */ $oldStages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->eq($storyID)->fetchAll('branch'); $this->dao->delete()->from(TABLE_STORYSTAGE)->where('story')->eq($storyID)->exec(); $story = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch(); - if(!empty($story->stagedBy)) return false; + if(!empty($story->stagedBy) and $story->status != 'closed') return false; $product = $this->dao->findById($story->product)->from(TABLE_PRODUCT)->fetch(); $projects = $this->dao->select('t1.project,t3.branch')->from(TABLE_PROJECTSTORY)->alias('t1') @@ -1417,6 +1486,15 @@ class storyModel extends model foreach($plans as $branch) $stages[$branch] = 'planned'; } + /* When the status is closed, phase = is also changed to closed. */ + if($story->status == 'closed') + { + $this->dao->update(TABLE_STORY)->set('stage')->eq('closed')->where('id')->eq($storyID)->exec(); + foreach($stages as $branch => $stage) $this->dao->replace(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq('closed')->exec(); + foreach($projects as $project => $branch) $this->dao->replace(TABLE_STORYSTAGE)->set('story')->eq($storyID)->set('branch')->eq($branch)->set('stage')->eq('closed')->exec(); + return false; + } + /* If no projects, in plan, stage is planned. No plan, wait. */ if(!$projects) { @@ -1480,8 +1558,8 @@ class storyModel extends model $branchStatusList = array(); $branchDevelTasks = array(); $branchTestTasks = array(); - $statusList['devel'] = array('wait' => 0, 'doing' => 0, 'done'=> 0); - $statusList['test'] = array('wait' => 0, 'doing' => 0, 'done'=> 0); + $statusList['devel'] = array('wait' => 0, 'doing' => 0, 'done'=> 0, 'pause' => 0); + $statusList['test'] = array('wait' => 0, 'doing' => 0, 'done'=> 0, 'pause' => 0); foreach($tasks as $type => $typeTasks) { foreach($typeTasks as $task) @@ -1525,9 +1603,9 @@ class storyModel extends model if($statusList['devel']['wait'] > 0 and $statusList['devel']['done'] > 0 and $statusList['test']['wait'] == $testTasks) $stage = 'developing'; if($statusList['devel']['done'] == $develTasks and $develTasks > 0 and $statusList['test']['wait'] == $testTasks) $stage = 'developed'; if($statusList['devel']['done'] == $develTasks and $develTasks > 0 and $statusList['test']['wait'] > 0 and $statusList['test']['done'] > 0) $stage = 'testing'; - if($statusList['test']['doing'] > 0) $stage = 'testing'; + if($statusList['test']['doing'] > 0 or $statusList['test']['pause'] > 0) $stage = 'testing'; if(($statusList['devel']['wait'] > 0 or $statusList['devel']['doing'] > 0) and $statusList['test']['done'] == $testTasks and $testTasks > 0) $stage = 'testing'; - if($statusList['devel']['done'] == $develTasks and $develTasks > 0 and $statusList['test']['done'] == $testTasks and $testTasks > 0) $stage = 'tested'; + if($statusList['devel']['done'] == $develTasks and $statusList['test']['done'] == $testTasks and $testTasks > 0) $stage = 'tested'; $stages[$branch] = $stage; } @@ -1589,7 +1667,7 @@ class storyModel extends model if($browseType == 'bySearch') { - $stories2Link = $this->getBySearch($story->product, $queryID, 'id', null, '', $story->branch, $tmpStoryType); + $stories2Link = $this->getBySearch($story->product, $story->branch, $queryID, 'id', '', $tmpStoryType); foreach($stories2Link as $key => $story2Link) { if($story2Link->id == $storyID) unset($stories2Link[$key]); @@ -1620,13 +1698,14 @@ class storyModel extends model * @param string $status * @param string $type requirement|story * @param string $orderBy + * @param array|string $excludeStories * @param object $pager * @param bool $hasParent * * @access public * @return array */ - public function getProductStories($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $type = 'story', $orderBy = 'id_desc', $pager = null, $hasParent = true) + public function getProductStories($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $type = 'story', $orderBy = 'id_desc', $hasParent = true, $excludeStories = '', $pager = null) { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getStories(); @@ -1641,6 +1720,7 @@ class storyModel extends model ->beginIF(!$hasParent)->andWhere("parent")->ge(0)->fi() ->beginIF($branch)->andWhere("branch")->in($branch)->fi() ->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi() + ->beginIF(!empty($excludeStories))->andWhere('id')->notIN($excludeStories)->fi() ->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi() ->andWhere('deleted')->eq(0) ->andWhere('type')->eq($type) @@ -1839,16 +1919,17 @@ class storyModel extends model * * @access public * @param int $productID + * @param int $branch * @param int $queryID * @param string $orderBy - * @param object $pager * @param string $projectID - * @param int $branch * @param string $type requirement|story + * @param string $excludeStories + * @param object $pager * @access public * @return array */ - public function getBySearch($productID, $queryID, $orderBy, $pager = null, $projectID = '', $branch = 0, $type = 'story') + public function getBySearch($productID, $branch = 0, $queryID, $orderBy, $projectID = '', $type = 'story', $excludeStories = '', $pager = null) { if($projectID != '') { @@ -1877,6 +1958,8 @@ class storyModel extends model $queryProductID = 'all'; } $storyQuery = $storyQuery . ' AND `product` ' . helper::dbIN(array_keys($products)); + if($excludeStories) $storyQuery = $storyQuery . ' AND `id` NOT ' . helper::dbIN($excludeStories); + if($this->app->moduleName == 'productplan') $storyQuery .= " AND `status` NOT IN ('closed') AND `parent` >= 0 "; if($projectID != '') { foreach($products as $product) $branches[$product->branch] = $product->branch; @@ -1954,11 +2037,13 @@ class storyModel extends model * @param string $orderBy * @param string $type * @param int $param + * @param string $storyType + * @param string $excludeStories * @param object $pager * @access public * @return array */ - public function getProjectStories($projectID = 0, $orderBy = 't1.`order`_desc', $type = 'byModule', $param = 0, $pager = null) + public function getProjectStories($projectID = 0, $orderBy = 't1.`order`_desc', $type = 'byModule', $param = 0, $storyType = 'story', $excludeStories = '', $pager = null) { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProjectStories(); @@ -1994,6 +2079,8 @@ class storyModel extends model ->where($storyQuery) ->andWhere('t1.project')->eq((int)$projectID) ->andWhere('t2.deleted')->eq(0) + ->andWhere('t2.type')->eq($storyType) + ->beginIF($excludeStories)->andWhere('t2.id')->notIN($excludeStories)->fi() ->orderBy($orderBy) ->page($pager, 't2.id') ->fetchAll('id'); @@ -2014,6 +2101,8 @@ class storyModel extends model ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.project = t3.project') ->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t2.product = t4.id') ->where('t1.project')->eq((int)$projectID) + ->andWhere('t2.type')->eq($storyType) + ->beginIF($excludeStories)->andWhere('t2.id')->notIN($excludeStories)->fi() ->beginIF(!empty($productParam))->andWhere('t1.product')->eq($productParam)->fi() ->beginIF(!empty($branchParam))->andWhere('t2.branch')->eq($branchParam)->fi() ->beginIF($modules)->andWhere('t2.module')->in($modules)->fi() @@ -2123,6 +2212,7 @@ class storyModel extends model $stories = $this->dao->select('id, title')->from(TABLE_STORY) ->where('deleted')->eq(0) ->andWhere('parent')->le(0) + ->andWhere('type')->eq('story') ->andWhere('status')->notin('closed,draft') ->andWhere('product')->eq($productID) ->beginIF($append)->orWhere('id')->in($append)->fi() @@ -2237,7 +2327,7 @@ class storyModel extends model */ public function getZeroCase($productID, $orderBy = 'id_desc') { - $allStories = $this->getProductStories($productID, 0, 0, 'all', 'story', $orderBy, null, $hasParent = false); + $allStories = $this->getProductStories($productID, 0, 0, 'all', 'story', $orderBy, $hasParent = false, '', null); $casedStories = $this->dao->select('DISTINCT story')->from(TABLE_CASE)->where('product')->eq($productID)->andWhere('story')->ne(0)->andWhere('deleted')->eq(0)->fetchAll('story'); foreach($allStories as $key => $story) @@ -2309,7 +2399,7 @@ class storyModel extends model $moduleNames = $this->dao->select('id, name')->from(TABLE_MODULE)->where('id')->in($modules)->fetchPairs();*/ /* Format these stories. */ - $storyPairs = array('' => ''); + $storyPairs = array(0 => ''); $i = 0; foreach($stories as $story) { @@ -2668,11 +2758,12 @@ class storyModel extends model if($story->parent < 0 and $action != 'edit' and $action != 'batchcreate') return false; - if($action == 'change') return $story->status != 'closed'; - if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; - if($action == 'close') return $story->status != 'closed'; - if($action == 'activate') return $story->status == 'closed'; - if($action == 'assignto') return $story->status != 'closed'; + if($action == 'change') return $story->status != 'closed'; + if($action == 'review') return $story->status == 'draft' or $story->status == 'changed'; + if($action == 'close') return $story->status != 'closed'; + if($action == 'activate') return $story->status == 'closed'; + if($action == 'assignto') return $story->status != 'closed'; + if($action == 'createcase') return $story->type != 'requirement'; if($action == 'batchcreate' and $story->parent > 0) return false; if($action == 'batchcreate' and $story->type == 'requirement') return $story->status != 'draft'; if($action == 'batchcreate' and ($story->status != 'active' or $story->stage != 'wait')) return false; @@ -2705,7 +2796,7 @@ class storyModel extends model ->fetchPairs('id', 'title'); /* For requirement children. */ - if($type == 'requirement' && !empty($this->config->urAndSr)) + if($type == 'requirement' && !empty($this->config->URAndSR)) { $relations = $this->dao->select('DISTINCT AID, BID')->from(TABLE_RELATION) ->where('AID')->in(array_keys($stories)) @@ -2745,7 +2836,7 @@ class storyModel extends model else { $parent = $parents[$story->parent]; - $story->parentName = $story->title; + $story->parentName = $parent->title; } } @@ -2776,6 +2867,17 @@ class storyModel extends model */ public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story') { + $canBatchEdit = common::hasPriv('story', 'batchEdit'); + $canBatchClose = common::hasPriv('story', 'batchClose'); + $canBatchReview = common::hasPriv('story', 'batchReview'); + $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); + $canBatchChangeBranch = common::hasPriv('story', 'batchChangeBranch'); + $canBatchChangeModule = common::hasPriv('story', 'batchChangeModule'); + $canBatchChangePlan = common::hasPriv('story', 'batchChangePlan'); + $canBatchAssignTo = common::hasPriv('story', 'batchAssignTo'); + + $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo); + $canView = common::hasPriv('story', 'view'); $storyLink = helper::createLink('story', 'view', "storyID=$story->id"); $account = $this->app->user->account; @@ -2822,6 +2924,13 @@ class storyModel extends model else if($id == 'stage') { $style .= 'overflow: visible;'; + if(isset($storyStages[$story->id])) + { + foreach($storyStages[$story->id] as $storyBranch => $storyStage) + { + if(isset($branches[$storyBranch])) $title .= $branches[$storyBranch] . ": " . $this->lang->story->stageList[$storyStage->stage] . "\n"; + } + } } echo ""; @@ -2829,7 +2938,14 @@ class storyModel extends model switch($id) { case 'id': - echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); + if($canBatchAction) + { + echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); + } + else + { + printf('%03d', $story->id); + } break; case 'pri': echo ""; @@ -2874,7 +2990,7 @@ class storyModel extends model echo $story->estimate; break; case 'stage': - if(isset($storyStages[$story->id])) + if(isset($storyStages[$story->id]) and !empty($branches)) { echo " + diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 89d4839d80..2c1c2e1172 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -229,6 +229,7 @@ class testsuite extends control } else { + $suite = $this->testsuite->getById($suiteID); if($suite->type == 'private' and $suite->addedBy != $this->app->user->account and !$this->app->user->admin) die(js::error($this->lang->error->accessDenied) . js::locate('back')); $this->testsuite->delete($suiteID); diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php index 9b68a8ebba..04b8db7021 100644 --- a/module/testsuite/view/browse.html.php +++ b/module/testsuite/view/browse.html.php @@ -26,7 +26,7 @@
    -
    +

    diff --git a/module/testtask/control.php b/module/testtask/control.php index 44abce1176..81f0b2871b 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -845,7 +845,8 @@ class testtask extends control $this->loadModel('testcase'); $this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID]); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); - $this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID"); + $this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID&type=$type¶m=$param"); + $this->config->testcase->search['style'] = 'simple'; if($this->session->currentProductType == 'normal') { unset($this->config->testcase->search['fields']['branch']); diff --git a/module/testtask/css/create.css b/module/testtask/css/create.css index 6e25082ff1..8b893c353a 100644 --- a/module/testtask/css/create.css +++ b/module/testtask/css/create.css @@ -1,2 +1,3 @@ #mailtoGroup .input-group-btn > .btn {margin-left: -1px!important;} #mailtoGroup .chosen-container-single a {border-left-width: 0px;} +#ownerAndPriBox .picker .picker-selections .picker-selection{width:180px;} \ No newline at end of file diff --git a/module/testtask/lang/de.php b/module/testtask/lang/de.php index 6c0581064c..c80f4d76b8 100644 --- a/module/testtask/lang/de.php +++ b/module/testtask/lang/de.php @@ -15,6 +15,7 @@ $lang->testtask->reportChart = 'Bericht'; $lang->testtask->reportAction = 'Case Report'; $lang->testtask->delete = "Löschen"; $lang->testtask->importUnitResult = "Import Unit Result"; +$lang->testtask->importunitresult = "Import Unit Result"; //Fix bug custom required testtask. $lang->testtask->browseUnits = "Unit Test List"; $lang->testtask->unitCases = "Unit Test Cases"; $lang->testtask->view = "Übersicht"; diff --git a/module/testtask/lang/en.php b/module/testtask/lang/en.php index 24fe6cde41..65277edc5f 100644 --- a/module/testtask/lang/en.php +++ b/module/testtask/lang/en.php @@ -15,6 +15,7 @@ $lang->testtask->reportChart = 'Report'; $lang->testtask->reportAction = 'Case Report'; $lang->testtask->delete = "Delete Request"; $lang->testtask->importUnitResult = "Import Unit Result"; +$lang->testtask->importunitresult = "Import Unit Result"; //Fix bug custom required testtask. $lang->testtask->browseUnits = "Unit Test List"; $lang->testtask->unitCases = "Unit Test Cases"; $lang->testtask->view = "Request Detail"; diff --git a/module/testtask/lang/fr.php b/module/testtask/lang/fr.php index a58d04b19b..d915a71cbb 100644 --- a/module/testtask/lang/fr.php +++ b/module/testtask/lang/fr.php @@ -14,9 +14,10 @@ $lang->testtask->create = "Initier Campagne"; $lang->testtask->reportChart = 'Rapport'; $lang->testtask->reportAction = 'Rapport CasTests'; $lang->testtask->delete = "Supprimer Campagne"; -$lang->testtask->importUnitResult = "Import Unit Result"; -$lang->testtask->browseUnits = "Unit Test List"; -$lang->testtask->unitCases = "Unit Test Cases"; +$lang->testtask->importUnitResult = "Import T.U. Résult"; +$lang->testtask->importunitresult = "Import T.U. Résult"; //Fix bug custom required testtask. +$lang->testtask->browseUnits = "Liste des tests unitaires"; +$lang->testtask->unitCases = "Cas de test unitaires"; $lang->testtask->view = "Détail Campagne"; $lang->testtask->edit = "Editer Campagne"; $lang->testtask->browse = "Tester Campagne"; @@ -59,8 +60,8 @@ $lang->testtask->product = $lang->productCommon; $lang->testtask->project = $lang->projectCommon; $lang->testtask->build = 'Build'; $lang->testtask->owner = 'Owner'; -$lang->testtask->executor = 'Executor'; -$lang->testtask->execTime = 'Exec Time'; +$lang->testtask->executor = 'Executeur'; +$lang->testtask->execTime = 'Durée Exec'; $lang->testtask->pri = 'Priorité'; $lang->testtask->name = 'Nom Campagne'; $lang->testtask->begin = 'Début'; @@ -68,7 +69,7 @@ $lang->testtask->end = 'Fin'; $lang->testtask->desc = 'Description'; $lang->testtask->mailto = 'Mailto'; $lang->testtask->status = 'Statut'; -$lang->testtask->subStatus = 'Sub Status'; +$lang->testtask->subStatus = 'Sous-statut'; $lang->testtask->assignedTo = 'Affecté'; $lang->testtask->linkVersion = 'Build'; $lang->testtask->lastRunAccount = 'Jouée par'; @@ -83,12 +84,12 @@ $lang->testtask->stepResults = 'Etape Résultat'; $lang->testtask->lastRunner = 'Joué par'; $lang->testtask->lastRunDate = 'Dernier Run'; $lang->testtask->date = 'Testé sur';; -$lang->testtask->deleted = "Deleted"; -$lang->testtask->resultFile = "Result File"; -$lang->testtask->caseCount = 'Case Count'; +$lang->testtask->deleted = "Supprimé"; +$lang->testtask->resultFile = "Fichier Résultats"; +$lang->testtask->caseCount = 'Compteur CasTest'; $lang->testtask->passCount = 'Pass'; $lang->testtask->failCount = 'Fail'; -$lang->testtask->summary = '%s cases, %s failures, %s time.'; +$lang->testtask->summary = '%s CasTest, %s échecs, %s heures.'; $lang->testtask->beginAndEnd = 'Durée'; $lang->testtask->to = 'à'; @@ -124,9 +125,9 @@ $lang->testtask->confirmUnlinkCase = 'Voulez-vous détacher ce CasTest ?'; $lang->testtask->noticeNoOther = "Il n'y a pas de Campagnes de Recette pour ce product."; $lang->testtask->noTesttask = 'Pas de campagne. '; $lang->testtask->checkLinked = "Vérifiez si le product auquel la campagne de recette est associée est bien lié à un projet."; -$lang->testtask->noImportData = 'The imported XML does not parse the data.'; -$lang->testtask->unitXMLFormat = 'Please select a file in JUnit XML format.'; -$lang->testtask->titleOfAuto = "%s automated testing"; +$lang->testtask->noImportData = "Le XML importé ne parse pas les données."; +$lang->testtask->unitXMLFormat = 'Veuillez sélectionner un fichier au format XML JUnit.'; +$lang->testtask->titleOfAuto = "%s tests automatisés"; $lang->testtask->assignedToMe = 'Affecté à Moi'; $lang->testtask->allCases = 'Tous les CasTests'; diff --git a/module/testtask/lang/vi.php b/module/testtask/lang/vi.php index eb0155f6eb..4bb1666c1a 100644 --- a/module/testtask/lang/vi.php +++ b/module/testtask/lang/vi.php @@ -15,6 +15,7 @@ $lang->testtask->reportChart = 'Báo cáo'; $lang->testtask->reportAction = 'Báo cáo tình huống'; $lang->testtask->delete = "Xóa yêu cầu"; $lang->testtask->importUnitResult = "Import Unit Result"; +$lang->testtask->importunitresult = "Import Unit Result"; //Fix bug custom required testtask. $lang->testtask->browseUnits = "Unit Test List"; $lang->testtask->unitCases = "Unit Test Cases"; $lang->testtask->view = "Chi tiết yêu cầu"; diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 1d5c5d7a40..3aa542985c 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -15,6 +15,7 @@ $lang->testtask->reportChart = '报表统计'; $lang->testtask->reportAction = '用例报表统计'; $lang->testtask->delete = "删除测试单"; $lang->testtask->importUnitResult = "导入单元测试结果"; +$lang->testtask->importunitresult = "导入单元测试"; //Fix bug custom required testtask. $lang->testtask->browseUnits = "单元测试列表"; $lang->testtask->unitCases = "单元测试用例"; $lang->testtask->view = "概况"; diff --git a/module/testtask/lang/zh-tw.php b/module/testtask/lang/zh-tw.php index 3ba62570ef..d33652db9f 100644 --- a/module/testtask/lang/zh-tw.php +++ b/module/testtask/lang/zh-tw.php @@ -15,6 +15,7 @@ $lang->testtask->reportChart = '報表統計'; $lang->testtask->reportAction = '用例報表統計'; $lang->testtask->delete = "刪除測試單"; $lang->testtask->importUnitResult = "導入單元測試結果"; +$lang->testtask->importunitresult = "導入單元測試"; //Fix bug custom required testtask. $lang->testtask->browseUnits = "單元測試列表"; $lang->testtask->unitCases = "單元測試用例"; $lang->testtask->view = "概況"; diff --git a/module/testtask/model.php b/module/testtask/model.php index dc4c4748b2..0f98ac1f28 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -259,7 +259,7 @@ class testtaskModel extends model ->where('t1.deleted')->eq(0) ->andWhere('t1.auto')->ne('unit') - ->andWhere('t3.id')->in($this->app->user->view->projects) + ->andWhere('t1.project')->in("0,{$this->app->user->view->projects}") //Fix bug #3260. ->beginIF($scopeAndStatus[0] == 'local')->andWhere('t1.product')->eq((int)$productID)->fi() ->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi() ->beginIF($scopeAndStatus[1] == 'totalStatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi() @@ -399,15 +399,29 @@ class testtaskModel extends model } else { - $task = $this->dao->select("t1.*, t2.name AS productName, t2.type AS productType, t3.name AS projectName, t4.name AS buildName, if(t4.name != '', t4.branch, t5.branch) AS branch") - ->from(TABLE_TESTTASK)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') - ->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id') - ->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id') - ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project = t5.project') - ->where('t1.id')->eq((int)$taskID) - ->andWhere('t5.product = t1.product') - ->fetch(); + $task = $this->dao->select("*")->from(TABLE_TESTTASK)->where('id')->eq((int)$taskID)->fetch(); + if($task) + { + $product = $this->dao->select('name,type')->from(TABLE_PRODUCT)->where('id')->eq($task->product)->fetch(); + $task->productName = $product->name; + $task->productType = $product->type; + $task->branch = 0; + $task->projectName = ''; + $task->buildName = ''; + + if($task->project) + { + $task->projectName = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($task->project)->fetch('name'); + $task->branch = $this->dao->select('branch')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($task->project)->andWhere('product')->eq($task->product)->fetch('branch'); + } + + $build = $this->dao->select('branch,name')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch(); + if($build) + { + $task->buildName = $build->name; + $task->branch = $build->branch; + } + } } if(!$task) return false; @@ -482,7 +496,7 @@ class testtaskModel extends model if($type == 'bystory') $cases = $this->getLinkableCasesByStory($productID, $task, $query, $linkedCases, $pager); if($type == 'bybug') $cases = $this->getLinkableCasesByBug($productID, $task, $query, $linkedCases, $pager); if($type == 'bysuite') $cases = $this->getLinkableCasesBySuite($productID, $task, $query, $param, $linkedCases, $pager); - if($type == 'bybuild') $cases = $this->getLinkableCasesByTestTask($param, $linkedCases, $pager); + if($type == 'bybuild') $cases = $this->getLinkableCasesByTestTask($param, $linkedCases, $query, $pager); return $cases; } @@ -611,11 +625,11 @@ class testtaskModel extends model * @access public * @return array */ - public function getLinkableCasesByTestTask($testTask, $linkedCases, $pager) + public function getLinkableCasesByTestTask($testTask, $linkedCases, $query, $pager) { $caseList = $this->dao->select("`case`")->from(TABLE_TESTRUN)->where('task')->eq($testTask)->andWhere('`case`')->notin($linkedCases)->fetchPairs('case'); - return $this->dao->select("*")->from(TABLE_CASE)->where('id')->in($caseList)->andWhere('status')->ne('wait')->page($pager)->fetchAll(); + return $this->dao->select("*")->from(TABLE_CASE)->where($query)->andWhere('id')->in($caseList)->andWhere('status')->ne('wait')->page($pager)->fetchAll(); } /** @@ -722,7 +736,13 @@ class testtaskModel extends model */ public function getDataOfTestTaskPerRunner($taskID) { - $datas = $this->dao->select('lastRunner AS name, COUNT(*) AS value')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->groupBy('name')->orderBy('value DESC')->fetchAll('name'); + $datas = $this->dao->select("t1.lastRunner AS name, COUNT('t1.*') AS value")->from(TABLE_TESTRUN)->alias('t1') + ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') + ->where('t1.task')->eq($taskID) + ->andWhere('t2.deleted')->eq(0) + ->groupBy('name') + ->orderBy('value DESC') + ->fetchAll('name'); if(!$datas) return array(); $users = $this->loadModel('user')->getPairs('noclosed|noletter'); foreach($datas as $result => $data) $data->name = $result ? zget($users, $result, $result) : $this->lang->testtask->unexecuted; @@ -853,7 +873,7 @@ class testtaskModel extends model public function update($taskID) { $oldTask = $this->dao->select("*")->from(TABLE_TESTTASK)->where('id')->eq((int)$taskID)->fetch(); - $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->remove('uid,comment')->get(); + $task = fixer::input('post')->stripTags($this->config->testtask->editor->edit['id'], $this->config->allowedTags)->join('mailto', ',')->remove('uid,comment,contactListMenu')->get(); $task = $this->loadModel('file')->processImgURL($task, $this->config->testtask->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_TESTTASK)->data($task) ->autoCheck() @@ -1418,6 +1438,13 @@ class testtaskModel extends model */ public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable') { + $canBatchEdit = common::hasPriv('testcase', 'batchEdit'); + $canBatchUnlink = common::hasPriv('testtask', 'batchUnlinkCases'); + $canBatchAssign = common::hasPriv('testtask', 'batchAssign'); + $canBatchRun = common::hasPriv('testtask', 'batchRun'); + + $canBatchAction = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun); + $canView = common::hasPriv('testcase', 'view'); $caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"); $account = $this->app->user->account; @@ -1438,7 +1465,14 @@ class testtaskModel extends model switch ($id) { case 'id': - echo html::checkbox('caseIDList', array($run->case => sprintf('%03d', $run->case))); + if($canBatchAction) + { + echo html::checkbox('caseIDList', array($run->case => sprintf('%03d', $run->case))); + } + else + { + printf('%03d', $run->case); + } break; case 'pri': echo ""; @@ -1447,7 +1481,7 @@ class testtaskModel extends model break; case 'title': if($run->branch) echo "{$branches[$run->branch]}"; - echo $canView ? html::a($caseLink, $run->title) : $run->title; + echo $canView ? html::a($caseLink, $run->title, null, "style='color: $run->color'") : $run->title; break; case 'branch': echo $branches[$run->branch]; diff --git a/module/testtask/view/batchrun.html.php b/module/testtask/view/batchrun.html.php index 3510cdf61b..bfcf061d23 100644 --- a/module/testtask/view/batchrun.html.php +++ b/module/testtask/view/batchrun.html.php @@ -52,9 +52,9 @@ $stepClass = $step->type == 'item' ? 'step-item' : 'step-group'; ?> - type == 'group') echo "colspan='2'"?>>desc' class='$stepClass'>" . $ID . "、" . $step->desc . ''?> + type == 'group') echo "colspan='2'"?>>desc' class='$stepClass'>" . $ID . "、" . $step->desc . ''?> type != 'group'):?> - expect'>" . $lang->testcase->stepExpect . ":" . $step->expect . ''?> + expect'>" . $lang->testcase->stepExpect . ":" . $step->expect . ''?> testcase->resultList, 'pass', "class='form-control'")?> diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index 81e3af3916..da34ca98c8 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -103,7 +103,7 @@ $status = $this->session->testTaskVersionStatus; '; common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); + common::printIcon('testtask', 'linkCase', "taskID=$task->id&type=all¶m=myQueryID", $task, 'list', 'link'); common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list','flag'); echo '

    '; common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'list-alt','','iframe',true); diff --git a/module/testtask/view/browseunits.html.php b/module/testtask/view/browseunits.html.php index 67d5cfb9ba..ba183ad4e9 100644 --- a/module/testtask/view/browseunits.html.php +++ b/module/testtask/view/browseunits.html.php @@ -27,7 +27,7 @@ " . $lang->testtask->importUnitResult, '', "class='btn btn-primary'");?>
    -
    +

    @@ -46,7 +46,7 @@ testtask->build);?> testtask->owner);?> - testtask->execTime);?> + testtask->execTime);?> testtask->caseCount;?> testtask->passCount;?> testtask->failCount;?> diff --git a/module/testtask/view/cases.html.php b/module/testtask/view/cases.html.php index 90bcd4b547..492dbe3c03 100644 --- a/module/testtask/view/cases.html.php +++ b/module/testtask/view/cases.html.php @@ -39,7 +39,8 @@ $canBatchUnlink = common::hasPriv('testtask', 'batchUnlinkCases'); $canBatchAssign = common::hasPriv('testtask', 'batchAssign'); $canBatchRun = common::hasPriv('testtask', 'batchRun'); - $hasCheckbox = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun); + + $canBatchAction = ($canBatchEdit or $canBatchUnlink or $canBatchAssign or $canBatchRun); if($useDatatable) include '../../common/view/datatable.html.php'; if(!$useDatatable) include '../../common/view/tablesorter.html.php'; @@ -60,7 +61,7 @@ { if($value->show) { - $this->datatable->printHead($value, $orderBy, $vars); + $this->datatable->printHead($value, $orderBy, $vars, $canBatchAction); $columns ++; } } @@ -78,7 +79,7 @@ ';?>