diff --git a/config/config.php b/config/config.php index cb7c898703..7d9cbdf42f 100644 --- a/config/config.php +++ b/config/config.php @@ -16,11 +16,12 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '20.0.alpha1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. -$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. -$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. -$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. -$config->webRoot = ''; // URL根目录。 The root path of the url. +$config->version = '20.0.alpha1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. +$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. +$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. +$config->webRoot = ''; // URL根目录。 The root path of the url. +$config->customSession = false; // 是否开启自定义session的存储路径。Whether custom the session save path. /* 框架路由相关设置。Routing settings. */ $config->requestType = 'PATH_INFO'; // 请求类型:PATH_INFO|PATHINFO2|GET。 The request type: PATH_INFO|PATH_INFO2|GET. diff --git a/db/standard/xuanxuan12.4.1.sql b/db/standard/xuanxuan12.4.1.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.4.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.4.2.sql b/db/standard/xuanxuan12.4.2.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.4.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.4.3.sql b/db/standard/xuanxuan12.4.3.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.4.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.4.sql b/db/standard/xuanxuan12.4.4.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.4.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/xuanxuan12.5.sql b/db/standard/xuanxuan12.5.sql new file mode 100644 index 0000000000..5a724cf29e --- /dev/null +++ b/db/standard/xuanxuan12.5.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.5.sql b/db/standard/zentao12.5.sql new file mode 100644 index 0000000000..e023de868c --- /dev/null +++ b/db/standard/zentao12.5.sql @@ -0,0 +1,1084 @@ +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 `action` (`action`), + 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 `toStory` (`toStory`), + KEY `result` (`result`), + 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 default '1', + `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 `fromBug` (`fromBug`), + 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, + `times` tinyint(3) unsigned NOT NULL DEFAULT '0', + `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, + `mailto` text, + `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, + `PRJ` 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, + `customParam` text 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`), + KEY `objectType_toList_status` (`objectType`,`toList`,`status`) +) 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 IF NOT EXISTS `zt_planstory` ( + `plan` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL, + `order` mediumint(9) NOT NULL, + UNIQUE KEY `plan_story` (`plan`,`story`) +) 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` datetime 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 `parent` (`parent`), + 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 '', + `type` char(30) NOT NULL DEFAULT 'inside', + `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`), + KEY `deleted` (`deleted`) +) 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.4.4.sql b/db/update12.4.4.sql new file mode 100644 index 0000000000..cc54fde89a --- /dev/null +++ b/db/update12.4.4.sql @@ -0,0 +1,20 @@ +ALTER TABLE `zt_job` ADD `customParam` text AFTER `atTime`; +ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`; +ALTER TABLE `zt_task` CHANGE `realStarted` `realStarted` datetime NOT NULL AFTER `estStarted`; +ALTER TABLE `zt_group` CHANGE `program` `PRJ` mediumint(8) unsigned NOT NULL DEFAULT 0; +ALTER TABLE `zt_user` ADD `type` char(30) NOT NULL default 'inside' AFTER `account`; + +ALTER TABLE `zt_notify` ADD INDEX `objectType_toList_status` (`objectType`, `toList`, `status`); +ALTER TABLE `zt_user` ADD INDEX `deleted` (`deleted`); +ALTER TABLE `zt_case` ADD INDEX `fromBug` (`fromBug`); +ALTER TABLE `zt_bug` ADD INDEX `toStory` (`toStory`); +ALTER TABLE `zt_task` ADD INDEX `parent` (`parent`); +ALTER TABLE `zt_bug` ADD INDEX `result` (`result`); +ALTER TABLE `zt_history` ADD INDEX `action` (`action`); +ALTER TABLE `zt_action` ADD INDEX `action` (`action`); +ALTER TABLE `zt_action` DROP INDEX `product`; + +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRProduct', '1'); +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRProject', '1'); +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'xuanxuan', 'pollingInterval', '60'); +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'xuanxuan', 'aes', 'on'); diff --git a/db/zentao.sql b/db/zentao.sql index 0073b7e7be..7c553bd539 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -25,6 +25,7 @@ CREATE TABLE IF NOT EXISTS `zt_action` ( KEY `date` (`date`), KEY `actor` (`actor`), KEY `project` (`project`), + KEY `action` (`action`), KEY `objectID` (`objectID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_block`; @@ -120,6 +121,8 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( KEY `plan` (`plan`), KEY `story` (`story`), KEY `case` (`case`), + KEY `toStory` (`toStory`), + KEY `result` (`result`), KEY `assignedTo` (`assignedTo`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_budget`; @@ -217,6 +220,7 @@ CREATE TABLE IF NOT EXISTS `zt_case` ( PRIMARY KEY (`id`), KEY `product` (`product`), KEY `story` (`story`), + KEY `fromBug` (`fromBug`), KEY `module` (`module`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_casestep`; @@ -369,6 +373,7 @@ CREATE TABLE IF NOT EXISTS `zt_doc` ( `addedDate` datetime NOT NULL, `editedBy` varchar(30) NOT NULL, `editedDate` datetime NOT NULL, + `mailto` text, `acl` varchar(10) NOT NULL DEFAULT 'open', `groups` varchar(255) NOT NULL, `users` text NOT NULL, @@ -584,6 +589,7 @@ CREATE TABLE IF NOT EXISTS `zt_job` ( `svnDir` varchar(255) NOT NULL, `atDay` varchar(255) DEFAULT NULL, `atTime` varchar(10) DEFAULT NULL, + `customParam` text NOT NULL, `comment` varchar(255) DEFAULT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, @@ -617,7 +623,7 @@ CREATE TABLE IF NOT EXISTS `zt_module` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_notify`; CREATE TABLE IF NOT EXISTS `zt_notify` ( - `id` mediumint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, + `id` mediumint unsigned NOT NULL AUTO_INCREMENT, `objectType` varchar(50) NOT NULL, `objectID` mediumint unsigned NOT NULL, `action` mediumint NOT NULL, @@ -629,7 +635,9 @@ CREATE TABLE IF NOT EXISTS `zt_notify` ( `createdDate` datetime NOT NULL, `sendTime` datetime NOT NULL, `status` varchar(10) NOT NULL DEFAULT 'wait', - `failReason` text NOT NULL + `failReason` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType_toList_status` (`objectType`,`toList`,`status`) ) ENGINE='MyISAM' COLLATE 'utf8_general_ci'; -- DROP TABLE IF EXISTS `zt_oauth`; CREATE TABLE IF NOT EXISTS `zt_oauth` ( @@ -1022,7 +1030,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( `assignedTo` varchar(30) NOT NULL, `assignedDate` datetime NOT NULL, `estStarted` date NOT NULL, - `realStarted` date NOT NULL, + `realStarted` datetime NOT NULL, `finishedBy` varchar(30) NOT NULL, `finishedDate` datetime NOT NULL, `finishedList` text NOT NULL, @@ -1040,6 +1048,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( PRIMARY KEY (`id`), KEY `project` (`project`), KEY `story` (`story`), + KEY `parent` (`parent`), KEY `assignedTo` (`assignedTo`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_taskspec`; @@ -1213,6 +1222,7 @@ CREATE TABLE IF NOT EXISTS `zt_user` ( `type` char(30) NOT NULL default 'inside', `dept` mediumint(8) unsigned NOT NULL default '0', `account` char(30) NOT NULL default '', + `type` char(30) NOT NULL DEFAULT 'inside', `password` char(32) NOT NULL default '', `role` char(10) NOT NULL default '', `realname` varchar(100) NOT NULL default '', @@ -1249,7 +1259,8 @@ CREATE TABLE IF NOT EXISTS `zt_user` ( UNIQUE KEY `account` (`account`), KEY `dept` (`dept`), KEY `email` (`email`), - KEY `commiter` (`commiter`) + KEY `commiter` (`commiter`), + KEY `deleted` (`deleted`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_usercontact`; CREATE TABLE IF NOT EXISTS `zt_usercontact` ( @@ -1544,6 +1555,8 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'custom', 'working'), (1, 'custom', 'index'), (1, 'custom', 'restore'), +(1, 'custom', 'project'), +(1, 'custom', 'product'), (1, 'custom', 'set'), (1, 'dept', 'browse'), (1, 'dept', 'delete'), @@ -1754,6 +1767,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'story', 'change'), (1, 'story', 'close'), (1, 'story', 'create'), +(1, 'story', 'batchToTask'), (1, 'story', 'delete'), (1, 'story', 'edit'), (1, 'story', 'assignTo'), @@ -2027,6 +2041,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2, 'story', 'bugs'), (2, 'story', 'cases'), (2, 'story', 'view'), +(2, 'story', 'batchToTask'), (2, 'svn', 'apiSync'), (2, 'svn', 'cat'), (2, 'svn', 'diff'), @@ -2222,6 +2237,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3, 'story', 'cases'), (3, 'story', 'view'), (3, 'story', 'zeroCase'), +(3, 'story', 'batchToTask'), (3, 'svn', 'apiSync'), (3, 'svn', 'cat'), (3, 'svn', 'diff'), @@ -2509,6 +2525,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4, 'story', 'cases'), (4, 'story', 'view'), (4, 'story', 'zeroCase'), +(4, 'story', 'batchToTask'), (4, 'svn', 'apiSync'), (4, 'svn', 'cat'), (4, 'svn', 'diff'), @@ -3045,6 +3062,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6, 'story', 'cases'), (6, 'story', 'view'), (6, 'story', 'zeroCase'), +(6, 'story', 'batchToTask'), (6, 'svn', 'apiSync'), (6, 'svn', 'cat'), (6, 'svn', 'diff'), @@ -3522,6 +3540,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8, 'story', 'cases'), (8, 'story', 'view'), (8, 'story', 'zeroCase'), +(8, 'story', 'batchToTask'), (8, 'svn', 'apiSync'), (8, 'svn', 'cat'), (8, 'svn', 'diff'), @@ -4056,3 +4075,5 @@ INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system','custom','','hourPoint','1'), ('system','custom','','URAndSR','1'), ('system','custom','common','URSRName','{\"URCommon\":{\"zh-cn\":\"\\u7528\\u6237\\u9700\\u6c42\"},\"SRCommon\":{\"zh-cn\":\"\\u8f6f\\u4ef6\\u9700\\u6c42\"}}'); +INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRProduct', '1'); +INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRProject', '1'); diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 33241f4725..d822cd9513 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,100 @@ +2020-11-19 12.5.stable +完成的需求 +5487 在禅道专业版、企业版的授权中增加版本号限制 +5458 任务实际开始、完成时间记录上完整的日期+时分秒 +5389 安装成功后页面语言优化 +5387 后台-二开-应用 代号错误提醒多余标点去掉 +5383 增加需求一键转任务功能 +5382 删除项目的时候给一个确认提示 +5261 看板模式下面移动任务到进行中甬道时默认保持指派给字段不变 +5221 测试-测试单关联用例的搜索中增加所属库字段 +5219 文档增加抄送功能 +5218 可以按照指定的日期添加待办 +5217 期望版本增加标签和查询功能。 +5194 任务页面点击相关需求可以直接对需求创建用例 +5193 期望用例在测试单中显示和用例库的关联图标 +5144 后台自定义增加产品和项目的关闭后是否只读的开关 +5126 构建增加给jenkins传参功能 +4421 一键安装包兼容centos8 +4329 增加webhook权限控制 +3423 session.save_path 逻辑调整 +修复的Bug +3625 CNVD-C-2020-238015 禅道CMS存在文件上传漏洞 +3621 测试单中用例搜索后无法正常排序 +3620 升级成功后默认不应该跳转到非研发页面 +3619 国际版禅道安装和升级页面,zdoo网址应换为英文网址链接 +3618 提bug页面IE浏览器加载所有用户失败 +3617 批量编辑修改需求阶段后未起效 +3612 项目-需求 点击B字段中数据弹窗中数据统计问题 +3600 windows一键安装包无法更改数据库密码 +3599 xampp中存在大量mariadb ssl报错 +3597 父需求的任务数不会自动计算 +3596 CNVD-C-2020-204858_关于zentao开源版V12.3.3后台存在任意文件读取漏洞的情况通报 +3595 CNVD-C-2020-204868_关于zentao开源版后台存在SQL注入漏洞的情况通报 +3594 CNVD-C-2020-230107 关于禅道专业版后台存在命令执行漏洞的情况通报 +3593 CNVD-C-2020-209376_关于青岛易企天创管理咨询有限公司禅道PMS存在SQL注入漏洞的情况通报 +3592 项目需求下批量创建需求没有关联到项目 +3591 安装界面最后一步,输入框离文字太远 +3590 创建OK文件的页面,需要把刷新按钮加回来 +3589 bug 编辑页面需求没有根据模块展示,需要切换下模块才会规则生效 +3579 访问禅道加载失败时,给出刷新按钮 +3578 禅道应用的logo背景需要优化 +3577 人数较多时,抄送功能输入用户名回车后,输入信息不查询下一个用户名 +3576 父计划关联需求设计问题 +3575 开始任务关闭弹窗后按钮禁用 +3573 创建OK文件的页面,需要添加网页标题头 +3572 地盘需求只显示父需求 +3571 必填项限制无法批量创建测试任务。 +3570 细分需求后进行指派,被指派人我的地盘-需求显示问题 +3569 安装翻译插件后,创建翻译提示优化 +3568 windows和linux一键安装包切换日语后页面未能正确跳转 +3567 客户端调试页面ip地址建议与服务器设置页保持一致 +3566 企业微信应用消息绑定用户时提示“malformed” +3565 文档中编辑表格属性报错后未生效 +3564 批量编辑用例模块处没有显示title +3563 zbox一键安装包域名解析问题 +3562 自定义添加需求来源后导出需求模板无法正常打开 +3561 添加必填后批量创建需求页面提示后无法正常跳转 +3557 创建需求保存时页面有报错 +3551 父任务指派,提示剩余工时不能为空 +3550 禁用和删除日志插件后文件无法成功删除 +3548 批量编辑项目时,调整重名的逻辑 +3546 终身版插件安装后到期日期显示错误 +3543 客户端登录禅道后用户最后的登录ip记录的是xxd的ip +3535 所属计划设为必填项后不生效 +3534 用户后台绑定社区账号无法确认 +3507 集成版本库点击刷新按钮数据不更新 +3505 查看相关需求不存在时出现空白弹窗 +3504 客户端创建文档链接报错 +3503 客户端关于页面无法展示 +3502 在步骤里面编辑内容会触发页面自动滚动 +3501 发布关联子需求后父需求的阶段没有自动更新 +3500 xampp启动失败没有任何日志记录 +3496 帮助手册不能正常查看 +3493 用户被锁定,仍可以成功登录禅道客户端 +3492 锁定用户的时间,有时没到10分钟就失效 +3490 插件目录结构未显示信息 +3489 插件详情页页面需优化 +3482 改进意见:任务确认变更,展示需求的详情信息 +3481 9.6升级到12.1,有sql报错 +3480 11.5升级到12.3,升级失败有sql报错 +3479 通知邮件中的连接地址拼装不正确 +3319 创建任务提示报错,还可以正常创建 +3250 bug详情页面有2排操作按钮都可以点击 +3212 Markdown格式的文档中表格列宽显示问题 +3097 数据量大导致禅道操作过程中锁表 +3089 导出文件时编码字段默认“UTF-8”,导出的excel中文字不能正常展示。 +3078 客户端如果停留在我的地盘点击通知里面的信息跳转不过去 +3040 覆盖新版本代码后不会自动跳转upgrade.php会报错config或者userview表不存在 +3022 发布bug列表页面显示优化 +2979 数据比较多时下拉框渲染比较慢 +2963 项目-版本中解决的bug移除不过后bug解决版本没有更新 +2909 linux 在centos 8.0 兼容问题 +2855 阿里云mysql,备份数据还原报错 +2604 关闭客户端提醒后,整个页面都置灰 + +2020-11-03 12.4.4 + 2020-10-13 12.4.3 修复的Bug 2385 客户端访问禅道多次点击新手教程页面空白 diff --git a/framework/base/router.class.php b/framework/base/router.class.php index f8ebc2115e..21f0d0f6f7 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -831,6 +831,7 @@ class baseRouter { $sessionName = $this->config->sessionVar; session_name($sessionName); + if($this->config->customSession) session_save_path($this->getTmpRoot() . 'session'); session_start(); $this->sessionID = session_id(); diff --git a/framework/control.class.php b/framework/control.class.php index 5c3e5575f8..4523f7b30e 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -331,7 +331,7 @@ class control extends baseControl elseif($rule->type == 'system' and isset($_POST[$field->field])) { $checkFunc = 'check' . $rule->rule; - if(!validater::$checkFunc($_POST[$field->field])) + if(validater::$checkFunc($_POST[$field->field]) === false) { $error = zget($this->lang->error, $rule->rule, ''); if($error) $error = sprintf($error, $field->name); @@ -342,7 +342,7 @@ class control extends baseControl } 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); + if(validater::checkREG($_POST[$field->field], $rule->rule) === false) $message[$field->field][] = sprintf($this->lang->error->reg, $field->name, $rule->rule); } } } diff --git a/module/action/model.php b/module/action/model.php index 30e5fb9e11..c9d82d2385 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -210,11 +210,11 @@ class actionModel extends model $actions = $this->dao->select('*')->from(TABLE_ACTION) ->beginIF($objectType == 'project') ->where("objectType IN('project', 'testtask', 'build')") - ->andWhere('project')->eq($objectID) + ->andWhere('project')->eq((int)$objectID) ->fi() ->beginIF($objectType != 'project') ->where('objectType')->eq($objectType) - ->andWhere('objectID')->eq($objectID) + ->andWhere('objectID')->eq((int)$objectID) ->fi() ->orderBy('date, id')->fetchAll('id'); $histories = $this->getHistory(array_keys($actions)); diff --git a/module/api/control.php b/module/api/control.php index 7d165c8871..ceff0694fa 100644 --- a/module/api/control.php +++ b/module/api/control.php @@ -109,8 +109,11 @@ class api extends control { if(!$this->config->features->apiSQL) die(sprintf($this->lang->api->error->disabled, '$config->features->apiSQL')); - $sql = isset($_POST['sql']) ? $this->post->sql : ''; - $this->view->results = $this->api->sql($sql, $keyField); - die($this->display()); + $sql = isset($_POST['sql']) ? $this->post->sql : ''; + $output = $this->api->sql($sql, $keyField); + + $output['sql'] = $sql; + $this->output = json_encode($output); + die($this->output); } } diff --git a/module/api/model.php b/module/api/model.php index 6ee5903edb..470f711165 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -94,31 +94,48 @@ class apiModel extends model */ public function sql($sql, $keyField = '') { - if(!$this->config->features->apiGetSQL) return sprintf($this->lang->api->error->disabled, '$config->features->apiSQL'); + if(!$this->config->features->apiSQL) return sprintf($this->lang->api->error->disabled, '$config->features->apiSQL'); - $sql = trim($sql); + $sql = trim($sql); if(strpos($sql, ';') !== false) $sql = substr($sql, 0, strpos($sql, ';')); - a($sql); - if(empty($sql)) return ''; + + $result = array(); + $result['status'] = 'fail'; + $result['message'] = ''; + + if(empty($sql)) return $result; if(stripos($sql, 'select ') !== 0) { - return $this->lang->api->error->onlySelect; + $result['message'] = $this->lang->api->error->onlySelect; + return $result; } else { try { - $stmt = $this->dao->query($sql); - if(empty($keyField)) return $stmt->fetchAll(); + $stmt = $this->dbh->query($sql); + $rows = array(); - while($row = $stmt->fetch()) $rows[$row->$keyField] = $row; - return $rows; + if(empty($keyField)) + { + $rows = $stmt->fetchAll(); + } + else + { + while($row = $stmt->fetch()) $rows[$row->$keyField] = $row; + } + + $result['status'] = 'success'; + $result['data'] = $rows; } catch(PDOException $e) { - return $e->getMessage(); + $result['status'] = 'fail'; + $result['message'] = $e->getMessage(); } + + return $result; } } } diff --git a/module/bug/control.php b/module/bug/control.php index dd16e179d6..d8b51330fb 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -620,6 +620,7 @@ class bug extends control $this->view->actions = $this->action->getList('bug', $bugID); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID); + $this->view->product = $this->loadModel('product')->getByID( $productID); $this->display(); } diff --git a/module/bug/js/edit.js b/module/bug/js/edit.js index 1a7fba0c17..fde51228cd 100644 --- a/module/bug/js/edit.js +++ b/module/bug/js/edit.js @@ -1,3 +1,8 @@ +$(function() +{ + loadModuleRelated(); +}); + /** * Set duplicate field. * diff --git a/module/bug/model.php b/module/bug/model.php index 9fb89ac733..6f8f068e38 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -933,6 +933,7 @@ class bugModel extends model $bug->confirmed = 1; $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + $this->executeHooks($bugID); } } @@ -1143,6 +1144,7 @@ class bugModel extends model $bug->lastEditedDate = $now; $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + $this->executeHooks($bugID); $changes[$bugID] = common::createChanges($oldBug, $bug); } @@ -1391,10 +1393,12 @@ class bugModel extends model * @param int $account * @param bool $appendProduct * @param int $limit + * @param array $skipProductIDList + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserBugPairs($account, $appendProduct = true, $limit = 0) + public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipProjectIDList = array()) { $bugs = array(); $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') @@ -1403,6 +1407,8 @@ class bugModel extends model ->on('t1.product=t2.id') ->where('t1.assignedTo')->eq($account) ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in('0,' . $this->app->user->view->projects)->fi() + ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('id desc') ->beginIF($limit > 0)->limit($limit)->fi() @@ -1576,14 +1582,16 @@ class bugModel extends model * Get bugs of a story. * * @param int $storyID + * @param int $projectID * @access public * @return array */ - public function getStoryBugs($storyID) + public function getStoryBugs($storyID, $projectID = 0) { return $this->dao->select('id, title, pri, type, status, assignedTo, resolvedBy, resolution') ->from(TABLE_BUG) ->where('story')->eq((int)$storyID) + ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->andWhere('deleted')->eq(0) ->fetchAll('id'); } @@ -2475,14 +2483,17 @@ class bugModel extends model */ public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { - $canBatchEdit = common::hasPriv('bug', 'batchEdit'); - $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); + /* Check the product is closed. */ + $canBeChanged = common::canBeChanged('bug', $bug); + + $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = common::hasPriv('bug', 'batchActivate'); - $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch'); - $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule'); - $canBatchResolve = common::hasPriv('bug', 'batchResolve'); - $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + $canBatchActivate = ($canBeChanged and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($canBeChanged and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); @@ -2696,11 +2707,18 @@ class bugModel extends model break; case 'actions': $params = "bugID=$bug->id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'edit', $params, $bug, 'list'); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + if($canBeChanged) + { + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'edit', $params, $bug, 'list'); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + } + else + { + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + } break; } echo ''; @@ -2786,7 +2804,7 @@ class bugModel extends model /* Send it. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 4a0d04d9d7..56bca8850a 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -108,6 +108,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow ?> + " . $lang->bug->batchCreate, '', "class='btn btn-secondary'"); @@ -153,6 +154,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow + @@ -178,7 +180,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow

