diff --git a/Makefile b/Makefile index b025bd4662..9df89f8f61 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,6 @@ zentaoxx: cp -r xuan/xxb/config/ext/maps.php zentaoxx/config/ext/ cp -r xuan/xxb/apischeme.json zentaoxx/ cp $(XUANPATH)/xxb/config/ext/maps.php zentaoxx/config/ext/ - cp $(XUANPATH)/xxb/module/im/model.php zentaoxx/module/im/model.php cp $(XUANPATH)/xxb/apischeme.json zentaoxx/ cp -r xuanxuan/config/* zentaoxx/config/ cp -r xuanxuan/module/* zentaoxx/module/ diff --git a/VERSION b/VERSION index b700dc1d47..8a1a06f91f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.0.1 +12.1.stable diff --git a/config/config.php b/config/config.php index 4e8b70d6f1..47bf36b381 100644 --- a/config/config.php +++ b/config/config.php @@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '12.0.1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->version = '12.1'; // 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. diff --git a/config/filter.php b/config/filter.php index 45e53030de..936cfd2d36 100644 --- a/config/filter.php +++ b/config/filter.php @@ -11,7 +11,7 @@ $filter->rules->orderBy = '/^\w+_(desc|asc)$/i'; $filter->rules->browseType = '/^by\w+$/i'; $filter->rules->word = '/^\w+$/'; $filter->rules->paramName = '/^[a-zA-Z0-9_\.]+$/'; -$filter->rules->paramValue = '/^[a-zA-Z0-9=_,`#+\^\/\.%\|\x7f-\xff]+$/'; +$filter->rules->paramValue = '/^[a-zA-Z0-9=_,`#+\^\/\.%\|\x7f-\xff\-]+$/'; $filter->default = new stdclass(); $filter->default->moduleName = 'code'; diff --git a/config/zentaopms.php b/config/zentaopms.php index 8ae47750ff..42c169bf6a 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -174,6 +174,7 @@ define('TABLE_JOB', '`' . $config->db->prefix . 'job`'); define('TABLE_COMPILE', '`' . $config->db->prefix . 'compile`'); define('TABLE_REPO', '`' . $config->db->prefix . 'repo`'); +define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`'); define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`'); define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`'); define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`'); diff --git a/db/standard/zentao12.1.sql b/db/standard/zentao12.1.sql new file mode 100644 index 0000000000..a7774fe61d --- /dev/null +++ b/db/standard/zentao12.1.sql @@ -0,0 +1,1039 @@ +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(30) NOT NULL DEFAULT '', + `action` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(20) NOT NULL, + `title` varchar(100) NOT NULL, + `source` varchar(20) NOT NULL, + `block` varchar(20) NOT NULL, + `params` text NOT NULL, + `order` tinyint(3) unsigned NOT NULL DEFAULT '0', + `grid` tinyint(3) unsigned NOT NULL DEFAULT '0', + `height` smallint(5) unsigned NOT NULL DEFAULT '0', + `hidden` tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `accountModuleOrder` (`account`,`module`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_branch` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toTask` mediumint(8) unsigned NOT NULL DEFAULT '0', + `toStory` mediumint(8) NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `severity` tinyint(4) NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `os` varchar(30) NOT NULL DEFAULT '', + `browser` varchar(30) NOT NULL DEFAULT '', + `hardware` varchar(30) NOT NULL, + `found` varchar(30) NOT NULL DEFAULT '', + `steps` text NOT NULL, + `status` enum('active','resolved','closed') NOT NULL DEFAULT 'active', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `activatedCount` smallint(6) NOT NULL, + `activatedDate` datetime NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedBuild` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL DEFAULT '', + `resolution` varchar(30) NOT NULL DEFAULT '', + `resolvedBuild` varchar(30) NOT NULL DEFAULT '', + `resolvedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `duplicateBug` mediumint(8) unsigned NOT NULL, + `linkBug` varchar(255) NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `caseVersion` smallint(6) NOT NULL DEFAULT '1', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `testtask` mediumint(8) unsigned NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(150) NOT NULL, + `scmPath` char(255) NOT NULL, + `filePath` char(255) NOT NULL, + `date` date NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `builder` char(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_company` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(120) DEFAULT NULL, + `phone` char(20) DEFAULT NULL, + `fax` char(20) DEFAULT NULL, + `address` char(120) DEFAULT NULL, + `zipcode` char(10) DEFAULT NULL, + `website` char(120) DEFAULT NULL, + `backyard` char(120) DEFAULT NULL, + `guest` enum('1','0') NOT NULL DEFAULT '0', + `admins` char(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `tag` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cron` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `m` varchar(20) NOT NULL, + `h` varchar(20) NOT NULL, + `dom` varchar(20) NOT NULL, + `mon` varchar(20) NOT NULL, + `dow` varchar(20) NOT NULL, + `command` text NOT NULL, + `remark` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `buildin` tinyint(1) NOT NULL DEFAULT '0', + `status` varchar(20) NOT NULL, + `lastTime` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `lastTime` (`lastTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_dept` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(60) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(4) unsigned NOT NULL DEFAULT '0', + `position` char(30) NOT NULL DEFAULT '', + `function` char(255) NOT NULL DEFAULT '', + `manager` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `views` smallint(5) unsigned NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` text NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `main` enum('0','1') NOT NULL DEFAULT '0', + `collector` text NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` char(30) NOT NULL DEFAULT '', + `todo` enum('1','0') NOT NULL DEFAULT '1', + `date` date NOT NULL, + `begin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `end` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` enum('1','2','3') NOT NULL DEFAULT '1', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `status` enum('1','2','3') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + KEY `user` (`user`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_entry` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `account` varchar(30) NOT NULL DEFAULT '', + `code` varchar(20) NOT NULL, + `key` varchar(32) NOT NULL, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `calledTime` int(10) unsigned NOT NULL DEFAULT '0', + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0', '1') NOT NULL DEFAULT '0', + PRIMARY KEY `id` (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_extension` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(150) NOT NULL, + `code` varchar(30) NOT NULL, + `version` varchar(50) NOT NULL, + `author` varchar(100) NOT NULL, + `desc` text NOT NULL, + `license` text NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'extension', + `site` varchar(150) NOT NULL, + `zentaoCompatible` varchar(100) NOT NULL, + `installedTime` datetime NOT NULL, + `depends` varchar(100) NOT NULL, + `dirs` mediumtext NOT NULL, + `files` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`), + KEY `name` (`name`), + KEY `installedTime` (`installedTime`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` char(255) NOT NULL, + `extension` char(30) NOT NULL, + `size` int(10) unsigned NOT NULL DEFAULT '0', + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `addedBy` char(30) NOT NULL DEFAULT '', + `addedDate` datetime NOT NULL, + `downloads` mediumint(8) unsigned NOT NULL DEFAULT '0', + `extra` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_grouppriv` ( + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` char(30) NOT NULL DEFAULT '', + `method` char(30) NOT NULL DEFAULT '', + UNIQUE KEY `group` (`group`,`module`,`method`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_history` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `action` mediumint(8) unsigned NOT NULL DEFAULT '0', + `field` varchar(30) NOT NULL DEFAULT '', + `old` text NOT NULL, + `new` text NOT NULL, + `diff` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_jenkins` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(30) NOT NULL, + `token` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(20) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lang` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `lang` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `section` varchar(30) NOT NULL, + `key` varchar(60) NOT NULL, + `value` text NOT NULL, + `system` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_log` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(8) unsigned NOT NULL, + `date` datetime NOT NULL, + `url` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL, + `data` text NOT NULL, + `result` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType` (`objectType`), + KEY `obejctID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_module` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` char(60) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) unsigned NOT NULL DEFAULT '0', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `owner` varchar(30) NOT NULL, + `collector` text NOT NULL, + `short` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `root` (`root`), + KEY `type` (`type`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_oauth` ( + `account` varchar(30) NOT NULL, + `openID` varchar(255) NOT NULL, + `providerType` varchar(30) NOT NULL, + `providerID` mediumint(8) unsigned NOT NULL, + KEY `account` (`account`), + KEY `providerType` (`providerType`), + KEY `providerID` (`providerID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `line` mediumint(8) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'normal', + `status` varchar(30) NOT NULL DEFAULT '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `parent` mediumint(9) NOT NULL DEFAULT '0', + `title` varchar(90) NOT NULL, + `desc` text NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `end` (`end`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `isCat` enum('1','0') NOT NULL DEFAULT '0', + `catID` mediumint(8) unsigned NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'sprint', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `statge` enum('1','2','3','4','5') NOT NULL DEFAULT '1', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `PO` varchar(30) NOT NULL DEFAULT '', + `PM` varchar(30) NOT NULL DEFAULT '', + `QD` varchar(30) NOT NULL DEFAULT '', + `RD` varchar(30) NOT NULL DEFAULT '', + `team` varchar(90) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `begin` (`begin`), + KEY `end` (`end`), + KEY `status` (`status`), + KEY `acl` (`acl`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectproduct` ( + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `plan` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`project`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_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, + `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, + `product` mediumint(8) unsigned NOT NULL default '0', + `branch` mediumint(8) unsigned NOT NULL default '0', + `module` mediumint(8) unsigned NOT NULL default '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL default '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL default '', + `pri` tinyint(3) unsigned NOT NULL default '3', + `estimate` float unsigned NOT NULL, + `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', + `stagedBy` char(30) NOT NULL, + `mailto` text, + `openedBy` varchar(30) NOT NULL default '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL default '', + `assignedDate` datetime NOT NULL, + `lastEditedBy` varchar(30) NOT NULL default '', + `lastEditedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL default '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `toBug` mediumint(8) unsigned NOT NULL, + `childStories` varchar(255) NOT NULL, + `linkStories` varchar(255) NOT NULL, + `duplicateStory` mediumint(8) unsigned NOT NULL, + `version` smallint(6) NOT NULL default '1', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `status` (`status`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyspec` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `title` varchar(255) NOT NULL, + `spec` text NOT NULL, + `verify` text NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + `stagedBy` char(30) NOT NULL, + UNIQUE KEY `story_branch` (`story`,`branch`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_suitecase` ( + `suite` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + UNIQUE KEY `suitecase` (`suite`,`case`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_task` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `estimate` float unsigned NOT NULL, + `consumed` float unsigned NOT NULL, + `left` float unsigned NOT NULL, + `deadline` date NOT NULL, + `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `mailto` text, + `desc` text NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` date NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `project` (`project`), + KEY `story` (`story`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_team` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `root` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` enum('project','task') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(2,1) unsigned NOT NULL DEFAULT '0.0', + `estimate` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `consumed` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `left` decimal(12,2) unsigned NOT NULL DEFAULT '0.00', + `order` tinyint(3) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime 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', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `type` char(10) NOT NULL, + `cycle` tinyint(3) unsigned NOT NULL DEFAULT '0', + `idvalue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `pri` tinyint(3) unsigned NOT NULL, + `name` char(150) NOT NULL, + `desc` text NOT NULL, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `private` tinyint(1) NOT NULL, + `config` varchar(255) NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedBy` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL DEFAULT '', + `finishedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dept` mediumint(8) unsigned NOT NULL DEFAULT '0', + `account` char(30) NOT NULL DEFAULT '', + `password` char(32) NOT NULL DEFAULT '', + `role` char(10) NOT NULL DEFAULT '', + `realname` varchar(100) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` char(30) NOT NULL DEFAULT '', + `birthday` date NOT NULL DEFAULT '0000-00-00', + `gender` enum('f','m') NOT NULL DEFAULT 'f', + `email` char(90) NOT NULL DEFAULT '', + `skype` char(90) NOT NULL DEFAULT '', + `qq` char(20) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) NOT NULL DEFAULT '', + `weixin` varchar(90) NOT NULL DEFAULT '', + `dingding` varchar(90) NOT NULL DEFAULT '', + `slack` varchar(90) NOT NULL DEFAULT '', + `whatsapp` varchar(90) NOT NULL DEFAULT '', + `address` char(120) NOT NULL DEFAULT '', + `zipcode` char(10) NOT NULL DEFAULT '', + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `ip` char(15) NOT NULL DEFAULT '', + `last` int(10) unsigned NOT NULL DEFAULT '0', + `fails` tinyint(5) NOT NULL DEFAULT '0', + `locked` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ranzhi` char(30) NOT NULL DEFAULT '', + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usercontact` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `listName` varchar(60) NOT NULL, + `userList` text NOT NULL, + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usergroup` ( + `account` char(30) NOT NULL DEFAULT '', + `group` mediumint(8) unsigned NOT NULL DEFAULT '0', + UNIQUE KEY `account` (`account`,`group`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userquery` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(90) NOT NULL, + `form` text NOT NULL, + `sql` text NOT NULL, + `shortcut` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_usertpl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(150) NOT NULL, + `content` text NOT NULL, + `public` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_userview` ( + `account` char(30) NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(10) NOT NULL DEFAULT 'default', + `name` varchar(50) NOT NULL, + `url` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `secret` varchar(255) NOT NULL, + `contentType` varchar(30) NOT NULL DEFAULT 'application/json', + `sendType` enum('sync','async') NOT NULL DEFAULT 'sync', + `products` text NOT NULL, + `projects` text NOT NULL, + `params` varchar(100) NOT NULL, + `actions` text NOT NULL, + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/db/update12.0.1.sql b/db/update12.0.1.sql index 6145e694a2..47efed6a6e 100644 --- a/db/update12.0.1.sql +++ b/db/update12.0.1.sql @@ -1,14 +1,12 @@ ALTER TABLE `zt_story` CHANGE `type` `type` varchar(30) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'story' AFTER `keywords`; UPDATE zt_story SET `type` = 'story' WHERE `type` = ''; --- DROP TABLE IF EXISTS `zt_jenkins`; CREATE TABLE IF NOT EXISTS `zt_jenkins` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `url` varchar(255) DEFAULT NULL, `account` varchar(30) DEFAULT NULL, `password` varchar(30) NOT NULL, - `encrypt` varchar(30) NOT NULL DEFAULT 'plain', `token` varchar(255) DEFAULT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, @@ -18,36 +16,37 @@ CREATE TABLE IF NOT EXISTS `zt_jenkins` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; --- DROP TABLE IF EXISTS `zt_integration`; -CREATE TABLE IF NOT EXISTS `zt_integration` ( +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, - `jenkins` mediumint(8) unsigned NOT NULL, - `jenkinsJob` varchar(500) NOT NULL, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, `triggerType` varchar(255) NOT NULL, - `svnFolder` varchar(255) NOT NULL, - `scheduleDay` varchar(255) DEFAULT NULL, - `tagKeywords` varchar(255) DEFAULT NULL, - `commentKeywords` varchar(255) DEFAULT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(20) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, `editedBy` varchar(30) NOT NULL, `editedDate` datetime NOT NULL, - `deleted` enum('0','1') NOT NULL DEFAULT '0', `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; --- DROP TABLE IF EXISTS `zt_compile`; CREATE TABLE IF NOT EXISTS `zt_compile` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, - `cijob` mediumint(8) unsigned NOT NULL, - `queueItem` mediumint(8) 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, + `tag` varchar(255) NOT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, `updateDate` datetime NOT NULL, @@ -60,32 +59,10 @@ INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type ('*/5', '*', '*', '*', '*', 'moduleName=ci&methodName=checkBuildStatus', '同步Jenkins任务状态', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), ('*/5', '*', '*', '*', '*', 'moduleName=ci&methodName=exec', '执行Jenkins任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'); -ALTER TABLE `zt_integration` -CHANGE `jenkins` `jkHost` mediumint(8) unsigned NOT NULL AFTER `repo`, -CHANGE `jenkinsJob` `jkJob` varchar(500) COLLATE 'utf8_general_ci' NOT NULL AFTER `jkHost`, -CHANGE `svnFolder` `svnDir` varchar(255) COLLATE 'utf8_general_ci' NOT NULL AFTER `triggerType`, -CHANGE `scheduleDay` `atDay` varchar(20) COLLATE 'utf8_general_ci' NULL AFTER `svnDir`, -ADD `atTime` varchar(10) COLLATE 'utf8_general_ci' NULL AFTER `atDay`, -DROP `tagKeywords`, -DROP `commentKeywords`, -ADD `comment` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `atTime`, -ADD `lastTag` varchar(255) COLLATE 'utf8_general_ci' NULL; - -ALTER TABLE `zt_webhook` MODIFY COLUMN `type` varchar(15) NOT NULL; +ALTER TABLE `zt_webhook` MODIFY COLUMN `type` varchar(15) NOT NULL DEFAULT 'default'; UPDATE `zt_webhook` SET `type` = 'dinggroup' WHERE `type` = 'dingding'; UPDATE `zt_webhook` SET `type` = 'dinguser' WHERE `type` = 'dingapi'; UPDATE `zt_webhook` SET `type` = 'wechatgroup' WHERE `type` = 'weixin'; UPDATE `zt_grouppriv` SET `method` = 'edit' WHERE `module` = 'repo' AND `method` = 'settings'; UPDATE `zt_grouppriv` SET `method` = 'showsynccommit' WHERE `module` = 'repo' AND `method` = 'showsynccomment'; - -ALTER TABLE `zt_compile` -CHANGE `cijob` `integration` mediumint(8) unsigned NOT NULL AFTER `name`, -CHANGE `queueItem` `queue` mediumint(8) NOT NULL AFTER `integration`; - -ALTER TABLE `zt_jenkins` CHANGE `serviceUrl` `url` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `name`; -ALTER TABLE `zt_jenkins` DROP `encrypt`; - -ALTER TABLE `zt_compile` ADD `atTime` varchar(10) COLLATE 'utf8_general_ci' NULL AFTER `logs`; -ALTER TABLE `zt_compile` ADD `tag` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `logs`; -ALTER TABLE `zt_integration` RENAME TO `zt_job`; -ALTER TABLE `zt_compile` CHANGE `integration` `job` mediumint(8) unsigned NOT NULL AFTER `name`; +UPDATE `zt_grouppriv` SET `method` = 'showsynccommit' WHERE `module` = 'repo' AND `method` = 'showSyncComment'; diff --git a/db/zentao.sql b/db/zentao.sql index c19ee4c400..788f33a110 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -217,10 +217,12 @@ CREATE TABLE IF NOT EXISTS `zt_company` ( CREATE TABLE IF NOT EXISTS `zt_compile` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, - `integration` mediumint(8) unsigned 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, + `tag` varchar(255) NOT NULL, `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, `updateDate` datetime NOT NULL, @@ -422,27 +424,6 @@ CREATE TABLE IF NOT EXISTS `zt_history` ( PRIMARY KEY (`id`), KEY `action` (`action`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; --- DROP TABLE IF EXISTS `zt_integration`; -CREATE TABLE IF NOT EXISTS `zt_integration` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `repo` mediumint(8) unsigned NOT NULL, - `jenkins` mediumint(8) unsigned NOT NULL, - `jenkinsJob` varchar(500) NOT NULL, - `triggerType` varchar(255) NOT NULL, - `svnFolder` varchar(255) NOT NULL, - `scheduleDay` varchar(255) DEFAULT NULL, - `tagKeywords` varchar(255) DEFAULT NULL, - `commentKeywords` 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', - `lastExec` datetime DEFAULT NULL, - `lastStatus` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_jenkins`; CREATE TABLE IF NOT EXISTS `zt_jenkins` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -458,6 +439,28 @@ CREATE TABLE IF NOT EXISTS `zt_jenkins` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_job`; +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, + `jkHost` mediumint(8) unsigned NOT NULL, + `jkJob` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `lastExec` datetime DEFAULT NULL, + `lastStatus` varchar(255) DEFAULT NULL, + `lastTag` varchar(255) DEFAULT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_module`; CREATE TABLE IF NOT EXISTS `zt_module` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1044,7 +1047,7 @@ CREATE TABLE IF NOT EXISTS `zt_entry` ( -- DROP TABLE IF EXISTS `zt_webhook`; CREATE TABLE IF NOT EXISTS `zt_webhook` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `type` varchar(10) NOT NULL DEFAULT 'default', + `type` varchar(15) NOT NULL DEFAULT 'default', `name` varchar(50) NOT NULL, `url` varchar(255) NOT NULL, `domain` varchar(255) NOT NULL, @@ -1116,6 +1119,23 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_relation`; +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; + -- DROP TABLE IF EXISTS `zt_repobranch`; CREATE TABLE IF NOT EXISTS `zt_repobranch` ( `repo` mediumint(8) unsigned NOT NULL, @@ -1422,6 +1442,30 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'release', 'unlinkStory'), (1, 'release', 'view'), (1, 'release', 'changeStatus'), +(1, 'repo', 'view'), +(1, 'repo', 'blame'), +(1, 'repo', 'revision'), +(1, 'repo', 'showSyncCommit'), +(1, 'repo', 'download'), +(1, 'repo', 'browse'), +(1, 'repo', 'diff'), +(1, 'repo', 'log'), +(1, 'repo', 'maintain'), +(1, 'repo', 'setRules'), +(1, 'repo', 'create'), +(1, 'repo', 'edit'), +(1, 'repo', 'delete'), +(1, 'compile', 'browse'), +(1, 'compile', 'logs'), +(1, 'jenkins', 'browse'), +(1, 'jenkins', 'create'), +(1, 'jenkins', 'edit'), +(1, 'jenkins', 'delete'), +(1, 'job', 'browse'), +(1, 'job', 'create'), +(1, 'job', 'edit'), +(1, 'job', 'delete'), +(1, 'job', 'exec'), (1, 'report', 'bugAssign'), (1, 'report', 'bugCreate'), (1, 'report', 'index'), @@ -1693,6 +1737,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2, 'release', 'browse'), (2, 'release', 'export'), (2, 'release', 'view'), +(2, 'repo', 'view'), +(2, 'repo', 'blame'), +(2, 'repo', 'revision'), +(2, 'repo', 'showSyncCommit'), +(2, 'repo', 'download'), +(2, 'repo', 'browse'), +(2, 'repo', 'diff'), +(2, 'repo', 'log'), (2, 'report', 'bugAssign'), (2, 'report', 'bugCreate'), (2, 'report', 'index'), @@ -1879,6 +1931,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3, 'release', 'browse'), (3, 'release', 'export'), (3, 'release', 'view'), +(3, 'repo', 'view'), +(3, 'repo', 'blame'), +(3, 'repo', 'revision'), +(3, 'repo', 'showSyncCommit'), +(3, 'repo', 'download'), +(3, 'repo', 'browse'), +(3, 'repo', 'diff'), +(3, 'repo', 'log'), (3, 'report', 'bugAssign'), (3, 'report', 'bugCreate'), (3, 'report', 'index'), @@ -2142,6 +2202,30 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4, 'release', 'browse'), (4, 'release', 'export'), (4, 'release', 'view'), +(4, 'repo', 'view'), +(4, 'repo', 'blame'), +(4, 'repo', 'revision'), +(4, 'repo', 'showSyncCommit'), +(4, 'repo', 'download'), +(4, 'repo', 'browse'), +(4, 'repo', 'diff'), +(4, 'repo', 'log'), +(4, 'repo', 'create'), +(4, 'repo', 'edit'), +(4, 'repo', 'delete'), +(4, 'repo', 'maintain'), +(4, 'repo', 'setRules'), +(4, 'compile', 'browse'), +(4, 'compile', 'logs'), +(4, 'jenkins', 'browse'), +(4, 'jenkins', 'create'), +(4, 'jenkins', 'edit'), +(4, 'jenkins', 'delete'), +(4, 'job', 'browse'), +(4, 'job', 'create'), +(4, 'job', 'edit'), +(4, 'job', 'delete'), +(4, 'job', 'exec'), (4, 'report', 'bugAssign'), (4, 'report', 'bugCreate'), (4, 'report', 'index'), @@ -2400,6 +2484,30 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5, 'release', 'unlinkStory'), (5, 'release', 'view'), (5, 'release', 'changeStatus'), +(5, 'repo', 'view'), +(5, 'repo', 'blame'), +(5, 'repo', 'revision'), +(5, 'repo', 'showSyncCommit'), +(5, 'repo', 'download'), +(5, 'repo', 'browse'), +(5, 'repo', 'diff'), +(5, 'repo', 'log'), +(5, 'repo', 'create'), +(5, 'repo', 'edit'), +(5, 'repo', 'delete'), +(5, 'repo', 'maintain'), +(5, 'repo', 'setRules'), +(5, 'compile', 'browse'), +(5, 'compile', 'logs'), +(5, 'jenkins', 'browse'), +(5, 'jenkins', 'create'), +(5, 'jenkins', 'edit'), +(5, 'jenkins', 'delete'), +(5, 'job', 'browse'), +(5, 'job', 'create'), +(5, 'job', 'edit'), +(5, 'job', 'delete'), +(5, 'job', 'exec'), (5, 'report', 'bugAssign'), (5, 'report', 'bugCreate'), (5, 'report', 'index'), @@ -2646,6 +2754,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6, 'release', 'browse'), (6, 'release', 'export'), (6, 'release', 'view'), +(6, 'repo', 'view'), +(6, 'repo', 'blame'), +(6, 'repo', 'revision'), +(6, 'repo', 'showSyncCommit'), +(6, 'repo', 'download'), +(6, 'repo', 'browse'), +(6, 'repo', 'diff'), +(6, 'repo', 'log'), (6, 'report', 'bugAssign'), (6, 'report', 'bugCreate'), (6, 'report', 'index'), @@ -2885,6 +3001,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7, 'release', 'unlinkStory'), (7, 'release', 'view'), (7, 'release', 'changeStatus'), +(7, 'repo', 'view'), +(7, 'repo', 'blame'), +(7, 'repo', 'revision'), +(7, 'repo', 'showSyncCommit'), +(7, 'repo', 'download'), +(7, 'repo', 'browse'), +(7, 'repo', 'diff'), +(7, 'repo', 'log'), (7, 'report', 'bugAssign'), (7, 'report', 'bugCreate'), (7, 'report', 'index'), @@ -3107,6 +3231,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8, 'release', 'browse'), (8, 'release', 'export'), (8, 'release', 'view'), +(8, 'repo', 'view'), +(8, 'repo', 'blame'), +(8, 'repo', 'revision'), +(8, 'repo', 'showSyncCommit'), +(8, 'repo', 'download'), +(8, 'repo', 'browse'), +(8, 'repo', 'diff'), +(8, 'repo', 'log'), (8, 'report', 'bugAssign'), (8, 'report', 'bugCreate'), (8, 'report', 'index'), @@ -3347,6 +3479,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9, 'release', 'browse'), (9, 'release', 'export'), (9, 'release', 'view'), +(9, 'repo', 'view'), +(9, 'repo', 'blame'), +(9, 'repo', 'revision'), +(9, 'repo', 'showSyncCommit'), +(9, 'repo', 'download'), +(9, 'repo', 'browse'), +(9, 'repo', 'diff'), +(9, 'repo', 'log'), (9, 'report', 'bugAssign'), (9, 'report', 'bugCreate'), (9, 'report', 'index'), @@ -3490,6 +3630,14 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10, 'qa', 'index'), (10, 'release', 'browse'), (10, 'release', 'view'), +(10, 'repo', 'view'), +(10, 'repo', 'blame'), +(10, 'repo', 'revision'), +(10, 'repo', 'showSyncCommit'), +(10, 'repo', 'download'), +(10, 'repo', 'browse'), +(10, 'repo', 'diff'), +(10, 'repo', 'log'), (10, 'report', 'bugAssign'), (10, 'report', 'bugCreate'), (10, 'report', 'index'), diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 544bf92371..9e6cf8d6c2 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,17 @@ +2020-03-10 12.1 +完成的需求: +4594 调整浏览代码时版本表头的对齐 +4595 代码浏览文件全屏之后按钮应是缩回按钮 +4598 svn封装获取某一个目录下面目录和文件列表的功能 +4243 实现禅道消息到企业微信个人的通知 +4593 附件输出方式改为边读边下 +4586 提醒的宽度太宽了 +4585 备份列表的表头对齐 +修复的Bug +2893 与钉钉集成的性能需要优化 +2965 卸载插件文件无法删除 +2968 后台数据页面无法展示展示 + 2020-02-12 12.0.1 完成的需求: 4588 添加需求、任务、bug、用例之后能够记录所属模块 diff --git a/framework/router.class.php b/framework/router.class.php index d8b8006b69..55503ddff0 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -136,6 +136,8 @@ class router extends baseRouter if($setting->key == 'hourPoint') $hourCommon = $setting->value; } + $config->storyCommon = $storyCommon; + /* Set productCommon, projectCommon, storyCommon and hourCommon. Default english lang. */ $lang->productCommon = isset($this->config->productCommonList[$this->clientLang][(int)$productCommon]) ? $this->config->productCommonList[$this->clientLang][(int)$productCommon] : $this->config->productCommonList['en'][(int)$productCommon]; $lang->projectCommon = isset($this->config->projectCommonList[$this->clientLang][(int)$projectCommon]) ? $this->config->projectCommonList[$this->clientLang][(int)$projectCommon] : $this->config->projectCommonList['en'][(int)$projectCommon]; diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index 9ae31fd1f6..02e80e8efa 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -104,13 +104,14 @@ class Subversion } ksort($dirs); - $tags = array(); + $tags = array(); + $prefix = empty(trim($path, '/')) ? '/' : '/' . trim($path, '/') . '/'; foreach($dirs as $dirNames) { ksort($dirNames); foreach($dirNames as $dirName) { - $dirPath = $path . '/' . $dirName; + $dirPath = $prefix . $dirName; $tags[$dirPath] = $dirName; } } diff --git a/module/action/model.php b/module/action/model.php index bf74d2ba79..827628b70a 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -503,7 +503,14 @@ class actionModel extends model if(empty($actionID)) return false; foreach($changes as $change) { - $change['action'] = $actionID; + if(is_object($change)) + { + $change->action = $actionID; + } + else + { + $change['action'] = $actionID; + } $this->dao->insert(TABLE_HISTORY)->data($change)->exec(); } } diff --git a/module/bug/lang/zh-tw.php b/module/bug/lang/zh-tw.php index c459c001fc..97ec8273d4 100644 --- a/module/bug/lang/zh-tw.php +++ b/module/bug/lang/zh-tw.php @@ -154,7 +154,7 @@ $lang->bug->lblLastEdited = '最後修改'; $lang->bug->lblResolved = '由誰解決'; $lang->bug->allUsers = '加載所有用戶'; $lang->bug->allBuilds = '所有'; -$lang->bug->createBuild = '创建'; +$lang->bug->createBuild = '創建'; /* legend列表。*/ $lang->bug->legendBasicInfo = '基本信息'; diff --git a/module/ci/lang/de.php b/module/ci/lang/de.php new file mode 100644 index 0000000000..4d1df04d71 --- /dev/null +++ b/module/ci/lang/de.php @@ -0,0 +1,6 @@ +ci->common = 'CI'; + +$lang->ci->job = 'Construction'; +$lang->ci->task = 'Task'; +$lang->ci->history = 'History'; diff --git a/module/ci/lang/fr.php b/module/ci/lang/fr.php new file mode 100644 index 0000000000..4d1df04d71 --- /dev/null +++ b/module/ci/lang/fr.php @@ -0,0 +1,6 @@ +ci->common = 'CI'; + +$lang->ci->job = 'Construction'; +$lang->ci->task = 'Task'; +$lang->ci->history = 'History'; diff --git a/module/ci/lang/zh-tw.php b/module/ci/lang/zh-tw.php new file mode 100644 index 0000000000..1257dbfa84 --- /dev/null +++ b/module/ci/lang/zh-tw.php @@ -0,0 +1,6 @@ +ci->common = '持續整合'; + +$lang->ci->job = '構建'; +$lang->ci->task = '構建任務'; +$lang->ci->history = '構建歷史'; diff --git a/module/ci/model.php b/module/ci/model.php index c28314a532..ed93df153d 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -37,6 +37,7 @@ class ciModel extends model ->leftJoin(TABLE_JENKINS)->alias('t3')->on('t2.jkHost=t3.id') ->where('t1.status')->ne('success') ->andWhere('t1.status')->ne('fail') + ->andWhere('t1.status')->ne('create_fail') ->andWhere('t1.status')->ne('timeout') ->andWhere('t1.createdDate')->gt(date(DT_DATETIME1, strtotime("-1 day"))) ->fetchAll(); diff --git a/module/common/lang/de.php b/module/common/lang/de.php index db3ced3650..0c6b8a9869 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -101,6 +101,7 @@ $lang->loading = 'Lade...'; $lang->notFound = 'Nicht gefunden!'; $lang->notPage = 'Sorry, the features you are visiting are in development!'; $lang->showAll = '[[Alle anzeigen]]'; +$lang->selectedItems = 'Seleted {0} items'; $lang->future = 'Warte'; $lang->year = 'Jahr'; @@ -122,7 +123,7 @@ $lang->menu->my = 'Dashboard|my|index'; $lang->menu->product = $lang->productCommon . '|product|index|locate=no'; $lang->menu->project = $lang->projectCommon . '|project|index|locate=no'; $lang->menu->qa = 'Test|qa|index'; -$lang->menu->repo = 'Code|repo|log'; +$lang->menu->ci = 'CI|repo|browse'; $lang->menu->doc = 'Dokumente|doc|index'; $lang->menu->report = 'Berichte|report|index'; $lang->menu->company = 'Unternehmen|company|index'; @@ -331,11 +332,22 @@ $lang->caselib->menu->testsuite = array('link' => 'Suite|testsuite|browse|'); $lang->caselib->menu->report = array('link' => 'Berichte|testreport|browse|'); $lang->caselib->menu->caselib = array('link' => 'Bibliothek|caselib|browse|libID=%s', 'alias' => 'create,createcase,view,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase'); -$lang->repo = new stdclass(); -$lang->repo->menu = new stdclass(); -$lang->repo->menu->browse = array('link' =>'Browse|repo|log|repoID=%s&entry=', 'alias' => 'diff,view,revision,showsynccomment'); -$lang->repo->menu->settings = 'Settings|repo|settings|repoID=%s'; -$lang->repo->menu->delete = array('link' => 'Delete|repo|delete|repoID=%s', 'target' => 'hiddenwin'); +$lang->ci = new stdclass(); +$lang->ci->menu = new stdclass(); +$lang->ci->menu->code = array('link' => 'Code|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,log,blame,showsynccomment'); +$lang->ci->menu->build = array('link' => 'Build|job|browse', 'subModule' => 'compile,job'); +$lang->ci->menu->jenkins = array('link' => 'Jenkins|jenkins|browse', 'alias' => 'create,edit'); +$lang->ci->menu->maintain = array('link' => 'Repo|repo|maintain', 'alias' => 'create,edit'); +$lang->ci->menu->rules = array('link' => 'Rule|repo|setrules'); + +$lang->repo = new stdclass(); +$lang->jenkins = new stdclass(); +$lang->compile = new stdclass(); +$lang->job = new stdclass(); +$lang->repo->menu = $lang->ci->menu; +$lang->jenkins->menu = $lang->ci->menu; +$lang->compile->menu = $lang->ci->menu; +$lang->job->menu = $lang->ci->menu; /* 文档视图菜单设置。*/ $lang->doc = new stdclass(); @@ -475,6 +487,11 @@ $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; $lang->menugroup->message = 'admin'; +$lang->menugroup->repo = 'ci'; +$lang->menugroup->jenkins = 'ci'; +$lang->menugroup->compile = 'ci'; +$lang->menugroup->job = 'ci'; + /* 错误提示信息。*/ $lang->error = new stdclass(); $lang->error->companyNotFound = "The domain %s cannot be found!"; @@ -501,6 +518,7 @@ $lang->error->pasteImg = 'Image is not allowed to be pasted in your brows $lang->error->noData = 'No Data'; $lang->error->editedByOther = 'This record might have been changed. Please refresh and try to edit again!'; $lang->error->tutorialData = 'No data can be imported in tutorial mode. Please exit tutorial first!'; +$lang->error->noCurlExt = 'No Curl module installed'; /* 分页信息。*/ $lang->pager = new stdclass(); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 33d86cacfc..b8365751bf 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -487,8 +487,10 @@ $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; $lang->menugroup->message = 'admin'; -$lang->menugroup->repo = 'ci'; -$lang->menugroup->jenkins = 'ci'; +$lang->menugroup->repo = 'ci'; +$lang->menugroup->jenkins = 'ci'; +$lang->menugroup->compile = 'ci'; +$lang->menugroup->job = 'ci'; /* Error info. */ $lang->error = new stdclass(); diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index a8a4a39f6c..22be18c16d 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -101,6 +101,7 @@ $lang->loading = 'Chargement...'; $lang->notFound = 'Not found !'; $lang->notPage = 'Désolé, la fonctionnalité que vous souhaitez utiliser est encore en développement !'; $lang->showAll = '[[Voir Tout]]'; +$lang->selectedItems = 'Seleted {0} items'; $lang->future = 'En Attente'; $lang->year = 'Année'; @@ -122,7 +123,7 @@ $lang->menu->my = 'Dashboard|my|index'; $lang->menu->product = $lang->productCommon . '|product|index|locate=no'; $lang->menu->project = $lang->projectCommon . '|project|index|locate=no'; $lang->menu->qa = 'Test|qa|index'; -$lang->menu->repo = 'Code|repo|log'; +$lang->menu->ci = 'CI|repo|browse'; $lang->menu->doc = 'Doc|doc|index'; $lang->menu->report = 'Rapports|report|index'; $lang->menu->company = 'Entreprise|company|index'; @@ -331,11 +332,22 @@ $lang->caselib->menu->testsuite = array('link' => 'Cahier Recette|testsuite|brow $lang->caselib->menu->report = array('link' => 'Rapport|testreport|browse|'); $lang->caselib->menu->caselib = array('link' => 'Library Recette|caselib|browse|libID=%s', 'alias' => 'create,createcase,view,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase'); -$lang->repo = new stdclass(); -$lang->repo->menu = new stdclass(); -$lang->repo->menu->browse = array('link' =>'Browse|repo|log|repoID=%s&entry=', 'alias' => 'diff,view,revision,showsynccomment'); -$lang->repo->menu->settings = 'Settings|repo|settings|repoID=%s'; -$lang->repo->menu->delete = array('link' => 'Delete|repo|delete|repoID=%s', 'target' => 'hiddenwin'); +$lang->ci = new stdclass(); +$lang->ci->menu = new stdclass(); +$lang->ci->menu->code = array('link' => 'Code|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,log,blame,showsynccomment'); +$lang->ci->menu->build = array('link' => 'Build|job|browse', 'subModule' => 'compile,job'); +$lang->ci->menu->jenkins = array('link' => 'Jenkins|jenkins|browse', 'alias' => 'create,edit'); +$lang->ci->menu->maintain = array('link' => 'Repo|repo|maintain', 'alias' => 'create,edit'); +$lang->ci->menu->rules = array('link' => 'Rule|repo|setrules'); + +$lang->repo = new stdclass(); +$lang->jenkins = new stdclass(); +$lang->compile = new stdclass(); +$lang->job = new stdclass(); +$lang->repo->menu = $lang->ci->menu; +$lang->jenkins->menu = $lang->ci->menu; +$lang->compile->menu = $lang->ci->menu; +$lang->job->menu = $lang->ci->menu; /* Doc menu settings. */ $lang->doc = new stdclass(); @@ -475,6 +487,11 @@ $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; $lang->menugroup->message = 'admin'; +$lang->menugroup->repo = 'ci'; +$lang->menugroup->jenkins = 'ci'; +$lang->menugroup->compile = 'ci'; +$lang->menugroup->job = 'ci'; + /* Error info. */ $lang->error = new stdclass(); $lang->error->companyNotFound = "The domain %s cannot be found!"; @@ -501,6 +518,7 @@ $lang->error->pasteImg = 'Images are not allowed to be pasted in your bro $lang->error->noData = 'No data.'; $lang->error->editedByOther = 'This record might have been changed. Please refresh and try to edit again!'; $lang->error->tutorialData = 'No data can be imported in tutorial mode. Please quit tutorial first!'; +$lang->error->noCurlExt = 'No Curl module installed'; /* Page info. */ $lang->pager = new stdclass(); diff --git a/module/common/lang/zh-tw.php b/module/common/lang/zh-tw.php index 133c6fedec..65b8bfdd5d 100644 --- a/module/common/lang/zh-tw.php +++ b/module/common/lang/zh-tw.php @@ -101,6 +101,7 @@ $lang->loading = '稍候...'; $lang->notFound = '抱歉,您訪問的對象並不存在!'; $lang->notPage = '抱歉,您訪問的功能正在開發中!'; $lang->showAll = '[[全部顯示]]'; +$lang->selectedItems = '已選擇 {0} 項'; $lang->future = '未來'; $lang->year = '年'; @@ -122,7 +123,7 @@ $lang->menu->my = ' 我的地盤|my|index'; $lang->menu->product = $lang->productCommon . '|product|index|locate=no'; $lang->menu->project = $lang->projectCommon . '|project|index|locate=no'; $lang->menu->qa = '測試|qa|index'; -$lang->menu->repo = '代碼|repo|log'; +$lang->menu->ci = '整合|repo|browse'; $lang->menu->doc = '文檔|doc|index'; $lang->menu->report = '統計|report|index'; $lang->menu->company = '組織|company|index'; @@ -331,11 +332,22 @@ $lang->caselib->menu->testsuite = array('link' => '套件|testsuite|browse|'); $lang->caselib->menu->report = array('link' => '報告|testreport|browse|'); $lang->caselib->menu->caselib = array('link' => '用例庫|caselib|browse|libID=%s', 'alias' => 'create,createcase,view,edit,batchcreatecase,showimport', 'subModule' => 'tree,testcase'); -$lang->repo = new stdclass(); -$lang->repo->menu = new stdclass(); -$lang->repo->menu->browse = array('link' =>'瀏覽|repo|log|repoID=%s&entry=', 'alias' => 'diff,view,revision,showsynccomment'); -$lang->repo->menu->settings = '設置|repo|settings|repoID=%s'; -$lang->repo->menu->delete = array('link' => '刪除|repo|delete|repoID=%s', 'target' => 'hiddenwin'); +$lang->ci = new stdclass(); +$lang->ci->menu = new stdclass(); +$lang->ci->menu->code = array('link' => '代碼|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,log,blame,showsynccomment'); +$lang->ci->menu->build = array('link' => '構建|job|browse', 'subModule' => 'compile,job'); +$lang->ci->menu->jenkins = array('link' => 'Jenkins|jenkins|browse', 'alias' => 'create,edit'); +$lang->ci->menu->maintain = array('link' => '版本庫|repo|maintain', 'alias' => 'create,edit'); +$lang->ci->menu->rules = array('link' => '指令|repo|setrules'); + +$lang->repo = new stdclass(); +$lang->jenkins = new stdclass(); +$lang->compile = new stdclass(); +$lang->job = new stdclass(); +$lang->repo->menu = $lang->ci->menu; +$lang->jenkins->menu = $lang->ci->menu; +$lang->compile->menu = $lang->ci->menu; +$lang->job->menu = $lang->ci->menu; /* 文檔視圖菜單設置。*/ $lang->doc = new stdclass(); @@ -381,7 +393,7 @@ $lang->admin->menu = new stdclass(); $lang->admin->menu->index = array('link' => '首頁|admin|index', 'alias' => 'register,certifytemail,certifyztmobile,ztcompany'); $lang->admin->menu->message = array('link' => '通知|message|index', 'subModule' => 'message,mail,webhook'); $lang->admin->menu->custom = array('link' => '自定義|custom|set', 'subModule' => 'custom'); -$lang->admin->menu->sso = array('link' => '整合|admin|sso'); +$lang->admin->menu->sso = array('link' => '整合|admin|sso', 'subModule' => ''); $lang->admin->menu->extension = array('link' => '插件|extension|browse', 'subModule' => 'extension'); $lang->admin->menu->dev = array('link' => '二次開發|dev|api', 'alias' => 'db', 'subModule' => 'dev,entry'); $lang->admin->menu->translate = array('link' => '翻譯|dev|translate'); @@ -475,6 +487,11 @@ $lang->menugroup->entry = 'admin'; $lang->menugroup->webhook = 'admin'; $lang->menugroup->message = 'admin'; +$lang->menugroup->repo = 'ci'; +$lang->menugroup->jenkins = 'ci'; +$lang->menugroup->compile = 'ci'; +$lang->menugroup->job = 'ci'; + /* 錯誤提示信息。*/ $lang->error = new stdclass(); $lang->error->companyNotFound = "您訪問的域名 %s 沒有對應的公司。"; @@ -501,6 +518,7 @@ $lang->error->pasteImg = '您的瀏覽器不支持粘貼圖片!'; $lang->error->noData = '沒有數據'; $lang->error->editedByOther = '該記錄可能已經被改動。請刷新頁面重新編輯!'; $lang->error->tutorialData = '新手模式下不會插入數據,請退出新手模式操作'; +$lang->error->noCurlExt = '伺服器未安裝Curl模組。'; /* 分頁信息。*/ $lang->pager = new stdclass(); diff --git a/module/compile/lang/de.php b/module/compile/lang/de.php new file mode 100644 index 0000000000..69d5eeca79 --- /dev/null +++ b/module/compile/lang/de.php @@ -0,0 +1,16 @@ +compile->common = 'Build'; +$lang->compile->browse = 'Build Histories'; +$lang->compile->logs = 'Build Logs'; + +$lang->compile->id = 'ID'; +$lang->compile->name = 'Name'; +$lang->compile->status = 'Build Status'; +$lang->compile->time = 'Build Time'; + +$lang->compile->statusList['success'] = 'Success'; +$lang->compile->statusList['failure'] = 'Fail'; +$lang->compile->statusList['created'] = 'Created'; +$lang->compile->statusList['building'] = 'Building'; +$lang->compile->statusList['create_fail'] = 'Fail to create'; +$lang->compile->statusList['timeout'] = 'Exec Timeout'; diff --git a/module/compile/lang/en.php b/module/compile/lang/en.php index 31ff9891e5..d05829ecde 100644 --- a/module/compile/lang/en.php +++ b/module/compile/lang/en.php @@ -1,4 +1,5 @@ compile->common = 'Build'; $lang->compile->browse = 'Build History'; $lang->compile->logs = 'Build Log'; diff --git a/module/compile/lang/fr.php b/module/compile/lang/fr.php new file mode 100644 index 0000000000..69d5eeca79 --- /dev/null +++ b/module/compile/lang/fr.php @@ -0,0 +1,16 @@ +compile->common = 'Build'; +$lang->compile->browse = 'Build Histories'; +$lang->compile->logs = 'Build Logs'; + +$lang->compile->id = 'ID'; +$lang->compile->name = 'Name'; +$lang->compile->status = 'Build Status'; +$lang->compile->time = 'Build Time'; + +$lang->compile->statusList['success'] = 'Success'; +$lang->compile->statusList['failure'] = 'Fail'; +$lang->compile->statusList['created'] = 'Created'; +$lang->compile->statusList['building'] = 'Building'; +$lang->compile->statusList['create_fail'] = 'Fail to create'; +$lang->compile->statusList['timeout'] = 'Exec Timeout'; diff --git a/module/compile/lang/zh-cn.php b/module/compile/lang/zh-cn.php index 0dd8a3705f..28702a44b0 100644 --- a/module/compile/lang/zh-cn.php +++ b/module/compile/lang/zh-cn.php @@ -1,4 +1,5 @@ compile->common = '构建'; $lang->compile->browse = '构建历史'; $lang->compile->logs = '构建日志'; diff --git a/module/compile/lang/zh-tw.php b/module/compile/lang/zh-tw.php new file mode 100644 index 0000000000..8ea70422d2 --- /dev/null +++ b/module/compile/lang/zh-tw.php @@ -0,0 +1,16 @@ +compile->common = '構建'; +$lang->compile->browse = '構建歷史'; +$lang->compile->logs = '構建日誌'; + +$lang->compile->id = 'ID'; +$lang->compile->name = '構建名稱'; +$lang->compile->status = '構建狀態'; +$lang->compile->time = '構建時間'; + +$lang->compile->statusList['success'] = '成功'; +$lang->compile->statusList['failure'] = '失敗'; +$lang->compile->statusList['created'] = '新建'; +$lang->compile->statusList['building'] = '構建中'; +$lang->compile->statusList['create_fail'] = '創建失敗'; +$lang->compile->statusList['timeout'] = '執行超時'; diff --git a/module/git/model.php b/module/git/model.php index 37c616eb54..8159a23d28 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -95,7 +95,11 @@ class gitModel extends model $lastInDB = $this->repo->getLatestCommit($repoID); /* Ignore unsynced branch. */ - if(empty($lastInDB)) continue; + if(empty($lastInDB)) + { + $this->printLog("Please init repo {$repo->name}"); + continue; + } $commits = $repo->commits; $version = $lastInDB->commit; @@ -115,7 +119,7 @@ class gitModel extends model if($objects) { $this->printLog('extract' . - 'task:' . join(' ', $objects['tasks']) . + ' task:' . join(' ', $objects['tasks']) . ' bug:' . join(',', $objects['bugs'])); $this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git'); @@ -148,14 +152,22 @@ class gitModel extends model $jobs = zget($tagGroup, $repoID, array()); foreach($jobs as $job) { - $tags = $this->getRepoTags($repo); - end($tags); - $lastTag = current($tags); - if($lastTag != $job->lastTag) + $tags = $this->getRepoTags($repo); + $isNew = false; + $lastTag = ''; + foreach($tags as $tag) { + if($tag == $job->lastTag) + { + $isNew = true; + continue; + } + if(!$isNew) continue; + + $lastTag = $tag; $this->compile->createByJob($job->id, $lastTag, 'tag'); - $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec(); } + if($lastTag) $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec(); } } } diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index bb1039fe0d..297a977edd 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -693,6 +693,53 @@ $lang->resource->repo->delete = 'delete'; $lang->resource->repo->showSyncCommit = 'showSyncCommit'; $lang->resource->repo->diff = 'diffAction'; $lang->resource->repo->download = 'download'; +$lang->resource->repo->maintain = 'maintain'; +$lang->resource->repo->setRules = 'setRules'; + +$lang->repo->methodOrder[5] = 'create'; +$lang->repo->methodOrder[10] = 'edit'; +$lang->repo->methodOrder[15] = 'delete'; +$lang->repo->methodOrder[20] = 'showSyncCommit'; +$lang->repo->methodOrder[25] = 'maintain'; +$lang->repo->methodOrder[30] = 'browse'; +$lang->repo->methodOrder[35] = 'view'; +$lang->repo->methodOrder[40] = 'diff'; +$lang->repo->methodOrder[45] = 'log'; +$lang->repo->methodOrder[50] = 'revision'; +$lang->repo->methodOrder[55] = 'blame'; +$lang->repo->methodOrder[60] = 'download'; +$lang->repo->methodOrder[65] = 'setRules'; + +$lang->resource->compile = new stdclass(); +$lang->resource->compile->browse = 'browse'; +$lang->resource->compile->logs = 'logs'; + +$lang->compile->methodOrder[5] = 'browse'; +$lang->compile->methodOrder[10] = 'logs'; + +$lang->resource->jenkins = new stdclass(); +$lang->resource->jenkins->browse = 'browse'; +$lang->resource->jenkins->create = 'create'; +$lang->resource->jenkins->edit = 'edit'; +$lang->resource->jenkins->delete = 'delete'; + +$lang->jenkins->methodOrder[5] = 'browse'; +$lang->jenkins->methodOrder[10] = 'create'; +$lang->jenkins->methodOrder[15] = 'edit'; +$lang->jenkins->methodOrder[20] = 'delete'; + +$lang->resource->job = new stdclass(); +$lang->resource->job->browse = 'browse'; +$lang->resource->job->create = 'create'; +$lang->resource->job->edit = 'edit'; +$lang->resource->job->delete = 'delete'; +$lang->resource->job->exec = 'exec'; + +$lang->job->methodOrder[5] = 'browse'; +$lang->job->methodOrder[10] = 'create'; +$lang->job->methodOrder[15] = 'edit'; +$lang->job->methodOrder[20] = 'delete'; +$lang->job->methodOrder[25] = 'exec'; /* Doc. */ $lang->resource->doc = new stdclass(); diff --git a/module/install/lang/de.php b/module/install/lang/de.php index b8b7a28096..14401d0cda 100644 --- a/module/install/lang/de.php +++ b/module/install/lang/de.php @@ -165,6 +165,9 @@ $lang->install->cronList['moduleName=mail&methodName=asyncSend'] = 'Async N $lang->install->cronList['moduleName=webhook&methodName=asyncSend'] = 'Async Webhook Sendung'; $lang->install->cronList['moduleName=admin&methodName=deleteLog'] = 'Überfällige Logs löschen'; $lang->install->cronList['moduleName=todo&methodName=createCycle'] = 'Erstelle wiederkehrende ToDos'; +$lang->install->cronList['moduleName=ci&methodName=initQueue'] = 'Create recurring jenkins'; +$lang->install->cronList['moduleName=ci&methodName=checkBuildStatus'] = 'Synchronize Jenkins Status'; +$lang->install->cronList['moduleName=ci&methodName=exec'] = 'Execute Jenkins'; $lang->install->success = "Installiert!"; $lang->install->login = 'Login ZenTao'; diff --git a/module/install/lang/fr.php b/module/install/lang/fr.php index 3ddb3f3a48..ebef4ac5d1 100644 --- a/module/install/lang/fr.php +++ b/module/install/lang/fr.php @@ -165,6 +165,9 @@ $lang->install->cronList['moduleName=mail&methodName=asyncSend'] = 'Désync $lang->install->cronList['moduleName=webhook&methodName=asyncSend'] = 'Désynchroniser envoi Webhooks'; $lang->install->cronList['moduleName=admin&methodName=deleteLog'] = 'Suppression Logs échus'; $lang->install->cronList['moduleName=todo&methodName=createCycle'] = 'Créer tâches récurrentes'; +$lang->install->cronList['moduleName=ci&methodName=initQueue'] = 'Create recurring jenkins'; +$lang->install->cronList['moduleName=ci&methodName=checkBuildStatus'] = 'Synchronize Jenkins Status'; +$lang->install->cronList['moduleName=ci&methodName=exec'] = 'Execute Jenkins'; $lang->install->success = "Installé !"; $lang->install->login = 'Login ZenTao'; diff --git a/module/install/lang/zh-tw.php b/module/install/lang/zh-tw.php index 130a33090c..30eb7973b7 100644 --- a/module/install/lang/zh-tw.php +++ b/module/install/lang/zh-tw.php @@ -165,6 +165,9 @@ $lang->install->cronList['moduleName=mail&methodName=asyncSend'] = '非同 $lang->install->cronList['moduleName=webhook&methodName=asyncSend'] = '非同步發送Webhook'; $lang->install->cronList['moduleName=admin&methodName=deleteLog'] = '刪除過期日誌'; $lang->install->cronList['moduleName=todo&methodName=createCycle'] = '生成周期性待辦'; +$lang->install->cronList['moduleName=ci&methodName=initQueue'] = '創建周期性任務'; +$lang->install->cronList['moduleName=ci&methodName=checkBuildStatus'] = '同步Jenkins任務狀態'; +$lang->install->cronList['moduleName=ci&methodName=exec'] = '執行Jenkins任務'; $lang->install->success = "安裝成功"; $lang->install->login = '登錄禪道管理系統'; diff --git a/module/jenkins/config.php b/module/jenkins/config.php index 47c1f211d4..874d71aea1 100644 --- a/module/jenkins/config.php +++ b/module/jenkins/config.php @@ -1,5 +1,5 @@ jenkins->create = new stdclass(); $config->jenkins->edit = new stdclass(); -$config->jenkins->create->requiredFields = 'name,url,credentials'; -$config->jenkins->edit->requiredFields = 'name,url,credentials'; +$config->jenkins->create->requiredFields = 'name,url'; +$config->jenkins->edit->requiredFields = 'name,url'; diff --git a/module/jenkins/lang/de.php b/module/jenkins/lang/de.php new file mode 100644 index 0000000000..4e2c99ff52 --- /dev/null +++ b/module/jenkins/lang/de.php @@ -0,0 +1,19 @@ +jenkins->common = 'Jenkins'; +$lang->jenkins->browse = 'Browse Jenkins'; +$lang->jenkins->create = 'Create Jenkins'; +$lang->jenkins->edit = 'Edit Jenkins'; +$lang->jenkins->delete = 'Delete'; +$lang->jenkins->confirmDelete = 'Do you want to delete this Jenkins server?'; + +$lang->jenkins->id = 'ID'; +$lang->jenkins->name = 'Name'; +$lang->jenkins->url = 'Service URL'; +$lang->jenkins->token = 'Token'; +$lang->jenkins->account = 'UserName'; +$lang->jenkins->password = 'Password'; + +$lang->jenkins->lblCreate = 'Create Jenkins Server'; +$lang->jenkins->desc = 'Description'; +$lang->jenkins->tokenFirst = 'Use token if not empty.'; +$lang->jenkins->tips = 'Cancel "Prevent Cross Site Request Forgery exploits" when using password.'; diff --git a/module/jenkins/lang/fr.php b/module/jenkins/lang/fr.php new file mode 100644 index 0000000000..4e2c99ff52 --- /dev/null +++ b/module/jenkins/lang/fr.php @@ -0,0 +1,19 @@ +jenkins->common = 'Jenkins'; +$lang->jenkins->browse = 'Browse Jenkins'; +$lang->jenkins->create = 'Create Jenkins'; +$lang->jenkins->edit = 'Edit Jenkins'; +$lang->jenkins->delete = 'Delete'; +$lang->jenkins->confirmDelete = 'Do you want to delete this Jenkins server?'; + +$lang->jenkins->id = 'ID'; +$lang->jenkins->name = 'Name'; +$lang->jenkins->url = 'Service URL'; +$lang->jenkins->token = 'Token'; +$lang->jenkins->account = 'UserName'; +$lang->jenkins->password = 'Password'; + +$lang->jenkins->lblCreate = 'Create Jenkins Server'; +$lang->jenkins->desc = 'Description'; +$lang->jenkins->tokenFirst = 'Use token if not empty.'; +$lang->jenkins->tips = 'Cancel "Prevent Cross Site Request Forgery exploits" when using password.'; diff --git a/module/jenkins/lang/zh-tw.php b/module/jenkins/lang/zh-tw.php new file mode 100644 index 0000000000..c86afeb8c8 --- /dev/null +++ b/module/jenkins/lang/zh-tw.php @@ -0,0 +1,19 @@ +jenkins->common = 'Jenkins'; +$lang->jenkins->browse = '瀏覽Jenkins'; +$lang->jenkins->create = '添加Jenkins'; +$lang->jenkins->edit = '編輯Jenkins'; +$lang->jenkins->delete = '刪除'; +$lang->jenkins->confirmDelete = '確認刪除該Jenkins嗎?'; + +$lang->jenkins->id = 'ID'; +$lang->jenkins->name = '名稱'; +$lang->jenkins->url = '服務地址'; +$lang->jenkins->token = 'Token'; +$lang->jenkins->account = '用戶名'; +$lang->jenkins->password = '密碼'; + +$lang->jenkins->lblCreate = '添加Jenkins伺服器'; +$lang->jenkins->desc = '描述'; +$lang->jenkins->tokenFirst = 'Token不為空時,優先使用Token。'; +$lang->jenkins->tips = '使用密碼時,請在Jenkins全局安全設置中禁用"防止跨站點請求偽造"選項。'; diff --git a/module/job/css/create.css b/module/job/css/create.css index fb133566f6..d0fd86e9f7 100644 --- a/module/job/css/create.css +++ b/module/job/css/create.css @@ -4,4 +4,4 @@ .checkbox-primary.checkbox-inline label{padding-left:5px !important;} #jkHost_chosen .chosen-single{border-right:0px;} #jkJobBox{width:385px;} -#svnDirBox .input-group .chosen-single{min-width:200px;} +#svnDirBox .input-group{width:unset !important} diff --git a/module/job/css/edit.css b/module/job/css/edit.css index b1790c3e28..18378d434c 100644 --- a/module/job/css/edit.css +++ b/module/job/css/edit.css @@ -4,4 +4,4 @@ .checkbox-primary.checkbox-inline label{padding-left:5px !important;} #jkHost_chosen .chosen-single{border-right:0px;} #jkJobBox{width:385px;} -#svnDirBox .input-group .chosen-single{min-width:200px;} +#svnDirBox .input-group{width:unset !important} diff --git a/module/job/js/create.js b/module/job/js/create.js index 1ccf2640e6..79b2634818 100644 --- a/module/job/js/create.js +++ b/module/job/js/create.js @@ -29,7 +29,7 @@ $('#repo').change(function() } }) -$(document).on('change', '#svnDir', function() +$(document).on('change', '[name^=svnDir]', function() { var repoID = $('#repo').val(); var selectedTag = $(this).val(); @@ -61,6 +61,7 @@ $(document).on('change', '#svnDir', function() $('#svnDirBox .loading').remove(); $('#svnDirBox .input-group').append(html); $('#svnDirBox #svnDir' + length).chosen(); + $('#svnDir' + length + '_chosen .chosen-single').css('border-left', '0px'); }) }) diff --git a/module/job/js/edit.js b/module/job/js/edit.js index 2b1c803c09..39eb2c1558 100644 --- a/module/job/js/edit.js +++ b/module/job/js/edit.js @@ -29,7 +29,7 @@ $('#repo').change(function() } }) -$(document).on('change', '#svnDir', function() +$(document).on('change', '[name^=svnDir]', function() { var repoID = $('#repo').val(); var selectedTag = $(this).val(); @@ -61,6 +61,7 @@ $(document).on('change', '#svnDir', function() $('#svnDirBox .loading').remove(); $('#svnDirBox .input-group').append(html); $('#svnDirBox #svnDir' + length).chosen(); + $('#svnDirBox #svnDir' + length + '_chosen .chosen-single').css('border-left', '0px'); }) }) diff --git a/module/job/lang/de.php b/module/job/lang/de.php new file mode 100644 index 0000000000..a37fc4a4a9 --- /dev/null +++ b/module/job/lang/de.php @@ -0,0 +1,38 @@ +job->common = 'Job'; +$lang->job->browse = 'Browse Job'; +$lang->job->create = 'Create Job'; +$lang->job->edit = 'Edit Job'; +$lang->job->exec = 'Execute Job'; +$lang->job->delete = 'Delete Job'; +$lang->job->confirmDelete = 'Do you want to delete this job?'; +$lang->job->dirChange = 'Directory Changed'; +$lang->job->buildTag = 'Build Tag'; + +$lang->job->id = 'ID'; +$lang->job->name = 'Name'; +$lang->job->repo = 'Repo'; +$lang->job->svnDir = 'SVN Tag Watch Path'; +$lang->job->jenkins = 'Jenkins'; +$lang->job->jkHost = 'Jenkins Server'; +$lang->job->buildType = 'Build Type'; +$lang->job->jkJob = 'Jenkins Task'; +$lang->job->triggerType = 'Trigger'; +$lang->job->atDay = 'Custom Days'; +$lang->job->atTime = 'At Time'; +$lang->job->lastStatus = 'Last Status'; +$lang->job->lastExec = 'Last Executed'; +$lang->job->comment = 'Match Keywords'; + +$lang->job->example = 'e.g.'; +$lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','"; +$lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.'; +$lang->job->sendExec = 'Send execute request success.'; + +$lang->job->buildTypeList['build'] = 'Only Build'; +$lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy'; +$lang->job->buildTypeList['buildAndTest'] = 'Build And Test'; + +$lang->job->triggerTypeList['tag'] = 'Tag'; +$lang->job->triggerTypeList['commit'] = 'Code Commit'; +$lang->job->triggerTypeList['schedule'] = 'Schedule'; diff --git a/module/job/lang/fr.php b/module/job/lang/fr.php new file mode 100644 index 0000000000..a37fc4a4a9 --- /dev/null +++ b/module/job/lang/fr.php @@ -0,0 +1,38 @@ +job->common = 'Job'; +$lang->job->browse = 'Browse Job'; +$lang->job->create = 'Create Job'; +$lang->job->edit = 'Edit Job'; +$lang->job->exec = 'Execute Job'; +$lang->job->delete = 'Delete Job'; +$lang->job->confirmDelete = 'Do you want to delete this job?'; +$lang->job->dirChange = 'Directory Changed'; +$lang->job->buildTag = 'Build Tag'; + +$lang->job->id = 'ID'; +$lang->job->name = 'Name'; +$lang->job->repo = 'Repo'; +$lang->job->svnDir = 'SVN Tag Watch Path'; +$lang->job->jenkins = 'Jenkins'; +$lang->job->jkHost = 'Jenkins Server'; +$lang->job->buildType = 'Build Type'; +$lang->job->jkJob = 'Jenkins Task'; +$lang->job->triggerType = 'Trigger'; +$lang->job->atDay = 'Custom Days'; +$lang->job->atTime = 'At Time'; +$lang->job->lastStatus = 'Last Status'; +$lang->job->lastExec = 'Last Executed'; +$lang->job->comment = 'Match Keywords'; + +$lang->job->example = 'e.g.'; +$lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','"; +$lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.'; +$lang->job->sendExec = 'Send execute request success.'; + +$lang->job->buildTypeList['build'] = 'Only Build'; +$lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy'; +$lang->job->buildTypeList['buildAndTest'] = 'Build And Test'; + +$lang->job->triggerTypeList['tag'] = 'Tag'; +$lang->job->triggerTypeList['commit'] = 'Code Commit'; +$lang->job->triggerTypeList['schedule'] = 'Schedule'; diff --git a/module/job/lang/zh-tw.php b/module/job/lang/zh-tw.php new file mode 100644 index 0000000000..264dc48340 --- /dev/null +++ b/module/job/lang/zh-tw.php @@ -0,0 +1,38 @@ +job->common = '構建任務'; +$lang->job->browse = '瀏覽構建任務'; +$lang->job->create = '創建構建任務'; +$lang->job->edit = '編輯構建任務'; +$lang->job->exec = '執行構建'; +$lang->job->delete = '刪除構建任務'; +$lang->job->confirmDelete = '確認刪除該構建任務'; +$lang->job->dirChange = '目錄改動'; +$lang->job->buildTag = '打標籤'; + +$lang->job->id = 'ID'; +$lang->job->name = '名稱'; +$lang->job->repo = '代碼庫'; +$lang->job->svnDir = 'SVN監控路徑'; +$lang->job->jenkins = 'Jenkins'; +$lang->job->jkHost = 'Jenkins伺服器'; +$lang->job->buildType = '構建類型'; +$lang->job->jkJob = 'Jenkins任務'; +$lang->job->triggerType = '觸發方式'; +$lang->job->atDay = '自定義日期'; +$lang->job->atTime = '執行時間'; +$lang->job->lastStatus = '最後執行狀態'; +$lang->job->lastExec = '最後執行時間'; +$lang->job->comment = '匹配關鍵字'; + +$lang->job->example = '舉例'; +$lang->job->commitEx = "用於匹配創建構建任務的關鍵字,多個關鍵字用','分割"; +$lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每個工作日凌晨2點'; +$lang->job->sendExec = '發送執行請求成功!執行結果:%s'; + +$lang->job->buildTypeList['build'] = '僅構建'; +$lang->job->buildTypeList['buildAndDeploy'] = '構建部署'; +$lang->job->buildTypeList['buildAndTest'] = '構建測試'; + +$lang->job->triggerTypeList['tag'] = '打標籤'; +$lang->job->triggerTypeList['commit'] = '提交註釋包含關鍵字'; +$lang->job->triggerTypeList['schedule'] = '定時計劃'; diff --git a/module/job/model.php b/module/job/model.php index 05dcfa5c7d..ca196652f5 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -113,25 +113,7 @@ class jobModel extends model ->exec(); $id = $this->dao->lastInsertId(); - if($job->triggerType == 'schedule' and strpos($job->atDay, date('w')) !== false) $this->loadModel('compile')->createByJob($id); - if($job->triggerType == 'tag') - { - $repo = $this->loadModel('repo')->getRepoByID($job->repo); - $lastTag = ''; - if($this->post->repoType != 'Subversion') - { - $dirs = $this->loadModel('svn')->getRepoTags($repo, $job->svnDir); - end($dirs); - $lastTag = current($dirs); - } - else - { - $tags = $this->loadModel('git')->getRepoTags($repo); - end($tags); - $lastTag = current($tags); - } - $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($id)->exec(); - } + $this->initJob($id, $job, $this->post->repoType); return true; } @@ -144,8 +126,7 @@ class jobModel extends model */ public function update($id) { - $oldJob = $this->getById($id); - $job = fixer::input('post') + $job = fixer::input('post') ->setDefault('atDay', '') ->setIF($this->post->repoType != 'Subversion', 'svnDir', '') ->setIF($this->post->triggerType != 'commit', 'comment', '') @@ -174,35 +155,51 @@ class jobModel extends model ->where('id')->eq($id) ->exec(); - if($job->triggerType == 'schedule') + $this->initJob($id, $job, $this->post->repoType); + return true; + } + + /** + * Init when create or update job. + * + * @param int $id + * @param object $job + * @param string $repoType + * @access public + * @return bool + */ + public function initJob($id, $job, $repoType) + { + if($job->triggerType == 'schedule' and strpos($job->atDay, date('w')) !== false) { - $week = date('w'); - if($job->triggerType != $oldJob->triggerType or strpos($oldJob->atDay, $week) === false) + $compiles = $this->dao->select('*')->from(TABLE_COMPILE)->where('job')->eq($id)->andWhere('LEFT(createdDate, 10)')->eq(date('Y-m-d'))->fetchAll(); + foreach($compiles as $compile) { - if(strpos($job->atDay, $week) !== false) $this->loadModel('compile')->createByJob($job->id); + if(!empty($compile->status)) return true; + $this->dao->delete()->from(TABLE_COMPILE)->where('id')->eq($compile->id)->exec(); } + $this->loadModel('compile')->createByJob($id); } - elseif($job->triggerType == 'tag') + + if($job->triggerType == 'tag') { - if($job->triggerType != $oldJob->triggerType or $job->repo != $oldJob->repo) + $repo = $this->loadModel('repo')->getRepoByID($job->repo); + $lastTag = ''; + if($repoType == 'Subversion') { - $repo = $this->loadModel('repo')->getRepoByID($job->repo); - $lastTag = ''; - if($this->post->repoType == 'Subversion') - { - $dirs = $this->loadModel('svn')->getRepoTags($repo, $job->svnDir); - end($dirs); - $lastTag = current($dirs); - } - else - { - $tags = $this->loadModel('git')->getRepoTags($repo); - end($tags); - $lastTag = current($tags); - } - $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($id)->exec(); + $dirs = $this->loadModel('svn')->getRepoTags($repo, $job->svnDir); + end($dirs); + $lastTag = current($dirs); } + else + { + $tags = $this->loadModel('git')->getRepoTags($repo); + end($tags); + $lastTag = current($tags); + } + $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($id)->exec(); } + return true; } diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index d36b50d71e..2aa21c8149 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -41,7 +41,7 @@ job->svnDir;?> - +
''), '', "class='form-control chosen'");?>
diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 984e267d04..f414e768d3 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -44,12 +44,11 @@ job->svnDir;?> - +
svnDir) { - $job->svnDir = '/zentaoext'; $path = ''; $svnDirs = empty(trim($job->svnDir, '/')) ? '' : $job->svnDir; $svnDirs = explode('/', $svnDirs); diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php index 9e561ad2a8..d56bd68518 100644 --- a/module/misc/lang/de.php +++ b/module/misc/lang/de.php @@ -85,6 +85,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Letzte Version'; $lang->misc->feature->detailed = 'Details'; +$lang->misc->releaseDate['12.1'] = '2020-03-10'; $lang->misc->releaseDate['12.0.1'] = '2020-02-12'; $lang->misc->releaseDate['12.0'] = '2020-01-03'; $lang->misc->releaseDate['11.7'] = '2019-11-28'; @@ -123,6 +124,7 @@ $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.1'][] = array('title'=>'Add Integration.', 'desc' => '

Add integration, and build in Jenkins

'); $lang->misc->feature->all['12.0.1'][] = array('title'=>'Fix Bug.', 'desc' => ''); $lang->misc->feature->all['12.0'][] = array('title'=>'Move repo function to zentao', 'desc' => ''); diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index e4d558f0b4..c41b638c92 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -85,6 +85,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Latest Version'; $lang->misc->feature->detailed = 'Detail'; +$lang->misc->releaseDate['12.1'] = '2020-03-10'; $lang->misc->releaseDate['12.0.1'] = '2020-02-12'; $lang->misc->releaseDate['12.0'] = '2020-01-03'; $lang->misc->releaseDate['11.7'] = '2019-11-28'; @@ -123,6 +124,7 @@ $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.1'][] = array('title'=>'Add Integration.', 'desc' => '

Add integration, and build in Jenkins

'); $lang->misc->feature->all['12.0.1'][] = array('title'=>'Fix Bug.', 'desc' => ''); $lang->misc->feature->all['12.0'][] = array('title'=>'Move repo function to zentao', 'desc' => ''); diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php index 22f1ab8094..a6ae3e607d 100644 --- a/module/misc/lang/fr.php +++ b/module/misc/lang/fr.php @@ -85,6 +85,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = 'Dernière Version'; $lang->misc->feature->detailed = 'Détail'; +$lang->misc->releaseDate['12.1'] = '2020-03-10'; $lang->misc->releaseDate['12.0.1'] = '2020-02-12'; $lang->misc->releaseDate['12.0'] = '2020-01-03'; $lang->misc->releaseDate['11.7'] = '2019-11-28'; @@ -123,6 +124,7 @@ $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.1'][] = array('title'=>'Add Integration.', 'desc' => '

Add integration, and build in Jenkins

'); $lang->misc->feature->all['12.0.1'][] = array('title'=>'Fix Bug.', 'desc' => ''); $lang->misc->feature->all['12.0'][] = array('title'=>'Move repo function to zentao', 'desc' => ''); diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 59007893c6..38cb470646 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -85,6 +85,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = '最新版本'; $lang->misc->feature->detailed = '详情'; +$lang->misc->releaseDate['12.1'] = '2020-03-10'; $lang->misc->releaseDate['12.0.1'] = '2020-02-12'; $lang->misc->releaseDate['12.0'] = '2020-01-03'; $lang->misc->releaseDate['11.7'] = '2019-11-28'; @@ -123,6 +124,7 @@ $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.1'][] = array('title'=>'增加构建功能', 'desc' => '

增加构建功能,集成Jenkins进行构建

'); $lang->misc->feature->all['12.0.1'][] = array('title'=>'修复Bug', 'desc' => ''); $lang->misc->feature->all['12.0'][] = array('title'=>'将代码功能版本浏览功能转移到开源版', 'desc' => ''); diff --git a/module/misc/lang/zh-tw.php b/module/misc/lang/zh-tw.php index 9370e84176..ea2e32a50e 100644 --- a/module/misc/lang/zh-tw.php +++ b/module/misc/lang/zh-tw.php @@ -85,6 +85,7 @@ $lang->misc->feature = new stdclass(); $lang->misc->feature->lastest = '最新版本'; $lang->misc->feature->detailed = '詳情'; +$lang->misc->releaseDate['12.1'] = '2020-03-10'; $lang->misc->releaseDate['12.0.1'] = '2020-02-12'; $lang->misc->releaseDate['12.0'] = '2020-01-03'; $lang->misc->releaseDate['11.7'] = '2019-11-28'; @@ -123,6 +124,7 @@ $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.1'][] = array('title'=>'增加構建功能', 'desc' => '

增加構建功能,整合Jenkins進行構建

'); $lang->misc->feature->all['12.0.1'][] = array('title'=>'修復Bug', 'desc' => ''); $lang->misc->feature->all['12.0'][] = array('title'=>'將代碼功能版本瀏覽功能轉移到開源版', 'desc' => ''); diff --git a/module/my/control.php b/module/my/control.php index b080304914..149c05d751 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -120,6 +120,44 @@ class my extends control $this->display(); } + /** + * My requirement. + + * @param string $type + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function requirement($type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* Save session. */ + if($this->app->viewType != 'json') $this->session->set('storyList', $this->app->getURI(true)); + + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + if($this->app->getViewType() == 'mhtml') $recPerPage = 10; + $pager = pager::init($recTotal, $recPerPage, $pageID); + + /* Append id for secend sort. */ + $sort = $this->loadModel('common')->appendOrder($orderBy); + + /* Assign. */ + $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story; + $this->view->position[] = $this->lang->my->story; + $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + $this->view->users = $this->user->getPairs('noletter'); + $this->view->type = $type; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + + $this->display(); + } + /** * My stories diff --git a/module/my/lang/en.php b/module/my/lang/en.php index b39bd48cec..c5a6defba5 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -10,6 +10,7 @@ $lang->my->bug = 'My Bugs'; $lang->my->testTask = 'My Builds'; $lang->my->testCase = 'My Cases'; $lang->my->story = 'My Stories'; +$lang->my->requirement = 'My Requirements'; $lang->my->myProject = "My {$lang->projectCommon}s"; $lang->my->profile = 'My Profile'; $lang->my->dynamic = 'My Dynamics'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 5532f35926..2c7915a1cb 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -10,6 +10,7 @@ $lang->my->bug = '我的Bug'; $lang->my->testTask = '我的版本'; $lang->my->testCase = '我的用例'; $lang->my->story = "我的{$lang->storyCommon}"; +$lang->my->requirement = "我的用户{$lang->storyCommon}"; $lang->my->myProject = "我的{$lang->projectCommon}"; $lang->my->profile = '我的档案'; $lang->my->dynamic = '我的动态'; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 9874911c92..2682729060 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -72,7 +72,7 @@ product->searchStory;?>
- +
+ repo->manHourRule;?> +
+ task->common . $space . $lang->task->logEfforts;?> + repo->rules['task']['logEfforts'], "class='form-control'");?> +
task->consumed?> repo->rules['task']['consumed'], "class='form-control'");?> @@ -75,24 +80,18 @@ repo->ruleUnit?> repo->rules['unit']['left'], "class='form-control'");?>
-
- bug->resolvedBuild?> - repo->rules['bug']['resolvedBuild'], "class='form-control'");?> - repo->mark?> - repo->rules['mark']['resolvedBuild'], "class='form-control'");?> -
- repo->ruleSplit;?> + repo->ruleSplit;?> repo->rules->exampleLabel;?> - + - + diff --git a/module/story/control.php b/module/story/control.php index 6d127ddf60..2bb81f7953 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1432,7 +1432,7 @@ class story extends control * @access public * @return void */ - public function report($productID, $browseType, $branchID, $moduleID, $chartType = 'pie') + public function report($productID, $browseType, $branchID, $moduleID, $chartType = 'pie', $storyType = 'story') { $this->loadModel('report'); $this->view->charts = array(); @@ -1460,6 +1460,7 @@ class story extends control $this->view->productID = $productID; $this->view->branchID = $branchID; $this->view->browseType = $browseType; + $this->view->storyType = $storyType; $this->view->moduleID = $moduleID; $this->view->chartType = $chartType; $this->view->checkedCharts = $this->post->charts ? join(',', $this->post->charts) : ''; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 1fdf3d4af3..ba6d054ad2 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -24,6 +24,7 @@ $lang->story->edit = "Edit Story"; $lang->story->batchEdit = "Batch Edit"; $lang->story->subdivide = 'Decompose'; $lang->story->subdivideAction = 'Decompose Story'; +$lang->story->splitRequirent = 'Decompose'; $lang->story->close = 'Close'; $lang->story->closeAction = 'Close Story'; $lang->story->batchClose = 'Batch Close'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 9a213896a2..b4286f9271 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -24,6 +24,7 @@ $lang->story->edit = "编辑"; $lang->story->batchEdit = "批量编辑"; $lang->story->subdivide = '细分'; $lang->story->subdivideAction = "细分{$lang->storyCommon}"; +$lang->story->splitRequirent = '拆分'; $lang->story->close = '关闭'; $lang->story->closeAction = "关闭{$lang->storyCommon}"; $lang->story->batchClose = '批量关闭'; diff --git a/module/story/model.php b/module/story/model.php index 4f621c4953..135d0b17fb 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -840,7 +840,7 @@ class storyModel extends model ->batchCheck($this->config->story->close->requiredFields, 'notempty') ->where('id')->eq($storyID)->exec(); $changes = common::createChanges($oldStory, $newStory); - $actionID = $this->action->create('story', $storyID, 'Closed', '', 'Subdivided'); + $actionID = $this->loadModel('action')->create('story', $storyID, 'Closed', '', 'Subdivided'); $this->action->logHistory($actionID, $changes); return $actionID; diff --git a/module/story/view/batchcreate.html.php b/module/story/view/batchcreate.html.php index 8875232d60..f3955135f8 100644 --- a/module/story/view/batchcreate.html.php +++ b/module/story/view/batchcreate.html.php @@ -134,5 +134,6 @@ $(function() }); }); + diff --git a/module/story/view/change.html.php b/module/story/view/change.html.php index 43c0000a9b..23a02d6a2a 100644 --- a/module/story/view/change.html.php +++ b/module/story/view/change.html.php @@ -88,4 +88,5 @@ spec);?> verify);?> +type);?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 80c54e50cd..5746476a64 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -216,4 +216,5 @@
story->module);?> + diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 28ab2624f5..9812e04ba4 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -278,4 +278,5 @@ +type);?> diff --git a/module/story/view/report.html.php b/module/story/view/report.html.php index 5ff6b7e69c..2e4cdcb8f0 100644 --- a/module/story/view/report.html.php +++ b/module/story/view/report.html.php @@ -86,4 +86,5 @@ + diff --git a/module/story/view/review.html.php b/module/story/view/review.html.php index d0e5ae6a87..6aae25cbe4 100644 --- a/module/story/view/review.html.php +++ b/module/story/view/review.html.php @@ -94,4 +94,5 @@ var assignedTo = 'lastEditedBy ? print($story->lastEditedBy) : pri id);?> +type);?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 0e26604693..9bec07fc79 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -74,9 +74,10 @@ common::printIcon('story', 'review', "storyID=$story->id", $story, 'button', '', '', 'showinonlybody'); if($story->status != 'closed' and !isonlybody()) { - $misc = "class='btn' data-toggle='modal' data-type='iframe' data-width='95%'"; - $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); - if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $lang->story->subdivide, '', $misc); + $divideLang = ($story->type == 'story' || !$story->type) ? $lang->story->subdivide : $lang->story->splitRequirent; + $misc = "class='btn divideStory' data-toggle='modal' data-type='iframe' data-width='95%'"; + $link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true); + if(common::hasPriv('story', 'batchCreate')) echo html::a($link, " " . $divideLang, '', $misc); } common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); @@ -108,7 +109,7 @@ echo "
"; common::printIcon('story', 'edit', "storyID=$story->id", $story); - common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", $story, 'button', 'copy', '', '', true, "data-width='1050'"); + common::printIcon('story', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id&projectID=0&bugID=0&planID=0&todoID=0&extra=&type=$story->type", $story, 'button', 'copy', '', '', true, "data-width='1050'"); common::printIcon('story', 'delete', "storyID=$story->id", $story, 'button', 'trash', 'hiddenwin'); ?> @@ -400,6 +401,7 @@ js::set('createStory', $lang->story->create); js::set('productID', $story->product); js::set('branch', $story->branch); js::set('moduleID', $story->module); +js::set('storyType', $story->type); ?> diff --git a/module/svn/model.php b/module/svn/model.php index cafd9ec7b8..8680dd5891 100644 --- a/module/svn/model.php +++ b/module/svn/model.php @@ -89,7 +89,11 @@ class svnModel extends model $this->printLog("get this repo logs."); $lastInDB = $this->repo->getLatestCommit($repoID); /* Ignore unsynced repo. */ - if(empty($lastInDB)) continue; + if(empty($lastInDB)) + { + $this->printLog("Please init repo {$repo->name}"); + continue; + } $version = $lastInDB->commit; $logs = $this->repo->getUnsyncCommits($repo); @@ -139,15 +143,23 @@ class svnModel extends model $jobs = zget($tagGroup, $repoID, array()); foreach($jobs as $job) { - $dirs = $this->getRepoTags($repo, $job->svnDir); - end($dirs); - $lastTag = current($dirs); - if($lastTag != $job->lastTag) + $dirs = $this->getRepoTags($repo, $job->svnDir); + $isNew = false; + $lastTag = ''; + foreach($dirs as $dir) { - $tag = rtrim($repo->path , '/') . '/' . trim($job->svnDir, '/') . '/' . $lastTag; + if($dir == $job->lastTag) + { + $isNew = true; + continue; + } + if(!$isNew) continue; + + $lastTag = $dir; + $tag = rtrim($repo->path , '/') . '/' . trim($job->svnDir, '/') . '/' . $lastTag; $this->compile->createByJob($job->id, $tag, 'tag'); - $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec(); } + if($lastTag) $this->dao->update(TABLE_JOB)->set('lastTag')->eq($lastTag)->where('id')->eq($job->id)->exec(); } } } @@ -258,40 +270,9 @@ class svnModel extends model */ public function getRepoTags($repo, $path) { - $parent = '/'; - if($repo->prefix) $parent = rtrim($repo->prefix, '/'); - if(trim($path, '/')) $parent = rtrim($repo->prefix, '/') . '/' . trim($path, '/'); - $stmt = $this->dao->select('t1.*,t2.revision as svnRevision,t2.time')->from(TABLE_REPOFILES)->alias('t1') - ->leftJoin(TABLE_REPOHISTORY)->alias('t2')->on('t1.revision = t2.id') - ->where('t1.repo')->eq($repo->id) - ->andWhere('t1.type')->eq('dir') - ->andWhere('t1.parent')->eq($parent) - ->orderBy('path,svnRevision,time') - ->query(); - - $dirs = array(); - while($row = $stmt->fetch()) - { - $path = $row->path; - if($repo->prefix) $path = str_replace($repo->prefix, '', $path); - if(empty($path)) $path = '/'; - - $dirs[$path] = $row; - if($row->action == 'D') unset($dirs[$path]); - } - - $dirTime = array(); - foreach($dirs as $dirPath => $dir) $dirTime[$dir->time][$dirPath] = $dirPath; - - ksort($dirTime); - $dirPairs = array(); - foreach($dirTime as $time => $dirPaths) - { - ksort($dirPaths); - foreach($dirPaths as $dirPath) $dirPairs[$dirPath] = basename($dirPath); - } - - return $dirPairs; + $scm = $this->app->loadClass('scm'); + $scm->setEngine($repo); + return $scm->tags($path); } /** diff --git a/module/upgrade/lang/version.php b/module/upgrade/lang/version.php index fc2725bc52..da901627d5 100644 --- a/module/upgrade/lang/version.php +++ b/module/upgrade/lang/version.php @@ -117,3 +117,4 @@ $lang->upgrade->fromVersions['11_6_4'] = '11.6.4'; $lang->upgrade->fromVersions['11_6_5'] = '11.6.5'; $lang->upgrade->fromVersions['11_7'] = '11.7'; $lang->upgrade->fromVersions['12_0'] = '12.0'; +$lang->upgrade->fromVersions['12_0_1'] = '12.0.1'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 3149e25337..132446b170 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -566,7 +566,7 @@ class upgradeModel extends model case '12_0_1': $this->saveLogs('Execute 12_0_1'); $this->execSQL($this->getUpgradeFile('12.0.1')); - $this->saveRepo(); + $this->importRepoFromConfig(); $this->appendExec('12_0_1'); } @@ -730,6 +730,7 @@ class upgradeModel extends model } case '11_7' : $confirmContent .= file_get_contents($this->getUpgradeFile('11.7')); case '12_0' : + case '12_0_1': $confirmContent .= file_get_contents($this->getUpgradeFile('12.0.1')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } @@ -3641,9 +3642,9 @@ class upgradeModel extends model * Save repo from svn and git config. * * @access public - * @return void + * @return bool */ - public function saveRepo() + public function importRepoFromConfig() { $this->app->loadConfig('svn'); if(isset($this->config->svn->repos)) @@ -3667,7 +3668,7 @@ class upgradeModel extends model $svnRepo->encrypt = 'base64'; $svnRepo->encoding = zget($repo, 'encoding', $this->config->svn->encoding); - $scm->setEngine($repo); + $scm->setEngine($svnRepo); $info = $scm->info(''); $svnRepo->prefix = empty($info->root) ? '' : trim(str_ireplace($info->root, '', str_replace('\\', '/', $svnRepo->path)), '/'); if($svnRepo->prefix) $svnRepo->prefix = '/' . $svnRepo->prefix; @@ -3701,6 +3702,7 @@ class upgradeModel extends model $this->dao->insert(TABLE_REPO)->data($gitRepo)->exec(); } } + return true; } /** diff --git a/module/webhook/lang/de.php b/module/webhook/lang/de.php index 4fd36c64a2..7d98136d5c 100644 --- a/module/webhook/lang/de.php +++ b/module/webhook/lang/de.php @@ -34,11 +34,12 @@ $lang->webhook->date = 'Datum'; $lang->webhook->data = 'Daten'; $lang->webhook->result = 'Ergebnis'; -$lang->webhook->typeList[''] = ''; -$lang->webhook->typeList['dingding'] = 'Dingding Robot'; -$lang->webhook->typeList['dingapi'] = 'Dingding Notifier'; -$lang->webhook->typeList['weixin'] = 'Enterprise WeChat'; -$lang->webhook->typeList['default'] = 'SDtandard'; +$lang->webhook->typeList[''] = ''; +$lang->webhook->typeList['dinggroup'] = 'Dingding Robot'; +$lang->webhook->typeList['dinguser'] = 'Dingding Notifier'; +$lang->webhook->typeList['wechatgroup'] = 'Enterprise WeChat Robot'; +$lang->webhook->typeList['wechatuser'] = 'Enterprise WeChat Notifier'; +$lang->webhook->typeList['default'] = 'Others'; $lang->webhook->sendTypeList['sync'] = 'Synchron'; $lang->webhook->sendTypeList['async'] = 'Asynchron'; @@ -46,9 +47,17 @@ $lang->webhook->sendTypeList['async'] = 'Asynchron'; $lang->webhook->dingAgentId = 'AgentID'; $lang->webhook->dingAppKey = 'AppKey'; $lang->webhook->dingAppSecret = 'AppSecret'; -$lang->webhook->dingUserid = 'UserID'; +$lang->webhook->dingUserid = 'Ding Userid'; $lang->webhook->dingBindStatus = 'Bind Status'; +$lang->webhook->wechatCorpId = 'Corp ID'; +$lang->webhook->wechatCorpSecret = 'Corp Secret'; +$lang->webhook->wechatAgentId = 'Agent ID'; +$lang->webhook->wechatUserid = 'Wechat Userid'; +$lang->webhook->wechatBindStatus = 'Bind Status'; + +$lang->webhook->zentaoUser = 'Zentao User'; + $lang->webhook->dingBindStatusList['0'] = 'No'; $lang->webhook->dingBindStatusList['1'] = 'Yes'; @@ -71,7 +80,9 @@ $lang->webhook->note->async = 'Wenn der Sendungstyp asynchron ist, wird Cron b $lang->webhook->note->bind = 'Bind User is only required for Dingding Notifier.'; $lang->webhook->note->product = "Alle Aktionen triggern den Hook wenn das {$lang->productCommon} leer ist, andernsfalls werden nur Aktionen des {$lang->productCommon} ausgelöst."; $lang->webhook->note->project = "Alle Aktionen triggern den Hook wenn das {$lang->projectCommon} leer ist, andernsfalls werden nur Aktionen des {$lang->projectCommon} ausgelöst."; -$lang->webhook->note->dingKey = " "; + +$lang->webhook->note->dingHelp = " "; +$lang->webhook->note->wechatHelp = " "; $lang->webhook->note->typeList['bearychat'] = 'Fügen Sie einen ZenTao bot in bearychat ein um die Adresse des Webhooks zu erhalten.'; $lang->webhook->note->typeList['dingding'] = 'Fügen Sie einen eigenen bot in dingding ein um die Adresse des Webhooks zu erhalten.'; diff --git a/module/webhook/lang/en.php b/module/webhook/lang/en.php index 4b7a328a95..966313a6e0 100644 --- a/module/webhook/lang/en.php +++ b/module/webhook/lang/en.php @@ -34,11 +34,12 @@ $lang->webhook->date = 'Sent'; $lang->webhook->data = 'Data'; $lang->webhook->result = 'Result'; -$lang->webhook->typeList[''] = ''; -$lang->webhook->typeList['dingding'] = 'Dingding Robot'; -$lang->webhook->typeList['dingapi'] = 'Dingding Notifier'; -$lang->webhook->typeList['weixin'] = 'Enterprise WeChat'; -$lang->webhook->typeList['default'] = 'Others'; +$lang->webhook->typeList[''] = ''; +$lang->webhook->typeList['dinggroup'] = 'Dingding Robot'; +$lang->webhook->typeList['dinguser'] = 'Dingding Notifier'; +$lang->webhook->typeList['wechatgroup'] = 'Enterprise WeChat Robot'; +$lang->webhook->typeList['wechatuser'] = 'Enterprise WeChat Notifier'; +$lang->webhook->typeList['default'] = 'Others'; $lang->webhook->sendTypeList['sync'] = 'Synchronous'; $lang->webhook->sendTypeList['async'] = 'Asynchronous'; @@ -46,9 +47,17 @@ $lang->webhook->sendTypeList['async'] = 'Asynchronous'; $lang->webhook->dingAgentId = 'AgentID'; $lang->webhook->dingAppKey = 'AppKey'; $lang->webhook->dingAppSecret = 'AppSecret'; -$lang->webhook->dingUserid = 'UserID'; +$lang->webhook->dingUserid = 'Ding UserID'; $lang->webhook->dingBindStatus = 'Bind Status'; +$lang->webhook->wechatCorpId = 'Corp ID'; +$lang->webhook->wechatCorpSecret = 'Corp Secret'; +$lang->webhook->wechatAgentId = 'Agent ID'; +$lang->webhook->wechatUserid = 'Wechat Userid'; +$lang->webhook->wechatBindStatus = 'Bind Status'; + +$lang->webhook->zentaoUser = 'Zentao User'; + $lang->webhook->dingBindStatusList['0'] = 'No'; $lang->webhook->dingBindStatusList['1'] = 'Yes'; @@ -71,7 +80,9 @@ $lang->webhook->note->async = 'If it is asynchronous, you have to go to Admin- $lang->webhook->note->bind = 'Bind User is only required for Dingding Notifier.'; $lang->webhook->note->product = "All actions will trigger the hook if {$lang->productCommon} is empty, or only actions of selected {$lang->productCommon} will trigger it."; $lang->webhook->note->project = "All actions will trigger the hook if {$lang->projectCommon} is empty, or only actions of selected {$lang->projectCommon} will trigger it."; -$lang->webhook->note->dingKey = " "; + +$lang->webhook->note->dingHelp = " "; +$lang->webhook->note->wechatHelp = " "; $lang->webhook->note->typeList['bearychat'] = 'Add a ZenTao bot in bearychat and get the webhook url.'; $lang->webhook->note->typeList['dingding'] = 'Add a customized bot in dingding and get the webhook url.'; diff --git a/module/webhook/lang/fr.php b/module/webhook/lang/fr.php index 63408a0dcb..39835177d0 100644 --- a/module/webhook/lang/fr.php +++ b/module/webhook/lang/fr.php @@ -34,11 +34,12 @@ $lang->webhook->date = 'Date envoi'; $lang->webhook->data = 'Donnée'; $lang->webhook->result = 'Résultat'; -$lang->webhook->typeList[''] = ''; -$lang->webhook->typeList['dingding'] = 'Dingding Robot'; -$lang->webhook->typeList['dingapi'] = 'Dingding Notifier'; -$lang->webhook->typeList['weixin'] = 'Enterprise WeChat'; -$lang->webhook->typeList['default'] = 'Autre'; +$lang->webhook->typeList[''] = ''; +$lang->webhook->typeList['dinggroup'] = 'Dingding Robot'; +$lang->webhook->typeList['dinguser'] = 'Dingding Notifier'; +$lang->webhook->typeList['wechatgroup'] = 'Enterprise WeChat Robot'; +$lang->webhook->typeList['wechatuser'] = 'Enterprise WeChat Notifier'; +$lang->webhook->typeList['default'] = 'Others'; $lang->webhook->sendTypeList['sync'] = 'Synchrone'; $lang->webhook->sendTypeList['async'] = 'Asynchrone'; @@ -46,9 +47,17 @@ $lang->webhook->sendTypeList['async'] = 'Asynchrone'; $lang->webhook->dingAgentId = 'AgentID'; $lang->webhook->dingAppKey = 'AppKey'; $lang->webhook->dingAppSecret = 'AppSecret'; -$lang->webhook->dingUserid = 'UserID'; +$lang->webhook->dingUserid = 'Ding Userid'; $lang->webhook->dingBindStatus = 'Bind Status'; +$lang->webhook->wechatCorpId = 'Corp ID'; +$lang->webhook->wechatCorpSecret = 'Corp Secret'; +$lang->webhook->wechatAgentId = 'Agent ID'; +$lang->webhook->wechatUserid = 'Wechat Userid'; +$lang->webhook->wechatBindStatus = 'Bind Status'; + +$lang->webhook->zentaoUser = 'Zentao User'; + $lang->webhook->dingBindStatusList['0'] = 'No'; $lang->webhook->dingBindStatusList['1'] = 'Yes'; @@ -71,7 +80,9 @@ $lang->webhook->note->async = "Si le type d'envoi est asynchrone, vous devez a $lang->webhook->note->bind = 'Bind User is only required for Dingding Notifier.'; $lang->webhook->note->product = "Toutes les actions vont déclencher le flux si {$lang->productCommon} est vide, ou seulement les actions du {$lang->productCommon} sélectionné vont le déclencher."; $lang->webhook->note->project = "Toutes les actions vont déclencher le flux si {$lang->projectCommon} est vide, ou seulement les actions du {$lang->projectCommon} sélectionné vont le déclencher."; -$lang->webhook->note->dingKey = " "; + +$lang->webhook->note->dingHelp = " "; +$lang->webhook->note->wechatHelp = " "; $lang->webhook->note->typeList['bearychat'] = "Ajout d'un bot a ZenTao dans bearychat et obtenez l'url du flux."; $lang->webhook->note->typeList['dingding'] = "Ajout d'un bot personnalisé dans dingding et obtenez l'url du flux."; diff --git a/module/webhook/lang/zh-tw.php b/module/webhook/lang/zh-tw.php index 67bdff12bd..1af36c7bce 100644 --- a/module/webhook/lang/zh-tw.php +++ b/module/webhook/lang/zh-tw.php @@ -76,7 +76,7 @@ $lang->webhook->confirmDelete = '您確認要刪除該webhook嗎?'; $lang->webhook->trimWords = '了'; $lang->webhook->note = new stdClass(); -$lang->webhook->note->async = '非同步需要打開計劃任務'; +$lang->webhook->note->async = '非同步需要打開計劃任務。'; $lang->webhook->note->bind = '只有[釘釘/微信]工作通知類型才需要綁定用戶。'; $lang->webhook->note->product = "此項為空時所有{$lang->productCommon}的動作都會觸發鈎子,否則只有關聯{$lang->productCommon}的動作才會觸發。"; $lang->webhook->note->project = "此項為空時所有{$lang->projectCommon}的動作都會觸發鈎子,否則只有關聯{$lang->projectCommon}的動作才會觸發。"; diff --git a/module/webhook/model.php b/module/webhook/model.php index 51368748e1..9f7f3eabe5 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -168,7 +168,7 @@ class webhookModel extends model $webhook->secret = json_encode($webhook->secret); $webhook->url = $this->config->webhook->dingapiUrl; } - elseif ($webhook->type == 'wechatuser') + elseif($webhook->type == 'wechatuser') { $webhook->secret = array(); $webhook->secret['agentId'] = $webhook->wechatAgentId; @@ -234,7 +234,7 @@ class webhookModel extends model $webhook->secret = json_encode($webhook->secret); } - elseif ($webhook->type == 'wechatuser') + elseif($webhook->type == 'wechatuser') { $webhook->secret = array(); $webhook->secret['agentId'] = $webhook->wechatAgentId; @@ -574,7 +574,7 @@ class webhookModel extends model $result = $dingapi->send($openIdList, $sendData); return json_encode($result); } - elseif ($webhook->type == 'wechatuser') + elseif($webhook->type == 'wechatuser') { $this->app->loadClass('wechatapi', true); $wechatapi = new wechatapi($webhook->secret->appKey, $webhook->secret->appSecret, $webhook->secret->agentId); @@ -645,8 +645,8 @@ class webhookModel extends model /** * Save log. * - * @param int $actionID * @param object $webhook + * @param int $actionID * @param string $data * @param string $result * @access public