diff --git a/Makefile b/Makefile index 8b25a6594f..f511627ccc 100644 --- a/Makefile +++ b/Makefile @@ -63,11 +63,13 @@ zentaoxx: cp -r xuanxuan/config/* zentaoxx/config/ cp -r xuanxuan/module/* zentaoxx/module/ cp -r xuanxuan/www/* zentaoxx/www/ + mv zentaoxx/www/xuanxuan.php zentaoxx/www/x.php sed -i 's/site,//' zentaoxx/module/chat/model.php sed -i 's/admin, g/g/' zentaoxx/module/chat/model.php sed -i '/password = md5/d' zentaoxx/module/chat/control.php sed -i '/getSignedTime/d' zentaoxx/module/chat/control.php sed -i 's/tree/dept/' zentaoxx/module/chat/control.php + sed -i 's/tree/dept/' zentaoxx/module/chat/model.php sed -i "s/, 'sys'//" zentaoxx/module/chat/control.php sed -i 's/system.sys/system/' zentaoxx/module/chat/control.php sed -i 's/&app=sys//' zentaoxx/module/chat/control.php @@ -77,6 +79,8 @@ zentaoxx: sed -i 's/sys_user/zt_user/' zentaoxx/db/*.sql sed -i 's/sys_file/zt_file/' zentaoxx/db/*.sql sed -i '/sys_entry/d' zentaoxx/db/*.sql + mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php + rm -rf zentaopms/tools zip -rqm -9 zentaoxx.$(VERSION).zip zentaoxx/* rm -rf xuan.zip xuan zentaoxx package: @@ -90,7 +94,8 @@ package: if [ ! -d "zentaopms/config/ext" ]; then mkdir zentaopms/config/ext; fi for module in `ls zentaopms/module/`; do if [ ! -d "zentaopms/module/$$module/ext" ]; then mkdir zentaopms/module/$$module/ext; fi done find zentaopms/ -name ext |xargs chmod -R 777 - tools/cn2tw.php + mkdir zentaopms/tools; cp tools/cn2tw.php zentaopms/tools; cd zentaopms/tools; php cn2tw.php + rm -rf zentaopms/tools pms: make common make zentaoxx diff --git a/VERSION b/VERSION index 3ab8e9b749..257b829d27 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.1.stable +11.2.stable diff --git a/config/config.php b/config/config.php index cade32ee6b..487ba25ffd 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 = '11.1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->version = '11.2'; // 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/db/standard/zentao11.2.sql b/db/standard/zentao11.2.sql new file mode 100644 index 0000000000..d99f028edc --- /dev/null +++ b/db/standard/zentao11.2.sql @@ -0,0 +1,955 @@ +DROP TABLE IF EXISTS `zt_action`; +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; +DROP TABLE IF EXISTS `zt_block`; +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; +DROP TABLE IF EXISTS `zt_branch`; +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; +DROP TABLE IF EXISTS `zt_bug`; +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', + `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, + `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; +DROP TABLE IF EXISTS `zt_build`; +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; +DROP TABLE IF EXISTS `zt_burn`; +CREATE TABLE `zt_burn` ( + `project` mediumint(8) unsigned NOT NULL, + `date` date NOT NULL, + `estimate` float NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`project`,`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_case`; +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', + `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, + `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; +DROP TABLE IF EXISTS `zt_casestep`; +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; +DROP TABLE IF EXISTS `zt_company`; +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; +DROP TABLE IF EXISTS `zt_config`; +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; +DROP TABLE IF EXISTS `zt_cron`; +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; +DROP TABLE IF EXISTS `zt_dept`; +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` tinyint(3) 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; +DROP TABLE IF EXISTS `zt_doc`; +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; +DROP TABLE IF EXISTS `zt_doccontent`; +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; +DROP TABLE IF EXISTS `zt_doclib`; +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; +DROP TABLE IF EXISTS `zt_effort`; +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; +DROP TABLE IF EXISTS `zt_entry`; +CREATE TABLE `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, + `ip` varchar(100) 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; +DROP TABLE IF EXISTS `zt_extension`; +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; +DROP TABLE IF EXISTS `zt_file`; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(50) 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; +DROP TABLE IF EXISTS `zt_group`; +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; +DROP TABLE IF EXISTS `zt_grouppriv`; +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; +DROP TABLE IF EXISTS `zt_history`; +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; +DROP TABLE IF EXISTS `zt_lang`; +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; +DROP TABLE IF EXISTS `zt_log`; +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; +DROP TABLE IF EXISTS `zt_module`; +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; +DROP TABLE IF EXISTS `zt_notify`; +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; +DROP TABLE IF EXISTS `zt_product`; +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 '', + `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 `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_productplan`; +CREATE TABLE `zt_productplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `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; +DROP TABLE IF EXISTS `zt_project`; +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, + `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 `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_projectproduct`; +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; +DROP TABLE IF EXISTS `zt_projectstory`; +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; +DROP TABLE IF EXISTS `zt_release`; +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', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_score`; +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; +DROP TABLE IF EXISTS `zt_story`; +CREATE TABLE `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 '', + `color` char(7) NOT NULL, + `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released','closed') NOT NULL DEFAULT 'wait', + `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(9) 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; +DROP TABLE IF EXISTS `zt_storyspec`; +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; +DROP TABLE IF EXISTS `zt_storystage`; +CREATE TABLE `zt_storystage` ( + `story` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL, + `stage` varchar(50) NOT NULL, + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_suitecase`; +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; +DROP TABLE IF EXISTS `zt_task`; +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', + `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; +DROP TABLE IF EXISTS `zt_taskestimate`; +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; +DROP TABLE IF EXISTS `zt_team`; +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; +DROP TABLE IF EXISTS `zt_testreport`; +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; +DROP TABLE IF EXISTS `zt_testresult`; +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; +DROP TABLE IF EXISTS `zt_testrun`; +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; +DROP TABLE IF EXISTS `zt_testsuite`; +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; +DROP TABLE IF EXISTS `zt_testtask`; +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', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `zt_todo`; +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; +DROP TABLE IF EXISTS `zt_user`; +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 '', + `yahoo` char(90) NOT NULL DEFAULT '', + `gtalk` char(90) NOT NULL DEFAULT '', + `wangwang` char(90) NOT NULL DEFAULT '', + `mobile` char(11) NOT NULL DEFAULT '', + `phone` char(20) 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; +DROP TABLE IF EXISTS `zt_usercontact`; +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; +DROP TABLE IF EXISTS `zt_usergroup`; +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; +DROP TABLE IF EXISTS `zt_userquery`; +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; +DROP TABLE IF EXISTS `zt_usertpl`; +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; +DROP TABLE IF EXISTS `zt_userview`; +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; +DROP TABLE IF EXISTS `zt_webhook`; +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, + `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/zentao.sql b/db/zentao.sql index 95ef0d351b..cc2fadefda 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -533,7 +533,7 @@ CREATE TABLE IF NOT EXISTS `zt_release` ( `product` mediumint(8) unsigned NOT NULL default '0', `branch` mediumint(8) unsigned NOT NULL default '0', `build` mediumint(8) unsigned NOT NULL, - `name` char(30) NOT NULL default '', + `name` varchar(255) NOT NULL default '', `marker` enum('0','1') NOT NULL default '0', `date` date NOT NULL, `stories` text NOT NULL, diff --git a/doc/CHANGELOG b/doc/CHANGELOG index ff123d3647..ab3e0d6a5e 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,66 @@ +2019-01-29 11.2.stable +完成的需求 +3553 集成喧喧2.4版本,国际版企业版集成喧喧2.4,国内和国际的版本升级程序要区分处理 +3552 升级执行sql后需要进行数据库结构的检查 +3542 通过配置的方式定义各个对象的创建和编辑接口需要传入的参数 +3541 移除禅道里配置喧喧和下载xxd与xxd配置文件的相关代码,不同的地方通过扩展来处理 +3540 调整需求和任务,bug优先级的样式 +3537 增强用户录入操作的提示 +3531 dockerfile启动命令中增加修复目录权限的功能 +3530 在创建需求、bug时产品下拉菜单保持和导航里面一致 +3529 发布列表页面增加里程碑的显示 +3527 zbox启动的时候自动修复目录权限 +3526 内嵌禅道手册都是用https协议的 +3460 计划关联bug的时候将已经转为任务的也计算在内 +3060 增加升级日志功能 +修复的Bug +2008 文档收藏按钮无效 +2061 用户密码包含#时,配置单点登录提示密码错误 +2234 自定义用户职位后,项目团队中添加成员时角色不会带出自定义添加的职位 +2235 自定义已有用户职位,项目团队中添加成员时角色还是显示原来职位 +2246 edge浏览器下载附件的名称乱码 +2314 需求分组统计错误 +2334 大文件备份异常 +2347 新建用例查看需求页面无法返回 +2354 受限权限分组用户可以在列表对数据进行指派 +2355 编辑部门的负责人支持检索 +2359 没有备注权限在待办中还可以看到备注按钮 +2361 客户端创建需求提示错误 +2363 批量创建用例所属模块修改后不能选择相应模块下的需求 +2364 项目没有关联产品下需求,在维护项目模块时可以显示产品下模块 +2366 禅道的客户端修改密码后不能登录 +2367 计划需求列表移除需求之后,底部的统计结果并没有重新计算 +2368 弹窗录入信息后右上角的差号消失 +2369 批量分解需求时会把html实体转义 +2370 文档库访问权限设置后再清空保存不生效 +2371 关闭的项目可以在搜索栏访问 +2373 我的地盘总览bug数和我的地盘bug列表数不一致 +2374 员工负载表对多人任务统计不准确 +2375 客户端上访问禅道的不能正常添加用户 +2376 在已有模块中插入模块保存后新模块会排序到最后 +2377 批量编辑用户不能修改职位为空 +2378 执行用例结果选择失败不会转到下个用例 +2379 客户端在浏览器窗口中打开链接导致无限循环请求 +2380 测试用例下不应该显示指派分组 +2382 客户端修改禅道用户信息无法保存 +2383 下载客户端弹窗页面需要优化 +2384 自定义导航公共无法保存 +2386 客户端服务器设置页面,提示文案修改 +2389 自定义列出删除用户无法保存 +2390 移动文档库分类文档不能同步移动 +2391 多分支多平台产品提bug提用例所属模块问题 +2392 地盘区块中的项目数量与地盘项目列表中的数量不一致 +2393 IE11富文本编辑器兼容问题 +2394 动态如果没有权限查看就全都不显示 +2396 计划任务备份报错 +2397 禅道升级功能优化 +2398 组织权限用户列表样式重叠 +2400 自定义导航栏问题 +2402 没有文档的访问权限也可以在附件库中下载文档中的附件 +2403 创建项目页面导航栏显示的是测试 +2404 修改集成客户端中的禅道服务器,发信配置中的禅道域名会同步修改 +2406 需求页面建用例不能同步 + 2019-01-04 11.1.stable 解决的Bug 2362 后台自定义存在注入问题 diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index a3c1629753..6fbe58ac12 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -980,7 +980,15 @@ EOT; static public function reload($window = 'self') { $js = self::start(); - $js .= "$window.location.reload(true);\n"; + // See bug #2379 http://pms.zentao.net/bug-view-2379.html + if($window !== 'self' && $window !== 'window') + { + $js .= "if($window !== window) $window.location.reload(true);\n"; + } + else + { + $js .= "$window.location.reload(true);\n"; + } $js .= self::end(); return $js; } diff --git a/lib/pclzip/pclzip.class.php b/lib/pclzip/pclzip.class.php index 2d0e71e7a7..8c8614982f 100644 --- a/lib/pclzip/pclzip.class.php +++ b/lib/pclzip/pclzip.class.php @@ -1836,7 +1836,8 @@ $v_memory_limit = ini_get('memory_limit'); $v_memory_limit = trim($v_memory_limit); $last = strtolower(substr($v_memory_limit, -1)); - + + $v_memory_limit = (int)$v_memory_limit; if($last == 'g') //$v_memory_limit = $v_memory_limit*1024*1024*1024; $v_memory_limit = $v_memory_limit*1073741824; diff --git a/module/action/model.php b/module/action/model.php index 5a67dbab75..9dfe977eb5 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -750,7 +750,7 @@ class actionModel extends model } $objectNames['user'][0] = 'guest'; // Add guest account. - foreach($actions as $action) + foreach($actions as $i => $action) { /* Add name field to the actions. */ $action->objectName = isset($objectNames[$action->objectType][$action->objectID]) ? $objectNames[$action->objectType][$action->objectID] : ''; @@ -779,11 +779,14 @@ class actionModel extends model { list($objectLabel, $moduleName, $methodName, $vars) = explode('|', $action->objectLabel); $action->objectLink = ''; - if(common::hasPriv($moduleName, $methodName)) + if(!common::hasPriv($moduleName, $methodName)) { - $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); - if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); + unset($actions[$i]); + continue; } + + $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID)); + if($action->objectType == 'user') $action->objectLink = helper::createLink($moduleName, $methodName, sprintf($vars, $action->actor)); $action->objectLabel = $objectLabel; } else diff --git a/module/backup/control.php b/module/backup/control.php index b56fd98267..67d58a26db 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -30,6 +30,7 @@ class backup extends control { if(!is_writable($this->backupPath)) $this->view->error = sprintf($this->lang->backup->error->noWritable, $this->backupPath); } + if(!is_writable($this->app->getTmpRoot())) $this->view->error = sprintf($this->lang->backup->error->noWritable, $this->app->getTmpRoot()); } /** @@ -81,7 +82,7 @@ class backup extends control public function backup($reload = 'no') { if($reload == 'yes') session_write_close(); - set_time_limit(7200); + set_time_limit(0); $nozip = strpos($this->config->backup->setting, 'nozip') !== false; $nofile = strpos($this->config->backup->setting, 'nofile') !== false; $nosafe = strpos($this->config->backup->setting, 'nosafe') !== false; @@ -147,7 +148,7 @@ class backup extends control } /* Delete expired backup. */ - $backupFiles = glob("{$this->backupPath}*.php"); + $backupFiles = glob("{$this->backupPath}*.*"); if(!empty($backupFiles)) { $time = time(); @@ -179,7 +180,7 @@ class backup extends control { if($confirm == 'no') $this->send(array('result' => 'fail', 'message' => $this->lang->backup->confirmRestore)); - set_time_limit(7200); + set_time_limit(0); /* Restore database. */ if(file_exists("{$this->backupPath}{$fileName}.sql.php")) @@ -373,24 +374,21 @@ class backup extends control if($sqlFileName) { $fileSize = $this->backup->getBackupSize($sqlFileName); - $fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB'; - $message = sprintf($this->lang->backup->progressSQL, $fileSize); + $message = sprintf($this->lang->backup->progressSQL, $this->backup->processFileSize($fileSize)); } $attachFileName = $this->backup->getBackupFile($fileName, 'file'); if($attachFileName) { $fileSize = $this->backup->getBackupSize($attachFileName); - $fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB'; - $message = sprintf($this->lang->backup->progressAttach, $fileSize); + $message = sprintf($this->lang->backup->progressAttach, $this->backup->processFileSize($fileSize)); } $codeFileName = $this->backup->getBackupFile($fileName, 'code'); if($codeFileName) { $fileSize = $this->backup->getBackupSize($codeFileName); - $fileSize = $fileSize / 1024 >= 1024 ? round($fileSize / 1024 / 1024, 2) . 'MB' : round($fileSize / 1024, 2) . 'KB'; - $message = sprintf($this->lang->backup->progressCode, $fileSize); + $message = sprintf($this->lang->backup->progressCode, $this->backup->processFileSize($fileSize)); } die($message); } diff --git a/module/backup/model.php b/module/backup/model.php index 25555b8c87..f275209f1c 100644 --- a/module/backup/model.php +++ b/module/backup/model.php @@ -283,7 +283,8 @@ class backupModel extends model */ public function getBackupPath() { - return empty($this->config->backup->settingDir) ? $this->app->getTmpRoot() . 'backup' . DS : $this->config->backup->settingDir; + $backupPath = empty($this->config->backup->settingDir) ? $this->app->getTmpRoot() . 'backup' . DS : $this->config->backup->settingDir; + return rtrim(str_replace('\\', '/', $backupPath), '/') . '/'; } /** @@ -311,4 +312,29 @@ class backupModel extends model return false; } + + /** + * Process filesize. + * + * @param int $fileSize + * @access public + * @return string + */ + public function processFileSize($fileSize) + { + $bit = 'KB'; + $fileSize = round($fileSize / 1024, 2); + if($fileSize >= 1024) + { + $bit = 'MB'; + $fileSize = round($fileSize / 1024, 2); + } + if($fileSize >= 1024) + { + $bit = 'GB'; + $fileSize = round($fileSize / 1024, 2); + } + + return $fileSize . $bit; + } } diff --git a/module/block/model.php b/module/block/model.php index 222ca80d9d..c01fc354a2 100644 --- a/module/block/model.php +++ b/module/block/model.php @@ -158,7 +158,11 @@ class blockModel extends model $data = array(); $data['tasks'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_TASK)->where('assignedTo')->eq($this->app->user->account)->andWhere('status')->ne('closed')->andWhere('deleted')->eq(0)->fetch('count'); - $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); + $data['bugs'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_BUG) + ->where('assignedTo')->eq($this->app->user->account) + ->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi() //Fix bug #2373. + ->andWhere('deleted')->eq(0) + ->fetch('count'); $data['stories'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_STORY)->where('assignedTo')->eq($this->app->user->account)->andWhere('deleted')->eq(0)->fetch('count'); $data['projects'] = (int)$this->dao->select('count(*) AS count')->from(TABLE_PROJECT) ->where("(status='wait' or status='doing')") diff --git a/module/bug/control.php b/module/bug/control.php index 3cb4c63b8a..8fde4f0b4d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -22,6 +22,7 @@ class bug extends control public function __construct($moduleName = '', $methodName = '') { parent::__construct($moduleName, $methodName); + $products = array(); $this->loadModel('product'); $this->loadModel('tree'); $this->loadModel('user'); @@ -393,6 +394,9 @@ class bug extends control $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch); if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story"))); + $productList = $this->loadModel('block')->getProducts('noclosed', ''); + foreach($productList as $product) $products[$product->id] = $product->name; + /* Set custom. */ foreach(explode(',', $this->config->bug->list->customCreateFields) as $field) $customFields[$field] = $this->lang->bug->$field; $this->view->customFields = $customFields; @@ -402,6 +406,7 @@ class bug extends control $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->position[] = $this->lang->bug->create; + $this->view->products = $products; $this->view->productID = $productID; $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $moduleOptionMenu; @@ -545,6 +550,7 @@ class bug extends control /* Get product info. */ $productID = $bug->product; $productName = $this->products[$productID]; + $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); /* Header and positon. */ $this->view->title = "BUG #$bug->id $bug->title - " . $this->products[$productID]; @@ -554,9 +560,11 @@ class bug extends control /* Assign. */ $this->view->productID = $productID; $this->view->productName = $productName; + $this->view->branches = $branches; $this->view->modulePath = $this->tree->getParents($bug->module); + $this->view->bugModule = empty($bug->module) ? '' : $this->tree->getById($bug->module); $this->view->bug = $bug; - $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($bug->branch, $bug->product); + $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : zget($branches, $bug->branch, ''); $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->action->getList('bug', $bugID); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); diff --git a/module/bug/model.php b/module/bug/model.php index a86dc4f60c..9d2c90a7d7 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2667,7 +2667,7 @@ class bugModel extends model $assignToLink = helper::createLink('bug', 'assignTo', "bugID=$bug->id", '', true); $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); - echo !common::hasPriv('bug', 'assignTo') ? "{$assignedToText}" : $assignToHtml; + echo !common::hasPriv('bug', 'assignTo', $bug) ? "{$assignedToText}" : $assignToHtml; } /** diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 72c51ad4de..3810f677fd 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -123,16 +123,22 @@ } else { - foreach($modulePath as $key => $module) - { - $moduleTitle .= $module->name; - if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; - if(isset($modulePath[$key + 1])) - { - $moduleTitle .= '/'; - echo $lang->arrow; - } - } + if($bugModule->branch and isset($branches[$bugModule->branch])) + { + $moduleTitle .= $branches[$bugModule->branch] . '/'; + echo $branches[$bugModule->branch] . $lang->arrow; + } + + foreach($modulePath as $key => $module) + { + $moduleTitle .= $module->name; + if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; + if(isset($modulePath[$key + 1])) + { + $moduleTitle .= '/'; + echo $lang->arrow; + } + } } $printModule = ob_get_contents(); ob_end_clean(); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index 4454234b3b..8fb5cc38cd 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -262,7 +262,7 @@ $lang->task = new stdclass(); $lang->build = new stdclass(); $lang->task->menu = $lang->project->menu; $lang->build->menu = $lang->project->menu; -$lang->build->menu->qa = array('link' => 'Test|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); +$lang->build->menu->qa = array('link' => 'Build|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); /* QA menu settings. */ $lang->qa = new stdclass(); @@ -335,6 +335,9 @@ $lang->doc = new stdclass(); $lang->doc->menu = new stdclass(); //$lang->doc->menu->createLib = array('link' => ' Add Library|doc|createLib', 'float' => 'right'); +$lang->svn = new stdclass(); +$lang->git = new stdclass(); + /* Report menu settings. */ $lang->report = new stdclass(); $lang->report->menu = new stdclass(); @@ -865,3 +868,4 @@ if(isset($config->global->flow) and $config->global->flow == 'onlyTest') unset($lang->searchObjects['release']); unset($lang->searchObjects['project']); unset($lang->searchObjects['productplan']); +} diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index f88b2841b0..240b020a93 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -262,7 +262,7 @@ $lang->task = new stdclass(); $lang->build = new stdclass(); $lang->task->menu = $lang->project->menu; $lang->build->menu = $lang->project->menu; -$lang->build->menu->qa = array('link' => '测试|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); +$lang->build->menu->qa = array('link' => '版本|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); /* QA视图菜单设置。*/ $lang->qa = new stdclass(); diff --git a/module/common/lang/zh-tw.php b/module/common/lang/zh-tw.php index 66872d8084..da2fcb11c3 100644 --- a/module/common/lang/zh-tw.php +++ b/module/common/lang/zh-tw.php @@ -262,7 +262,7 @@ $lang->task = new stdclass(); $lang->build = new stdclass(); $lang->task->menu = $lang->project->menu; $lang->build->menu = $lang->project->menu; -$lang->build->menu->qa = array('link' => '測試|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); +$lang->build->menu->qa = array('link' => '版本|project|build|projectID=%s', 'subModule' => 'bug,build,testtask', 'alias' => 'build,testtask', 'class' => 'dropdown dropdown-hover'); /* QA視圖菜單設置。*/ $lang->qa = new stdclass(); @@ -335,6 +335,9 @@ $lang->doc = new stdclass(); $lang->doc->menu = new stdclass(); //$lang->doc->menu->createLib = array('link' => ' 添加檔案夾|doc|createLib', 'float' => 'right'); +$lang->svn = new stdclass(); +$lang->git = new stdclass(); + /* 統計視圖菜單設置。*/ $lang->report = new stdclass(); $lang->report->menu = new stdclass(); @@ -479,7 +482,7 @@ $lang->error->email = "『%s』應當為合法的EMAIL。"; $lang->error->date = "『%s』應當為合法的日期。"; $lang->error->datetime = "『%s』應當為合法的日期。"; $lang->error->code = "『%s』應當為字母或數字的組合。"; -$lang->error->account = "『%s』應當為合法的用戶名。"; +$lang->error->account = "『%s』只能是字母和數字的組合三位以上。"; $lang->error->passwordsame = "兩次密碼應當相等。"; $lang->error->passwordrule = "密碼應該符合規則,長度至少為六位。"; $lang->error->accessDenied = '您沒有訪問權限'; diff --git a/module/common/model.php b/module/common/model.php index b93cb7b4ea..14ff08a922 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -167,7 +167,7 @@ class commonModel extends model if($this->loadModel('user')->isLogon() or ($this->app->company->guest and $this->app->user->account == 'guest')) { if(stripos($method, 'ajax') !== false) return true; - if(stripos($method, 'downloadClient') !== false) return true; + if($module == 'misc' and $method == 'downloadClient') return true; if($module == 'block' and $method == 'main') return true; if($module == 'misc' and $method == 'changelog') return true; if($module == 'tutorial') return true; @@ -615,11 +615,10 @@ class commonModel extends model $subMenu .= "
Add upgrade logs and database checkup after upgrading
Fixed ZenTao client and other bugs, and optimized details.
'); + $lang->misc->feature->all['11.1.stable'][] = array('title'=>'Fix Bug.'); $lang->misc->feature->all['11.0.stable'][] = array('title'=>'ZenTao integrate Xuanxuan'); diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index fc9bf03f6f..c8f9cfab5a 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -15,28 +15,6 @@ $lang->misc->ping = '防超时'; $lang->misc->api = 'https://api.zentao.net'; $lang->misc->enApi = 'http://api.zentao.pm'; -$lang->misc->client = new stdclass(); -$lang->misc->client->version = '客户端版本'; -$lang->misc->client->os = '操作系统'; -$lang->misc->client->download = '下载'; -$lang->misc->client->downloading = '正在获取安装包:'; -$lang->misc->client->downloaded = '成功获取安装包'; -$lang->misc->client->setting = '正在设置配置信息'; -$lang->misc->client->setted = '成功设置配置信息'; - -$lang->misc->client->osList['win64'] = 'Windows 64位'; -$lang->misc->client->osList['win32'] = 'Windows 32位'; -$lang->misc->client->osList['linux64'] = 'Linux 64位'; -$lang->misc->client->osList['linux32'] = 'Linux 32位'; -$lang->misc->client->osList['mac'] = 'Mac版'; - -$lang->misc->client->errorInfo = new stdclass(); -$lang->misc->client->errorInfo->downloadError = '获取安装包失败'; -$lang->misc->client->errorInfo->configError = '配置用户信息失败'; -$lang->misc->client->errorInfo->manualOpt = '请从 %s 手动获取安装包。'; -$lang->misc->client->errorInfo->dirNotExist = '客户端下载存储路径 %s 不存在,请创建该目录。'; -$lang->misc->client->errorInfo->dirNotWritable = '客户端下载存储路径 %s 不可写增加升级日志和升级后数据库检查的功能
修复禅道集成客户端和其他若干bug,完善细节
'); + $lang->misc->feature->all['11.1.stable'][] = array('title'=>'主要修复Bug。'); $lang->misc->feature->all['11.0.stable'][] = array('title'=>'禅道集成喧喧'); diff --git a/module/misc/lang/zh-tw.php b/module/misc/lang/zh-tw.php index 805c2ec805..5a0d901f66 100644 --- a/module/misc/lang/zh-tw.php +++ b/module/misc/lang/zh-tw.php @@ -15,28 +15,6 @@ $lang->misc->ping = '防超時'; $lang->misc->api = 'https://api.zentao.net'; $lang->misc->enApi = 'http://api.zentao.pm'; -$lang->misc->client = new stdclass(); -$lang->misc->client->version = '客戶端版本'; -$lang->misc->client->os = '操作系統'; -$lang->misc->client->download = '下載'; -$lang->misc->client->downloading = '正在獲取安裝包:'; -$lang->misc->client->downloaded = '成功獲取安裝包'; -$lang->misc->client->setting = '正在設置配置信息'; -$lang->misc->client->setted = '成功設置配置信息'; - -$lang->misc->client->osList['win64'] = 'Windows 64位'; -$lang->misc->client->osList['win32'] = 'Windows 32位'; -$lang->misc->client->osList['linux64'] = 'Linux 64位'; -$lang->misc->client->osList['linux32'] = 'Linux 32位'; -$lang->misc->client->osList['mac'] = 'Mac版'; - -$lang->misc->client->errorInfo = new stdclass(); -$lang->misc->client->errorInfo->downloadError = '獲取安裝包失敗'; -$lang->misc->client->errorInfo->configError = '配置用戶信息失敗'; -$lang->misc->client->errorInfo->manualOpt = '請從 %s 手動獲取安裝包。'; -$lang->misc->client->errorInfo->dirNotExist = '客戶端下載存儲路徑 %s 不存在,請創建該目錄。'; -$lang->misc->client->errorInfo->dirNotWritable = '客戶端下載存儲路徑 %s 不可寫增加升級日誌和升級後資料庫檢查的功能
修復禪道整合客戶端和其他若干bug,完善細節
'); + $lang->misc->feature->all['11.1.stable'][] = array('title'=>'主要修復Bug。'); $lang->misc->feature->all['11.0.stable'][] = array('title'=>'禪道整合喧喧'); diff --git a/module/misc/view/checkupdate.html.php b/module/misc/view/checkupdate.html.php index 1d2c232160..a382cecefd 100644 --- a/module/misc/view/checkupdate.html.php +++ b/module/misc/view/checkupdate.html.php @@ -1,7 +1,7 @@ - style='color:white; font-size:13px; text-align:center'> +server->http_user_agen, 'opera') === false) echo "bgcolor='transparent'";?> style='color:white; font-size:13px; text-align:center'> diff --git a/module/product/model.php b/module/product/model.php index 8ea051a61a..c971f6294f 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -291,33 +291,14 @@ class productModel extends model if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProductPairs(); $orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed'; - $products = $this->dao->select('id,name,line, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed') + $products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed') ->from(TABLE_PRODUCT) ->where('deleted')->eq(0) ->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi() - ->orderBy('order_desc') - ->fetchAll('id'); - - $lines = $this->loadModel('tree')->getLinePairs(); - $linePairs = array(); - foreach($lines as $id => $name) - { - foreach($products as $key => $product) - { - if($product->line == $id) - { - $linePairs[$product->id] = $name . '/' . $product->name; - unset($products[$key]); - } - } - } - - $productPairs = array(); - foreach($products as $id => $product) $productPairs[$product->id] = $product->name; - $productPairs = $linePairs + $productPairs; - - return $productPairs; + ->orderBy($orderBy) + ->fetchPairs('id', 'name'); + return $products; } /** diff --git a/module/product/view/ajaxgetdropmenu.html.php b/module/product/view/ajaxgetdropmenu.html.php index 502d23577c..8b46a8995a 100644 --- a/module/product/view/ajaxgetdropmenu.html.php +++ b/module/product/view/ajaxgetdropmenu.html.php @@ -74,8 +74,8 @@ foreach($products as $product) ?>我已经仔细阅读上面提示且完成上述工作,继续更新
'; +我已经仔细阅读上面提示且完成上述工作,继续更新
'; $lang->upgrade->selectVersion = '选择版本'; $lang->upgrade->continue = '继续'; $lang->upgrade->noteVersion = "务必选择正确的版本,否则会造成数据丢失。"; diff --git a/module/upgrade/lang/zh-tw.php b/module/upgrade/lang/zh-tw.php index 0d667e9073..f2578479a5 100644 --- a/module/upgrade/lang/zh-tw.php +++ b/module/upgrade/lang/zh-tw.php @@ -35,7 +35,7 @@ $lang->upgrade->setStatusFile = '我已經仔細閲讀上面提示且完成上述工作,繼續更新
'; +我已經仔細閲讀上面提示且完成上述工作,繼續更新
'; $lang->upgrade->selectVersion = '選擇版本'; $lang->upgrade->continue = '繼續'; $lang->upgrade->noteVersion = "務必選擇正確的版本,否則會造成數據丟失。"; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 2f0a5ab8a0..4ee452cee2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -37,6 +37,7 @@ class upgradeModel extends model public function execute($fromVersion) { set_time_limit(0); + $executeXuanxuan = false; switch($fromVersion) { case '0_3beta': @@ -322,6 +323,7 @@ class upgradeModel extends model $this->saveLogs('Execute 10_1'); $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'xuanxuan.sql'; $this->execSQL($xuanxuanSql); + $executeXuanxuan = true; case '10_2': $this->saveLogs('Execute 10_2'); case '10_3': $this->saveLogs('Execute 10_3'); case '10_3_1': @@ -339,12 +341,28 @@ class upgradeModel extends model $this->execSQL($this->getUpgradeFile('10.5.1')); case '10_6': $this->saveLogs('Execute 10_6'); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.1.0.sql'; - $this->execSQL($xuanxuanSql); - $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql'; - $this->execSQL($xuanxuanSql); + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.1.0.sql'; + $this->execSQL($xuanxuanSql); + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql'; + $this->execSQL($xuanxuanSql); + } $this->initXuanxuan(); case '11_0': $this->saveLogs('Execute 11_0'); + case '11_1': + $this->saveLogs('Execute 11_1'); + $this->execSQL($this->getUpgradeFile('11.1')); + if(!isset($this->config->isINT) or !($this->config->isINT)) + { + if(!$executeXuanxuan) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $this->execSQL($xuanxuanSql); + } + $this->dao->update(TABLE_CONFIG)->set('value')->eq('off')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('0')->exec(); + $this->dao->update(TABLE_CONFIG)->set('value')->eq('on')->where('`key`')->eq('isHttps')->andWhere('`section`')->eq('xuanxuan')->andWhere('`value`')->eq('1')->exec(); + } } $this->deletePatch(); @@ -467,6 +485,12 @@ class upgradeModel extends model $confirmContent .= file_get_contents($this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.1.0.sql'); $confirmContent .= file_get_contents($this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.2.0.sql'); case '11_0': + case '11_1': + if(!isset($this->config->isINT) or !($this->config->isINT)) + { + $xuanxuanSql = $this->app->getAppRoot() . 'db' . DS . 'upgradexuanxuan2.3.0.sql'; + $confirmContent .= file_get_contents($xuanxuanSql); + } } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } @@ -2220,7 +2244,7 @@ class upgradeModel extends model */ public function checkSafeFile() { - if($this->app->getModuleName() == 'upgrade' and $this->app->getMethodName() == 'ajaxupdatefile') return false; + if($this->app->getModuleName() == 'upgrade' and $this->session->upgrading) return false; $statusFile = $this->app->getAppRoot() . 'www' . DIRECTORY_SEPARATOR . 'ok.txt'; return (!file_exists($statusFile) or (time() - filemtime($statusFile)) > 3600) ? $statusFile : false; } diff --git a/module/upgrade/view/afterexec.html.php b/module/upgrade/view/afterexec.html.php index 6553e3f521..24632e4e80 100644 --- a/module/upgrade/view/afterexec.html.php +++ b/module/upgrade/view/afterexec.html.php @@ -42,8 +42,7 @@