bug->noBug;?> - + createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID"), " " . $lang->bug->create, '', "class='btn btn-info'");?>

@@ -200,14 +202,15 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBatchEdit = common::hasPriv('bug', 'batchEdit'); - $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); + $canBeChanged = common::canModify('product', $product); + $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = common::hasPriv('bug', 'batchActivate'); - $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch'); - $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule'); - $canBatchResolve = common::hasPriv('bug', 'batchResolve'); - $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + $canBatchActivate = ($canBeChanged and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($canBeChanged and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); ?> diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index da89459886..661f133baf 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -32,6 +32,12 @@ js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty);
+ bug->create->requiredFields) as $field) + { + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; + } + ?>
@@ -262,10 +268,10 @@ js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty); diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index 2243989203..7285e9ecb5 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -49,8 +49,8 @@ js::set('productID' , $bug->product);
- fetch('my', 'buildContactLists'); - ?> + fetch('my', 'buildContactLists'); + ?>
- - +
+
diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index fe7450fa77..ca8417bce0 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -30,7 +30,9 @@
+ product}&branch={$bug->branch}&extra=moduleID={$bug->module}", "" . $lang->bug->create, '', "class='btn btn-primary'"); ?> +
@@ -55,8 +57,11 @@ ?> - fetch('file', 'printFiles', array('files' => $bug->files, 'fieldset' => 'true'));?> - createLink('action', 'comment', "objectType=bug&objectID=$bug->id");?> + fetch('file', 'printFiles', array('files' => $bug->files, 'fieldset' => 'true', 'object' => $bug));?> + createLink('action', 'comment', "objectType=bug&objectID=$bug->id"); + ?> printExtendFields($bug, 'div', "position=left&inForm=0&inCell=1");?>
diff --git a/module/build/config.php b/module/build/config.php index 350e441a74..bcee51e703 100644 --- a/module/build/config.php +++ b/module/build/config.php @@ -8,3 +8,22 @@ $config->build->edit->requiredFields = 'product,project,name,builder,date'; $config->build->editor = new stdclass(); $config->build->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->build->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); + +global $lang; +$config->build->search['module'] = 'build'; +$config->build->search['fields']['name'] = $lang->build->name; +$config->build->search['fields']['id'] = $lang->build->id; +$config->build->search['fields']['product'] = $lang->story->product; +$config->build->search['fields']['scmPath'] = $lang->build->scmPath; +$config->build->search['fields']['filePath'] = $lang->build->filePath; +$config->build->search['fields']['date'] = $lang->build->date; +$config->build->search['fields']['builder'] = $lang->build->builder; +$config->build->search['fields']['desc'] = $lang->build->desc; + +$config->build->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->build->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => 'products'); +$config->build->search['params']['scmPath'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->build->search['params']['filePath'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->build->search['params']['date'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->build->search['params']['builder'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->build->search['params']['desc'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); diff --git a/module/build/control.php b/module/build/control.php index 6fa1248710..4c78b26015 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -208,17 +208,18 @@ class build extends control $this->executeHooks($buildID); /* Assign. */ - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->build = $build; - $this->view->buildPairs = $this->build->getProjectBuildPairs($build->project, 0, 0, 'noempty,notrunk'); - $this->view->actions = $this->loadModel('action')->getList('build', $buildID); - $this->view->link = $link; - $this->view->param = $param; - $this->view->orderBy = $orderBy; - $this->view->bugs = $bugs; - $this->view->type = $type; - $this->view->bugPager = $bugPager; - $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); + $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->build = $build; + $this->view->buildPairs = $this->build->getProjectBuildPairs($build->project, 0, 0, 'noempty,notrunk'); + $this->view->actions = $this->loadModel('action')->getList('build', $buildID); + $this->view->link = $link; + $this->view->param = $param; + $this->view->orderBy = $orderBy; + $this->view->bugs = $bugs; + $this->view->type = $type; + $this->view->bugPager = $bugPager; + $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); $this->display(); } diff --git a/module/build/model.php b/module/build/model.php index 11b09b9413..8d6c232add 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -52,11 +52,13 @@ class buildModel extends model /** * Get builds of a project. * - * @param int $projectID + * @param int $projectID + * @param string $type all|product|bysearch + * @param int|string $param productID|buildQuery * @access public * @return array */ - public function getProjectBuilds($projectID) + public function getProjectBuilds($projectID, $type = '', $param = '') { return $this->dao->select('t1.*, t2.name as projectName, t3.name as productName, t4.name as branchName') ->from(TABLE_BUILD)->alias('t1') @@ -65,10 +67,46 @@ class buildModel extends model ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.project')->eq((int)$projectID) ->andWhere('t1.deleted')->eq(0) + ->beginIF($type == 'product' and $param)->andWhere('t1.product')->eq($param)->fi() + ->beginIF($type == 'bysearch')->andWhere($param)->fi() ->orderBy('t1.date DESC, t1.id desc') ->fetchAll('id'); } + /** + * Get builds of a project by search. + * + * @param int $projectID + * @param int $queryID + * @access public + * @return array + */ + public function getProjectBuildsBySearch($projectID, $queryID) + { + /* If there are saved query conditions, reset the session. */ + if($queryID) + { + $query = $this->loadModel('search')->getQuery($queryID); + if($query) + { + $this->session->set('projectBuildQuery', $query->sql); + $this->session->set('projectBuildForm', $query->form); + } + } + + /* Distinguish between repeated fields. */ + $fields = array('id' => '`id`', 'name' => '`name`', 'product' => '`product`', 'desc' => '`desc`'); + foreach($fields as $field) + { + if(strpos($this->session->projectBuildQuery, $field) !== false) + { + $buildQuery = str_replace($field, "t1." . $field, $buildQuery); + } + } + + return $this->getProjectBuilds($projectID, 'bysearch', $buildQuery); + } + /** * Get builds of a project in pairs. * diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index ab98595e97..cdccfb1d4c 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -48,7 +48,7 @@ tbody tr td:first-child input{display:none;}
deleted) + if(!$build->deleted and $canBeChanged) { echo $this->buildOperateMenu($build, 'view'); @@ -69,13 +69,13 @@ tbody tr td:first-child input{display:none;}
' id='stories'> - +
id, \"story\")", ' ' . $lang->build->linkStory, '', "class='btn btn-primary'");?>
id}")?>' id='linkedStoriesForm'> - + id}&type=story&link=$link¶m=$param&orderBy=%s";?> @@ -124,7 +124,7 @@ tbody tr td:first-child input{display:none;}
story->stageList[$story->stage];?> id&story=$story->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn btn-icon' title='{$lang->build->unlinkStory}'"); @@ -154,13 +154,13 @@ tbody tr td:first-child input{display:none;}
' id='bugs'> - +
id, \"bug\")", ' ' . $lang->build->linkBug, '', "class='btn btn-primary'");?>
id");?>" id='linkedBugsForm'> - + id}&type=bug&link=$link¶m=$param&orderBy=%s";?> @@ -205,7 +205,7 @@ tbody tr td:first-child input{display:none;} + diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 5295c62123..a71d0157e5 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -62,12 +62,15 @@ - createLink('story', 'view', "id=$story->id");?> + createLink('story', 'view', "id=$story->id"); + $canBeChanged = common::canBeChanged('story', $story); + ?> children)):?> - - children as $key => $child):?> - createLink('story', 'view', "id=$child->id");?> - - children)) ? ' table-child-bottom' : '';?> - - - - - - - - - - - - - - + + children as $key => $child):?> + createLink('story', 'view', "id=$child->id");?> + + children)) ? ' table-child-bottom' : '';?> + + + + + + + + + + + + + + diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index ed45472b4f..d263995ced 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -60,11 +60,12 @@ + diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index 5e03932ec6..88fd0684e4 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -63,8 +63,9 @@ case : $case->id; - $runID = $type == 'assigntome' ? $case->id : 0; + $caseID = $type == 'assigntome' ? $case->case : $case->id; + $runID = $type == 'assigntome' ? $case->id : 0; + $canBeChanged = common::canBeChanged('testcase', $case); ?> diff --git a/module/product/control.php b/module/product/control.php index 66ae34b06c..cdfcc07471 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -221,7 +221,7 @@ class product extends control $this->view->productName = $this->products[$productID]; $this->view->moduleID = $moduleID; $this->view->stories = $stories; - $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch, '', true); $this->view->summary = $this->product->summary($stories, $storyType); $this->view->moduleTree = $moduleTree; $this->view->parentModules = $this->tree->getParents($moduleID); diff --git a/module/product/model.php b/module/product/model.php index 98ccc2618c..7412532284 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -65,8 +65,9 @@ class productModel extends model /* init currentModule and currentMethod for report and story. */ if($currentModule == 'story') { - if($currentMethod != 'track' and $currentMethod != 'create' and $currentMethod != 'batchcreate') $currentModule = 'product'; - if($currentMethod == 'view') $currentMethod = 'browse'; + $storyMethods = ",track,create,batchcreate,batchclose,"; + if(strpos($storyMethods, "," . $currentMethod . ",") === false) $currentModule = 'product'; + if($currentMethod == 'view' || $currentMethod == 'change' || $currentMethod == 'review') $currentMethod = 'browse'; } if($currentMethod == 'report') $currentMethod = 'browse'; @@ -581,12 +582,17 @@ class productModel extends model $allChanges = array(); $data = fixer::input('post')->get(); $oldProducts = $this->getByIdList($this->post->productIDList); + $nameList = array(); + $codeList = array(); foreach($data->productIDList as $productID) { + $productName = $data->names[$productID]; + $productCode = $data->codes[$productID]; + $productID = (int)$productID; $products[$productID] = new stdClass(); - $products[$productID]->name = $data->names[$productID]; - $products[$productID]->code = $data->codes[$productID]; + $products[$productID]->name = $productName; + $products[$productID]->code = $productCode; $products[$productID]->PO = $data->POs[$productID]; $products[$productID]->QD = $data->QDs[$productID]; $products[$productID]->RD = $data->RDs[$productID]; @@ -595,7 +601,16 @@ class productModel extends model $products[$productID]->status = $data->statuses[$productID]; $products[$productID]->desc = strip_tags($this->post->descs[$productID], $this->config->allowedTags); $products[$productID]->order = $data->orders[$productID]; + + /* Check unique name for edited products. */ + if(isset($nameList[$productName])) dao::$errors['name'][] = 'product#' . $productID . sprintf($this->lang->error->unique, $this->lang->product->name, $productName); + $nameList[$productName] = $productName; + + /* Check unique code for edited products. */ + if(isset($codeList[$productCode])) dao::$errors['code'][] = 'product#' . $productID . sprintf($this->lang->error->unique, $this->lang->product->code, $productCode); + $codeList[$productCode] = $productCode; } + if(dao::isError()) die(js::error(dao::getError())); foreach($products as $productID => $product) { @@ -604,9 +619,9 @@ class productModel extends model ->data($product) ->autoCheck() ->batchCheck($this->config->product->edit->requiredFields , 'notempty') - ->checkIF(strlen($product->code) == 0, 'code', 'notempty') //the value of product code can be 0 or 00.0 - ->check('name', 'unique', "id != $productID and deleted = '0'") - ->check('code', 'unique', "id != $productID and deleted = '0'") + ->checkIF(strlen($product->code) == 0, 'code', 'notempty') // The value of product code can be 0 or 00.0. + ->check('name', 'unique', "id NOT " . helper::dbIN($data->productIDList) . " and deleted='0'") + ->check('code', 'unique', "id NOT " . helper::dbIN($data->productIDList) . " and deleted='0'") ->where('id')->eq($productID) ->exec(); if(dao::isError()) die(js::error('product#' . $productID . dao::getError(true))); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 515af42d05..8ad5bf2d49 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -94,6 +94,7 @@ $lang->story->create = $storyType == 'story' ? $lang->story->createStory : $lang ?> + createLink('story', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$moduleID&storyID=0&project=0&plan=0&type=$storyType"), " {$lang->story->batchCreate}", '', "class='btn btn btn-secondary'");?> story->create = $storyType == 'story' ? $lang->story->createStory : $lang +
@@ -167,7 +169,7 @@ $lang->story->create = $storyType == 'story' ? $lang->story->createStory : $lang

story->noStory;?> - + createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}&storyID=0&projectID=0&bugID=0&planID=0&todoID=0&extra=&type=$storyType"), " " . $lang->story->create, '', "class='btn btn-info'");?>

@@ -187,14 +189,15 @@ $lang->story->create = $storyType == 'story' ? $lang->story->createStory : $lang $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBatchEdit = common::hasPriv('story', 'batchEdit'); - $canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'; - $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'); + $canBeChanged = common::canModify('product', $product); + $canBatchEdit = ($canBeChanged and common::hasPriv('story', 'batchEdit')); + $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'); + $canBatchReview = ($canBeChanged and common::hasPriv('story', 'batchReview')); + $canBatchChangeStage = ($canBeChanged and common::hasPriv('story', 'batchChangeStage')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('story', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('story', 'batchChangeModule')); + $canBatchChangePlan = ($canBeChanged and common::hasPriv('story', 'batchChangePlan')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('story', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo); ?> diff --git a/module/product/view/roadmap.html.php b/module/product/view/roadmap.html.php index e3e5892c6d..fdfb13fba3 100644 --- a/module/product/view/roadmap.html.php +++ b/module/product/view/roadmap.html.php @@ -41,7 +41,7 @@

release->noRelease;?> - + createLink('release', 'create', "productID=$product->id&branch=$branchKey"), " " . $lang->release->create, '', "class='btn btn-info'");?>

diff --git a/module/productplan/control.php b/module/productplan/control.php index d457f9a8e7..bb57b634e5 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -252,6 +252,9 @@ class productplan extends control $this->session->set('storyList', $this->app->getURI(true) . '&type=' . 'story'); $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug'); + /* Determines whether an object is editable. */ + $canBeChanged = common::canBeChanged('plan', $plan); + /* Load pager. */ $this->app->loadClass('pager', $static = true); if($this->app->getViewType() == 'mhtml') $recPerPage = 10; @@ -274,24 +277,25 @@ class productplan extends control if($plan->parent == '-1') $this->view->childrenPlans = $this->productplan->getChildren($plan->id); $this->loadModel('datatable'); - $this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story'); - $this->view->title = "PLAN #$plan->id $plan->title/" . zget($products, $plan->product, ''); - $this->view->position[] = $this->lang->productplan->view; - $this->view->planStories = $planStories; - $this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc', $bugPager); - $this->view->products = $products; - $this->view->summary = $this->product->summary($this->view->planStories); - $this->view->plan = $plan; - $this->view->actions = $this->loadModel('action')->getList('productplan', $planID); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch); - $this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product); - $this->view->type = $type; - $this->view->orderBy = $orderBy; - $this->view->link = $link; - $this->view->param = $param; - $this->view->storyPager = $storyPager; - $this->view->bugPager = $bugPager; + $this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story'); + $this->view->title = "PLAN #$plan->id $plan->title/" . zget($products, $plan->product, ''); + $this->view->position[] = $this->lang->productplan->view; + $this->view->planStories = $planStories; + $this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc', $bugPager); + $this->view->products = $products; + $this->view->summary = $this->product->summary($this->view->planStories); + $this->view->plan = $plan; + $this->view->actions = $this->loadModel('action')->getList('productplan', $planID); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch); + $this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product); + $this->view->type = $type; + $this->view->orderBy = $orderBy; + $this->view->link = $link; + $this->view->param = $param; + $this->view->storyPager = $storyPager; + $this->view->bugPager = $bugPager; + $this->view->canBeChanged = $canBeChanged; $this->display(); } diff --git a/module/productplan/model.php b/module/productplan/model.php index df8f58ea1b..7b15c399e4 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -157,10 +157,11 @@ class productplanModel extends model * @param array|int $product * @param int $branch * @param string $expired + * @param bool $skipParent * @access public * @return array */ - public function getPairs($product = 0, $branch = 0, $expired = '') + public function getPairs($product = 0, $branch = 0, $expired = '', $skipParent = false) { $date = date('Y-m-d'); $plans = $this->dao->select('id,title,parent,begin,end')->from(TABLE_PRODUCTPLAN) @@ -168,6 +169,7 @@ class productplanModel extends model ->andWhere('deleted')->eq(0) ->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi() ->beginIF($expired == 'unexpired')->andWhere('end')->ge($date)->fi() + ->beginIF($skipParent)->andWhere('parent')->ne(-1)->fi() ->orderBy('begin desc') ->fetchAll('id'); @@ -179,6 +181,7 @@ class productplanModel extends model ->andWhere('end')->lt($date) ->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi() ->beginIF($plans)->andWhere("id")->notIN(array_keys($plans))->fi() + ->beginIF($skipParent)->andWhere('parent')->ne(-1)->fi() ->orderBy('begin desc') ->limit(5) ->fetchAll('id'); @@ -207,10 +210,11 @@ class productplanModel extends model * * @param array|int $product * @param int $branch + * @param bool $skipParent * @access public * @return array */ - public function getPairsForStory($product = 0, $branch = 0) + public function getPairsForStory($product = 0, $branch = 0, $skipParent = false) { $date = date('Y-m-d'); $plans = $this->dao->select('id,title,parent,begin,end')->from(TABLE_PRODUCTPLAN) @@ -218,6 +222,7 @@ class productplanModel extends model ->andWhere('deleted')->eq(0) ->andWhere('end')->ge($date) ->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi() + ->beginIF($skipParent)->andWhere('parent')->ne(-1)->fi() ->orderBy('begin desc') ->fetchAll('id'); @@ -228,6 +233,7 @@ class productplanModel extends model ->andWhere('deleted')->eq(0) ->andWhere('end')->lt($date) ->beginIF($branch)->andWhere("branch")->in("0,$branch")->fi() + ->beginIF($skipParent)->andWhere('parent')->ne(-1)->fi() ->orderBy('begin desc') ->limit(5) ->fetchAll('id'); diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 3c80db9c74..e755ffe1fd 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -24,7 +24,9 @@
+ id&branch=$branch", " {$lang->productplan->create}", '', "class='btn btn-primary'");?> +
@@ -32,7 +34,7 @@

productplan->noPlan;?> - + createLink('productplan', 'create', "productID=$product->id&branch=$branch"), " " . $lang->productplan->create, '', "class='btn btn-info'");?>

@@ -73,6 +75,9 @@ loadModel('file');?> file->replaceImgURL($plan, 'desc'); if($plan->parent == '-1') { @@ -95,7 +100,7 @@
";?> @@ -163,7 +163,7 @@
resolvedDate, 5, 11)?> id&bug=$bug->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '', '', "class='btn btn-icon' title='{$lang->build->unlinkBug}'"); diff --git a/module/common/model.php b/module/common/model.php index be8a2761d6..d1f09fdc4b 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1150,6 +1150,7 @@ EOD; } if(strpos(',edit,copy,report,export,delete,', ",$method,") !== false) $module = 'common'; $class = "icon-$module-$method"; + if(!$clickable) $class .= ' disabled'; if($icon) $class .= ' icon-' . $icon; @@ -1697,6 +1698,12 @@ EOD; $module = strtolower($module); $method = strtolower($method); + $module = strtolower($module); + $method = strtolower($method); + + /* Check the parent object is closed. */ + if(strpos('close|batchclose', $method) === false and !commonModel::canBeChanged($module, $object)) return false; + /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; @@ -2090,6 +2097,56 @@ EOD; return strpos('|zh-cn|zh-tw|', '|' . $app->getClientLang() . '|') === false; } + /** + * Check the object can be changed. + * + * @param string $module + * @param object $object + * @static + * @access public + * @return bool + */ + public static function canBeChanged($module, $object = null) + { + global $app, $config; + + /* Check the product is closed. */ + if(!empty($object->product) and is_numeric($object->product) and empty($config->CRProduct)) + { + $product = $app->control->loadModel('product')->getByID($object->product); + if($product->status == 'closed') return false; + } + + /* Check the project is closed. */ + $productModuleList = array('story', 'bug', 'testtask'); + if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and empty($config->CRProject)) + { + $project = $app->control->loadModel('project')->getByID($object->project); + if($project->status == 'closed') return false; + } + + return true; + } + + /** + * Check object can modify. + * + * @param string $type product|project + * @param object $object + * @static + * @access public + * @return bool + */ + public static function canModify($type, $object) + { + global $config; + + if($type == 'product' and empty($config->CRProduct) and $object->status == 'closed') return false; + if($type == 'project' and empty($config->CRProject) and $object->status == 'closed') return false; + + return true; + } + /** * Response. * diff --git a/module/common/view/action.html.php b/module/common/view/action.html.php index 3648df474c..b1ff1252e9 100755 --- a/module/common/view/action.html.php +++ b/module/common/view/action.html.php @@ -47,7 +47,7 @@
    - comment))) != 0 and $this->methodName == 'view' and $action->actor == $this->app->user->account and common::hasPriv('action', 'editComment'));?> + comment) != '' and $this->methodName == 'view' and $action->actor == $this->app->user->account and common::hasPriv('action', 'editComment'));?>
  1. actor = zget($users, $action->actor); diff --git a/module/common/view/chosen.html.php b/module/common/view/chosen.html.php index 609eb59081..331f4e87d5 100755 --- a/module/common/view/chosen.html.php +++ b/module/common/view/chosen.html.php @@ -1,6 +1,8 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> +debug):?> + +
    diff --git a/module/message/config.php b/module/message/config.php index ee6124f295..2bb98c694b 100644 --- a/module/message/config.php +++ b/module/message/config.php @@ -9,12 +9,14 @@ $config->message->objectTypes['bug'] = array('opened', 'edited', 'commen $config->message->objectTypes['case'] = array('opened', 'edited', 'commented', 'reviewed', 'confirmed'); $config->message->objectTypes['testtask'] = array('opened', 'edited', 'started', 'blocked', 'closed', 'activated'); $config->message->objectTypes['todo'] = array('opened', 'edited'); +$config->message->objectTypes['doc'] = array('created', 'edited'); $config->message->available = array(); $config->message->available['mail']['story'] = $config->message->objectTypes['story']; $config->message->available['mail']['task'] = $config->message->objectTypes['task']; $config->message->available['mail']['bug'] = $config->message->objectTypes['bug']; $config->message->available['mail']['testtask'] = array('opened', 'edited', 'closed'); +$config->message->available['mail']['doc'] = $config->message->objectTypes['doc']; $config->message->available['webhook'] = $config->message->objectTypes; @@ -23,6 +25,7 @@ $config->message->available['message']['story'] = $config->message->objectTyp $config->message->available['message']['task'] = $config->message->objectTypes['task']; $config->message->available['message']['testtask'] = $config->message->objectTypes['testtask']; $config->message->available['message']['todo'] = $config->message->objectTypes['todo']; +$config->message->available['message']['doc'] = $config->message->objectTypes['doc']; $config->message->typeLink = array(); $config->message->typeLink['mail'] = 'mail|index'; diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php index 03dec609da..3a2be1cb58 100644 --- a/module/misc/lang/de.php +++ b/module/misc/lang/de.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Letzte Version'; $lang->misc->feature->detailed = 'Details'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['20.0.alpha1'] = '2020-10-30'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; @@ -138,6 +139,8 @@ $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; $lang->misc->feature->all['20.0.alpha1'][] = array('title'=>'Add program, reset priv.', 'desc' => ''); +$lang->misc->feature->all['12.5.stable'][] = array('title' => 'Fix Bug. Complete high priority story.', 'desc' => ''); + $lang->misc->feature->all['12.4.4'][] = array('title'=>'Compatible with professional and enterprise editions', 'desc' => ''); $lang->misc->feature->all['12.4.3'][] = array('title'=>'Fix Bug', 'desc' => ''); $lang->misc->feature->all['12.4.2'][] = array('title'=>'Fix Bug', 'desc' => ''); diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 7ca3f73d76..f48244d471 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Latest Version'; $lang->misc->feature->detailed = 'Detail'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['20.0.alpha1'] = '2020-10-30'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; @@ -138,6 +139,8 @@ $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; $lang->misc->feature->all['20.0.alpha1'][] = array('title'=>'Add program, reset priv.', 'desc' => ''); +$lang->misc->feature->all['12.5.stable'][] = array('title' => 'Fix Bug. Complete high priority story.', 'desc' => ''); + $lang->misc->feature->all['12.4.4'][] = array('title'=>'Compatible with professional and enterprise editions', 'desc' => ''); $lang->misc->feature->all['12.4.3'][] = array('title'=>'Fix Bug', 'desc' => ''); $lang->misc->feature->all['12.4.2'][] = array('title'=>'Fix Bug', 'desc' => ''); diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php index 7cc088414f..1e440af822 100644 --- a/module/misc/lang/fr.php +++ b/module/misc/lang/fr.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Dernière Version'; $lang->misc->feature->detailed = 'Détail'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['20.0.alpha1'] = '2020-10-30'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; @@ -138,6 +139,8 @@ $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; $lang->misc->feature->all['20.0.alpha1'][] = array('title'=>'Add program, reset priv.', 'desc' => ''); +$lang->misc->feature->all['12.5.stable'][] = array('title' => 'Fix Bug. Complete high priority story.', 'desc' => ''); + $lang->misc->feature->all['12.4.4'][] = array('title'=>'Compatible with professional and enterprise editions', 'desc' => ''); $lang->misc->feature->all['12.4.3'][] = array('title'=>'Fix Bug', 'desc' => ''); $lang->misc->feature->all['12.4.2'][] = array('title'=>'Fix Bug', 'desc' => ''); diff --git a/module/misc/lang/vi.php b/module/misc/lang/vi.php index 274d755e1e..4a2bafc211 100644 --- a/module/misc/lang/vi.php +++ b/module/misc/lang/vi.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Latest Version'; $lang->misc->feature->detailed = 'Chi tiết'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['20.0.alpha1'] = '2020-10-30'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; @@ -138,6 +139,8 @@ $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; $lang->misc->feature->all['20.0.alpha1'][] = array('title'=>'Add program, reset priv.', 'desc' => ''); +$lang->misc->feature->all['12.5.stable'][] = array('title' => 'Fix Bug. Complete high priority story.', 'desc' => ''); + $lang->misc->feature->all['12.4.4'][] = array('title'=>'Compatible with professional and enterprise editions', 'desc' => ''); $lang->misc->feature->all['12.4.3'][] = array('title'=>'Fix Bug', 'desc' => ''); $lang->misc->feature->all['12.4.2'][] = array('title'=>'Fix Bug', 'desc' => ''); diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 8a6fc0a9e0..99db1556ee 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = '最新版本'; $lang->misc->feature->detailed = '详情'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['20.0.alpha1'] = '2020-10-30'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; @@ -138,6 +139,8 @@ $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; $lang->misc->feature->all['20.0.alpha1'][] = array('title'=>'禅道20版本大更新,重构导航,增加瀑布模型', 'desc' => '

    增加项目集和项目概念

    将原项目概念变为迭代或阶段概念

    增加瀑布开发模板

    '); +$lang->misc->feature->all['12.5.stable'][] = array('title' => '解决bug,完成高优先级需求。', 'desc' => ''); + $lang->misc->feature->all['12.4.4'][] = array('title'=>'兼容专业版和企业版', 'desc' => ''); $lang->misc->feature->all['12.4.3'][] = array('title'=>'修复Bug', 'desc' => ''); $lang->misc->feature->all['12.4.2'][] = array('title'=>'修复Bug', 'desc' => ''); diff --git a/module/misc/lang/zh-tw.php b/module/misc/lang/zh-tw.php index f58a6ccf23..6d233854e1 100644 --- a/module/misc/lang/zh-tw.php +++ b/module/misc/lang/zh-tw.php @@ -86,6 +86,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = '最新版本'; $lang->misc->feature->detailed = '詳情'; +$lang->misc->releaseDate['12.5.stable'] = '2020-11-19'; $lang->misc->releaseDate['12.4.4'] = '2020-10-30'; $lang->misc->releaseDate['12.4.3'] = '2020-10-13'; $lang->misc->releaseDate['12.4.2'] = '2020-09-18'; @@ -135,10 +136,12 @@ $lang->misc->releaseDate['7.2.stable'] = '2015-05-22'; $lang->misc->releaseDate['7.1.stable'] = '2015-03-07'; $lang->misc->releaseDate['6.3.stable'] = '2014-11-07'; -$lang->misc->feature->all['12.4.4'][] = array('title'=>'兼容專業版和企業版', 'desc' => ''); -$lang->misc->feature->all['12.4.3'][] = array('title'=>'修復Bug', 'desc' => ''); -$lang->misc->feature->all['12.4.2'][] = array('title'=>'修復Bug', 'desc' => ''); -$lang->misc->feature->all['12.4.1'][] = array('title'=>'修復Bug', 'desc' => ''); +$lang->misc->feature->all['12.5.stable'][] = array('title' => '解決bug,完成高優先順序需求。', 'desc' => ''); + +$lang->misc->feature->all['12.4.4'][] = array('title' => '兼容專業版和企業版', 'desc' => ''); +$lang->misc->feature->all['12.4.3'][] = array('title' => '修復Bug', 'desc' => ''); +$lang->misc->feature->all['12.4.2'][] = array('title' => '修復Bug', 'desc' => ''); +$lang->misc->feature->all['12.4.1'][] = array('title' => '修復Bug', 'desc' => ''); $lang->misc->feature->all['12.4.stable'][] = array('title'=>'修復Bug', 'desc' => ''); diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index df33616daa..fb17e4e13b 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -73,11 +73,12 @@ ?>
- + />
@@ -99,12 +100,15 @@
bug->resolutionList, $bug->resolution);?> id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true, '', '', $bug->PRJ); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true, '', '', $bug->PRJ); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true, '', '', $bug->PRJ); - common::printIcon('bug', 'edit', $params, $bug, 'list', '', '', '', '', '', '', $bug->PRJ); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy', '', '', '', '', '', $bug->PRJ); + if($canBeChanged) + { + $params = "bugID=$bug->id"; + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true, '', '', $bug->PRJ); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true, '', '', $bug->PRJ); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true, '', '', $bug->PRJ); + common::printIcon('bug', 'edit', $params, $bug, 'list', '', '', '', '', '', '', $bug->PRJ); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy', '', '', '', '', '', $bug->PRJ); + } ?>
- + />
@@ -86,54 +89,60 @@
story->stageList, $story->stage);?> id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); - common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list'); - common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + if($canBeChanged) + { + $vars = "story={$story->id}"; + common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $story, 'list'); + common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); + } ?>
- -
- - -
- - id);?> -
pri;?>' title='story->priList, $child->pri, $child->pri);?>'>story->priList, $child->pri, $child->pri);?>productTitle;?> - lang->story->children .'">' . $this->lang->story->childrenAB . ' ' . html::a($storyLink, $child->title, null, "style='color: $child->color'");?> - planTitle;?>openedBy);?>estimate;?> processStatus('story', $child);?>story->stageList, $child->stage);?> - id}"; - common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); - common::printIcon('story', 'review', $vars, $child, 'list', 'glasses'); - common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $child, 'list'); - common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap'); - ?> -
+ +
+ + +
+ + id);?> +
pri;?>' title='story->priList, $child->pri, $child->pri);?>'>story->priList, $child->pri, $child->pri);?>productTitle;?> + lang->story->children .'">' . $this->lang->story->childrenAB . ' ' . html::a($storyLink, $child->title, null, "style='color: $child->color'");?> + planTitle;?>openedBy);?>estimate;?> processStatus('story', $child);?>story->stageList, $child->stage);?> + id}"; + common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $child, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $child, 'list'); + common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap'); + } + ?> +
- + />
@@ -90,21 +91,24 @@
needConfirm) + if($canBeChanged) { - $this->lang->task->confirmStoryChange = $this->lang->confirm; - common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', 'btn-wide', '', '', '', $task->PRJ); - } - else - { - if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); - if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); - common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); - common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); + if($task->needConfirm) + { + $this->lang->task->confirmStoryChange = $this->lang->confirm; + common::printIcon('task', 'confirmStoryChange', "taskid=$task->id", '', 'list', '', 'hiddenwin', 'btn-wide', '', '', '', $task->PRJ); + } + else + { + if($task->status != 'pause') common::printIcon('task', 'start', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); + if($task->status == 'pause') common::printIcon('task', 'restart', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); + common::printIcon('task', 'close', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); + common::printIcon('task', 'finish', "taskID=$task->id", $task, 'list', '', '', 'iframe', true, '', '', $task->PRJ); - common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true, '', '', $task->PRJ); - common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list', '', '', '', '', '', '', $task->PRJ); - common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=0", $task, 'list', 'treemap-alt', '', '', '', '', $this->lang->task->children, $task->PRJ); + common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'list', 'time', '', 'iframe', true, '', '', $task->PRJ); + common::printIcon('task', 'edit', "taskID=$task->id", $task, 'list', '', '', '', '', '', '', $task->PRJ); + common::printIcon('task', 'batchCreate', "project=$task->project&storyID=$task->story&moduleID=$task->module&taskID=$task->id&ifame=0", $task, 'list', 'treemap-alt', '', '', '', '', $this->lang->task->children, $task->PRJ); + } } ?>
@@ -82,11 +83,14 @@ processStatus('testcase', $case);?> product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug', '', '', '', '', '', $case->PRJ); - common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy', '', '', '', '', '', $case->PRJ); - common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$caseID&version=$case->version", '', 'list', 'play', '', 'iframe', true, "data-width='95%'", '', $case->PRJ); - common::printIcon('testtask', 'results', "runID=$runID&caseID=$caseID", '', 'list', 'list-alt', '', 'iframe', true, "data-width='95%'", '', $case->PRJ); - common::printIcon('testcase', 'edit', "caseID=$caseID", $case, 'list', 'edit', '', '', '', '', '', $case->PRJ); + if($canBeChanged) + { + common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug', '', '', '', '', '', $case->PRJ); + common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy', '', '', '', '', '', $case->PRJ); + common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$caseID&version=$case->version", '', 'list', 'play', '', 'iframe', true, "data-width='95%'", '', $case->PRJ); + common::printIcon('testtask', 'results', "runID=$runID&caseID=$caseID", '', 'list', 'list-alt', '', 'iframe', true, "data-width='95%'", '', $case->PRJ); + common::printIcon('testcase', 'edit', "caseID=$caseID", $case, 'list', 'edit', '', '', '', '', '', $case->PRJ); + } ?>
- id => '')) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> + id => ''), '', $attribute) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> id);?> @@ -122,11 +127,11 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $plan) . " id"), '', '', "class='btn' title='{$lang->project->create}'"); - if(common::hasPriv('productplan', 'linkStory')) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'"); - if(common::hasPriv('productplan', 'linkBug')) echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'"); + if(common::hasPriv('project', 'create', $plan)) echo html::a(helper::createLink('project', 'create', "productID=&projectID=©ProjectID=&planID=$plan->id"), '', '', "class='btn' title='{$lang->project->create}'"); + if(common::hasPriv('productplan', 'linkStory', $plan) and $plan->parent >= 0) echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkStory}'"); + if(common::hasPriv('productplan', 'linkBug', $plan)) echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), '', '', "class='btn' title='{$lang->productplan->linkBug}'"); common::printIcon('productplan', 'edit', "planID=$plan->id", $plan, 'list'); - if(common::hasPriv('productplan', 'create')) + if(common::hasPriv('productplan', 'create', $plan)) { if($plan->parent > '0') echo " "; if($plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product=$productID&branch=$branch&parent={$plan->id}"), "", '', "class='btn' title='{$this->lang->productplan->children}'"); diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 264df106ab..4d178e0475 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -42,9 +42,9 @@ { echo $this->buildOperateMenu($plan, 'view'); - if(common::hasPriv('productplan', 'create') and $plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link' title='{$this->lang->productplan->children}'"); - if(common::hasPriv('productplan', 'edit')) echo html::a($this->createLink('productplan', 'edit', "planID=$plan->id"), " " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'"); - if(common::hasPriv('productplan', 'delete') and $plan->parent >= 0) echo html::a($this->createLink('productplan', 'delete', "planID=$plan->id"), " " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'"); + if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), " " . $this->lang->productplan->children , '', "class='btn btn-link' title='{$this->lang->productplan->children}'"); + if(common::hasPriv('productplan', 'edit', $plan)) echo html::a($this->createLink('productplan', 'edit', "planID=$plan->id"), " " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'"); + if(common::hasPriv('productplan', 'delete', $plan) and $plan->parent >= 0) echo html::a($this->createLink('productplan', 'delete', "planID=$plan->id"), " " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'"); } ?> @@ -60,7 +60,7 @@
'>
- deleted):?> + deleted and $plan->parent >= 0 and $canBeChanged):?>
- id, \"story\")", ' ' . $lang->productplan->linkStory, '', "class='btn btn-primary'");?> + parent >= 0) echo html::a("javascript:showLink($plan->id, \"story\")", ' ' . $lang->productplan->linkStory, '', "class='btn btn-primary'");?>
@@ -99,7 +99,7 @@ $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); $canBatchAssignTo = common::hasPriv('story', 'batchAssignTo'); - $canBatchAction = ($canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo); + $canBatchAction = ($canBeChanged and ($canBatchUnlink or $canBatchClose or $canBatchEdit or $canBatchReview or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchChangeStage or $canBatchAssignTo)); $vars = "planID={$plan->id}&type=story&orderBy=%s&link=$link¶m=$param"; ?>
story->stageList[$story->stage];?> createLink('productplan', 'unlinkStory', "story=$story->id&plan=$plan->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->productplan->unlinkStory}'"); @@ -353,7 +353,7 @@
'> - +
id, \"bug\")", ' ' . $lang->productplan->linkBug, '', "class='btn btn-primary'");?>
@@ -361,7 +361,7 @@
id&orderBy=$orderBy");?>"> - + id}&type=bug&orderBy=%s&link=$link¶m=$param"; ?> @@ -402,7 +402,7 @@ + diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index b7323a9376..f62eca6e14 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -12,23 +12,33 @@ ?> build->confirmDelete)?> +
+

build->noBuild;?> - + createLink('build', 'create', "project=$project->id"), " " . $lang->build->create, '', "class='btn btn-info'");?>

@@ -39,7 +49,7 @@
- + @@ -53,7 +63,7 @@ $build):?> - + diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index 73d7bd6218..4d7c889466 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -18,6 +18,7 @@ $link = $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=kanban"); if(common::hasPriv('task', 'export')) echo html::a($link, " " . $lang->task->export, '', "class='btn btn-link iframe export' data-width='700'"); ?> +
createLink('productplan', 'unlinkBug', "story=$bug->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '', '', "class='btn' title='{$lang->productplan->unlinkBug}'"); diff --git a/module/project/control.php b/module/project/control.php index ada145650b..1723b3d2af 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -202,26 +202,27 @@ class project extends control $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($projectID, 'task', $showModule) : array(); /* Assign. */ - $this->view->tasks = $tasks; - $this->view->summary = $this->project->summary($tasks); - $this->view->tabID = 'task'; - $this->view->pager = $pager; - $this->view->recTotal = $pager->recTotal; - $this->view->recPerPage = $pager->recPerPage; - $this->view->orderBy = $orderBy; - $this->view->browseType = $browseType; - $this->view->status = $status; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->param = $param; - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->productID = $productID; - $this->view->modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : ''); - $this->view->moduleID = $moduleID; - $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); - $this->view->memberPairs = $memberPairs; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); - $this->view->setModule = true; + $this->view->tasks = $tasks; + $this->view->summary = $this->project->summary($tasks); + $this->view->tabID = 'task'; + $this->view->pager = $pager; + $this->view->recTotal = $pager->recTotal; + $this->view->recPerPage = $pager->recPerPage; + $this->view->orderBy = $orderBy; + $this->view->browseType = $browseType; + $this->view->status = $status; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->param = $param; + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->productID = $productID; + $this->view->modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : ''); + $this->view->moduleID = $moduleID; + $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); + $this->view->memberPairs = $memberPairs; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); + $this->view->setModule = true; + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -779,6 +780,7 @@ class project extends control $this->view->users = $users; $this->view->pager = $pager; $this->view->branchGroups = $branchGroups; + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -861,33 +863,59 @@ class project extends control * Browse builds of a project. * * @param int $projectID + * @param string $type all|product|bysearch + * @param int $param * @access public * @return void */ - public function build($projectID = 0) + public function build($projectID = 0, $type = 'all', $param = 0) { + /* Load module and set session. */ $this->loadModel('testtask'); $this->session->set('buildList', $this->app->getURI(true)); $project = $this->commonAction($projectID); $projectID = $project->id; - /* Header and position. */ - $this->view->title = $project->name . $this->lang->colon . $this->lang->project->build; - $this->view->position[] = html::a(inlink('browse', "projectID=$projectID"), $project->name); - $this->view->position[] = $this->lang->project->build; + /* Get products' list. */ + $products = $this->project->getProducts($projectID, false); + $products = array('' => '') + $products; - $builds = $this->loadModel('build')->getProjectBuilds((int)$projectID); + /* Build the search form. */ + $type = strtolower($type); + $queryID = ($type == 'bysearch') ? (int)$param : 0; + $actionURL = $this->createLink('project', 'build', "projectID=$projectID&type=bysearch&queryID=myQueryID"); + $this->project->buildProjectBuildSearchForm($products, $queryID, $actionURL); + + /* Get builds. */ + if($type == 'bysearch') + { + $builds = $this->loadModel('build')->getProjectBuildsBySearch((int)$projectID, $param); + } + else + { + $builds = $this->loadModel('build')->getProjectBuilds((int)$projectID, $type, $param); + } + + /* Set project builds. */ $projectBuilds = array(); if(!empty($builds)) { foreach($builds as $build) $projectBuilds[$build->product][] = $build; } - /* Get builds. */ + /* Header and position. */ + $this->view->title = $project->name . $this->lang->colon . $this->lang->project->build; + $this->view->position[] = html::a(inlink('browse', "projectID=$projectID"), $project->name); + $this->view->position[] = $this->lang->project->build; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->buildsTotal = count($builds); $this->view->projectBuilds = $projectBuilds; + $this->view->projectID = $projectID; + $this->view->product = $type == 'product' ? $param : 'all'; + $this->view->products = $products; + $this->view->type = $type; $this->display(); } @@ -921,16 +949,18 @@ class project extends control $tasks = $this->testtask->getProjectTasks($projectID, $orderBy, $pager); foreach($tasks as $key => $task) $productTasks[$task->product][] = $task; - $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; - $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); - $this->view->position[] = $this->lang->testtask->common; - $this->view->projectID = $projectID; - $this->view->projectName = $this->projects[$projectID]; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->tasks = $productTasks; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ); + $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; + $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); + $this->view->position[] = $this->lang->testtask->common; + $this->view->project = $project; + $this->view->projectID = $projectID; + $this->view->projectName = $this->projects[$projectID]; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->tasks = $productTasks; + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ); + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -1032,8 +1062,9 @@ class project extends control $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); $position[] = $this->lang->project->team; - $this->view->title = $title; - $this->view->position = $position; + $this->view->title = $title; + $this->view->position = $position; + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -1593,6 +1624,7 @@ class project extends control $this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID); $this->view->statData = $this->project->statRelatedData($projectID); $this->view->chartData = $chartData; + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -1623,6 +1655,9 @@ class project extends control $bugs = $this->loadModel('bug')->getProjectBugs($projectID); $stories = $this->loadModel('story')->getProjectStories($projectID, $orderBy); + /* Determines whether an object is editable. */ + $canBeChanged = common::canModify('project', $project); + $kanbanGroup = $this->project->getKanbanGroupData($stories, $tasks, $bugs, $type); $kanbanSetting = $this->project->getKanbanSetting(); @@ -1639,9 +1674,10 @@ class project extends control $this->view->type = $type; $this->view->kanbanGroup = $kanbanGroup; $this->view->kanbanColumns = $this->project->getKanbanColumns($kanbanSetting); - $this->view->statusMap = $this->project->getKanbanStatusMap($kanbanSetting); + $this->view->statusMap = $canBeChanged ? $this->project->getKanbanStatusMap($kanbanSetting) : array(); $this->view->statusList = $this->project->getKanbanStatusList($kanbanSetting); $this->view->colorList = $this->project->getKanbanColorList($kanbanSetting); + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -1816,14 +1852,15 @@ class project extends control $productPairs = $this->loadModel('product')->getProductPairsByProject($projectID); if($productPairs) $productID = key($productPairs); - $this->view->title = $this->lang->project->storyKanban; - $this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name); - $this->view->position[] = $this->lang->project->storyKanban; - $this->view->stories = $this->story->getKanbanGroupData($stories); - $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->productID = $productID; + $this->view->title = $this->lang->project->storyKanban; + $this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name); + $this->view->position[] = $this->lang->project->storyKanban; + $this->view->stories = $this->story->getKanbanGroupData($stories); + $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->productID = $productID; + $this->view->canBeChanged = common::canModify('project', $project); // Determines whether an object is editable. $this->display(); } @@ -1840,11 +1877,30 @@ class project extends control { if($confirm == 'no') { - echo js::confirm(sprintf($this->lang->project->confirmDelete, $this->projects[$projectID]), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")); + /* Get the number of unfinished tasks and unresolved bugs. */ + $unfinishedTasks = $this->dao->select('COUNT(id) AS count')->from(TABLE_TASK) + ->where('project')->eq($projectID) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->in('wait,doing,pause') + ->fetch(); + $unresolvedBugs = $this->dao->select('COUNT(id) AS count')->from(TABLE_BUG) + ->where('project')->eq($projectID) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->eq('active') + ->fetch(); + + /* Set prompt information. */ + $tips = ''; + if($unfinishedTasks->count) $tips = sprintf($this->lang->project->unfinishedTask, $unfinishedTasks->count); + if($unresolvedBugs->count) $tips .= sprintf($this->lang->project->unresolvedBug, $unresolvedBugs->count); + if($tips) $tips = $this->lang->project->unfinishedProject . $tips; + + echo js::confirm($tips . sprintf($this->lang->project->confirmDelete, $this->projects[$projectID]), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")); exit; } else { + /* Delete project. */ $this->project->delete(TABLE_PROJECT, $projectID); $this->dao->update(TABLE_DOCLIB)->set('deleted')->eq(1)->where('project')->eq($projectID)->exec(); $this->project->updateUserView($projectID); @@ -1910,6 +1966,7 @@ class project extends control $this->view->title = $title; $this->view->position = $position; $this->view->allProducts = $allProducts; + $this->view->project = $project; $this->view->linkedProducts = $linkedProducts; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches); diff --git a/module/project/css/story.css b/module/project/css/story.css index c586920266..cbc14e425f 100644 --- a/module/project/css/story.css +++ b/module/project/css/story.css @@ -4,3 +4,4 @@ tbody > tr > td > .btn-icon {margin-right: 4px} @media (max-width: 1200px) {#storyList .c-user, #storyList .c-estimate {display: none!important;}} @media (max-width: 1000px) {#storyList .c-status, #storyList .c-pri {display: none!important;}} @media (max-width: 820px) {#storyList .c-sort, #storyList .c-stage {display: none!important;}} +#batchToTask .checkbox-primary {display: inline-block; margin-left: 10px;} diff --git a/module/project/js/build.js b/module/project/js/build.js new file mode 100644 index 0000000000..63c872731a --- /dev/null +++ b/module/project/js/build.js @@ -0,0 +1,12 @@ +/** + * Change product. + * + * @param int $productID + * @access public + * @return void + */ +function changeProduct(productID) +{ + link = createLink('project', 'build', 'projectID=' + projectID + '&type=product¶m=' + productID); + location.href = link; +} diff --git a/module/project/js/story.js b/module/project/js/story.js index 532de6bbd9..409ad7f6f8 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -20,7 +20,7 @@ $(function() $(document).on('click', "#storyList tbody tr, .table-footer .check-all, #storyList thead .check-all", function(){showCheckedSummary();}); $(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();}); - $('#toTaskButton').on('click', function () + $('#toTaskButton').on('click', function() { var planID = $('#plan').val(); if(planID) @@ -28,9 +28,27 @@ $(function() parent.location.href = createLink('project', 'importPlanStories', 'projectID=' + projectID + '&planID=' + planID); } }) + + /* Get checked stories. */ + $('#batchToTaskButton').on('click', function() + { + var storyIdList = ''; + $("input[name^='storyIdList']:checked").each(function() + { + storyIdList += $(this).val() + ','; + $('#storyIdList').val(storyIdList); + }); + }); + $('.sorter-false a').unwrap(); }); +/** + * Show checked summary. + * + * @access public + * @return void + */ function showCheckedSummary() { var $summary = $('#main #mainContent form.main-table .table-header .table-statistic'); diff --git a/module/project/js/storykanban.js b/module/project/js/storykanban.js index b67dd2609f..aa43e2dc23 100644 --- a/module/project/js/storykanban.js +++ b/module/project/js/storykanban.js @@ -4,17 +4,21 @@ $(function() $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot}); var $kanban = $('#kanban'); - var stageMap = + var stageMap = new Object(); + if(canBeChanged) { - story: + stageMap = { - projected : {verified: 'batchChangeStage'}, - developing : {verified: 'batchChangeStage'}, - developed : {verified: 'batchChangeStage'}, - testing : {verified: 'batchChangeStage'}, - tested : {verified: 'batchChangeStage'}, - } - }; + story: + { + projected : {verified: 'batchChangeStage'}, + developing : {verified: 'batchChangeStage'}, + developed : {verified: 'batchChangeStage'}, + testing : {verified: 'batchChangeStage'}, + tested : {verified: 'batchChangeStage'}, + } + }; + } var fixBoardWidth = function() { diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 8cb23fa953..8a37a03b0f 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -278,6 +278,9 @@ $lang->project->noweekend = 'Ohne Wochenende'; $lang->project->withweekend = 'Mit Wochenende'; $lang->project->interval = 'Intervale '; $lang->project->fixFirstWithLeft = 'Modify the left'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, created by $actor . $extra' . "\n"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 495db6e3f7..e21b6e1a17 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -278,6 +278,9 @@ $lang->project->noweekend = 'Exclude Weekend'; $lang->project->withweekend = 'Include Weekend'; $lang->project->interval = 'Intervals '; $lang->project->fixFirstWithLeft = 'Update hours left too'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, created by $actor . $extra' . "\n"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index b26be44e65..08af772b37 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -278,6 +278,9 @@ $lang->project->noweekend = 'Exclure les Weekends'; $lang->project->withweekend = 'Inclure les Weekends'; $lang->project->interval = 'Intervalles'; $lang->project->fixFirstWithLeft = 'Mettre à jour les heures également'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, créée par $actor .' . "\n"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index fc2704351d..2e8f167ae1 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -278,6 +278,9 @@ $lang->project->noweekend = 'Không gồm cuối tuần'; $lang->project->withweekend = 'Bao gồm cuối tuần'; $lang->project->interval = 'Intervals '; $lang->project->fixFirstWithLeft = 'Cập nhật cả giờ còn lại'; +$lang->project->unfinishedProject = "This {$lang->projectCommon} has "; +$lang->project->unfinishedTask = "[%s] unfinished tasks. "; +$lang->project->unresolvedBug = "[%s] unresolved bugs. "; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, được tạo bởi $actor $extra.' . "\n"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 7cbe40ea37..7503bb04e0 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -278,6 +278,9 @@ $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '显示周末'; $lang->project->interval = '间隔'; $lang->project->fixFirstWithLeft = '修改剩余工时'; +$lang->project->unfinishedProject = "该{$lang->projectCommon}下还有"; +$lang->project->unfinishedTask = "[%s]个未完成的任务,"; +$lang->project->unresolvedBug = "[%s]个未解决的bug,"; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, 由 $actor 创建。$extra' . "\n"; diff --git a/module/project/lang/zh-tw.php b/module/project/lang/zh-tw.php index cd1dc02597..d6c38fd7b1 100644 --- a/module/project/lang/zh-tw.php +++ b/module/project/lang/zh-tw.php @@ -278,6 +278,9 @@ $lang->project->noweekend = '去除周末'; $lang->project->withweekend = '顯示周末'; $lang->project->interval = '間隔'; $lang->project->fixFirstWithLeft = '修改剩餘工時'; +$lang->project->unfinishedProject = "該{$lang->projectCommon}下還有"; +$lang->project->unfinishedTask = "[%s]個未完成的任務,"; +$lang->project->unresolvedBug = "[%s]個未解決的bug,"; $lang->project->action = new stdclass(); $lang->project->action->opened = '$date, 由 $actor 創建。$extra' . "\n"; diff --git a/module/project/model.php b/module/project/model.php index edcb11a64e..0b24267f61 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -490,12 +490,17 @@ class projectModel extends model $allChanges = array(); $data = fixer::input('post')->get(); $oldProjects = $this->getExecutionByIdList($this->post->projectIDList); + $nameList = array(); + $codeList = array(); foreach($data->projectIDList as $projectID) { + $projectName = $data->names[$projectID]; + $projectCode = $data->codes[$projectID]; + $projectID = (int)$projectID; $projects[$projectID] = new stdClass(); - $projects[$projectID]->name = $data->names[$projectID]; - $projects[$projectID]->code = $data->codes[$projectID]; + $projects[$projectID]->name = $projectName; + $projects[$projectID]->code = $projectCode; $projects[$projectID]->PM = $data->PMs[$projectID]; $projects[$projectID]->PO = $data->POs[$projectID]; $projects[$projectID]->QD = $data->QDs[$projectID]; @@ -508,7 +513,16 @@ class projectModel extends model $projects[$projectID]->desc = htmlspecialchars_decode($data->descs[$projectID]); $projects[$projectID]->days = $data->dayses[$projectID]; $projects[$projectID]->order = $data->orders[$projectID]; + + /* Check unique name for edited projects. */ + if(isset($nameList[$projectName])) dao::$errors['name'][] = 'project#' . $projectID . sprintf($this->lang->error->unique, $this->lang->project->name, $projectName); + $nameList[$projectName] = $projectName; + + /* Check unique code for edited projects. */ + if(isset($codeList[$projectCode])) dao::$errors['code'][] = 'project#' . $projectID . sprintf($this->lang->error->unique, $this->lang->project->code, $projectCode); + $codeList[$projectCode] = $projectCode; } + if(dao::isError()) die(js::error(dao::getError())); foreach($projects as $projectID => $project) { @@ -521,10 +535,11 @@ class projectModel extends model ->checkIF($project->begin != '', 'begin', 'date') ->checkIF($project->end != '', 'end', 'date') ->checkIF($project->end != '', 'end', 'gt', $project->begin) - ->check('code', 'unique', "id!=$projectID and deleted='0'") + ->check('code', 'unique', "id NOT " . helper::dbIN($data->projectIDList) . " and deleted='0'") ->where('id')->eq($projectID) ->limit(1) ->exec(); + if(dao::isError()) die(js::error('project#' . $projectID . dao::getError(true))); $changedAccounts = array(); foreach($project as $fieldName => $value) @@ -549,7 +564,6 @@ class projectModel extends model } if(!empty($changedAccounts)) $this->updateUserView($projectID, 'sprint', $changedAccounts); - if(dao::isError()) die(js::error('project#' . $projectID . dao::getError(true))); $allChanges[$projectID] = common::createChanges($oldProject, $project); } $this->fixOrder(); @@ -2754,6 +2768,28 @@ class projectModel extends model $this->loadModel('search')->setSearchParams($this->config->project->search); } + /** + * Build project build search form. + * + * @param array $products + * @param int $queryID + * @param string $actionURL + * @access public + * @return void + */ + public function buildProjectBuildSearchForm($products, $queryID, $actionURL) + { + $this->loadModel('build'); + + /* Set search param. */ + $this->config->build->search['module'] = 'projectBuild'; + $this->config->build->search['actionURL'] = $actionURL; + $this->config->build->search['queryID'] = $queryID; + $this->config->build->search['params']['product']['values'] = $products; + + $this->loadModel('search')->setSearchParams($this->config->build->search); + } + /** * Get Kanban tasks * diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index de51003f99..9423ad5e81 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -22,7 +22,7 @@
id", " " . $lang->bug->export, '', "class='btn btn-link export'");?> - id", " " . $lang->bug->create, '', "class='btn btn-primary'");?> + id", " " . $lang->bug->create, '', "class='btn btn-primary'");?>
@@ -31,7 +31,7 @@

bug->noBug;?> - + createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id"), " " . $lang->bug->create, '', "class='btn btn-info'");?>

@@ -74,10 +74,14 @@ ?>
- id => '')) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> + id => ''), '', $arrtibute) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> id);?> @@ -97,12 +101,15 @@ bug->resolutionList, $bug->resolution);?> id"; - common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); - common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); - common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); - common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); - common::printIcon('bug', 'edit', $params, $bug, 'list'); + if($canBeChanged) + { + $params = "bugID=$bug->id"; + common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); + common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); + common::printIcon('bug', 'edit', $params, $bug, 'list'); + } ?>
build->id;?>build->product;?>build->product;?> build->name;?> build->scmPath;?> build->filePath;?>
id"), sprintf('%03d', $build->id));?>productName;?>productName;?> branchName) echo "{$build->branchName}"?> createLink('build', 'view', "build=$build->id"), $build->name);?> @@ -64,7 +74,7 @@ builder);?> createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "", '', "class='btn' title='{$lang->build->linkStory}'"); } diff --git a/module/project/view/burn.html.php b/module/project/view/burn.html.php index 40db101c11..674a7d83df 100644 --- a/module/project/view/burn.html.php +++ b/module/project/view/burn.html.php @@ -25,7 +25,7 @@ common::printLink('project', 'computeBurn', 'reload=yes', ' ' . $lang->project->computeBurn, 'hiddenwin', "title='{$lang->project->computeBurn}{$lang->project->burn}' class='btn btn-primary' id='computeBurn'"); echo '
'; echo html::a($this->createLink('project', 'burn', "projectID=$projectID&type=$weekend&interval=$interval"), $lang->project->$weekend, '', "class='btn btn-link'"); - common::printLink('project', 'fixFirst', "project=$project->id", $lang->project->fixFirst, '', "class='btn btn-link iframe' data-width='700'"); + if(common::canModify('project', $project)) common::printLink('project', 'fixFirst', "project=$project->id", $lang->project->fixFirst, '', "class='btn btn-link iframe' data-width='700'"); echo $lang->project->howToUpdateBurn; ?>
diff --git a/module/project/view/grouptask.html.php b/module/project/view/grouptask.html.php index 9d1c7dd549..47cb024004 100644 --- a/module/project/view/grouptask.html.php +++ b/module/project/view/grouptask.html.php @@ -53,6 +53,7 @@ ?>
+
+ project = $projectID; @@ -207,9 +209,11 @@
task->typeList, $task->type);?> '>deadline, 0, 4) > 0) echo $task->deadline;?> + project&taskID=$task->id", $task, 'list', '', '', 'iframe', true);?> id", '', 'list');?> project&taskid=$task->id", '', 'list', 'trash', 'hiddenwin');?> +