diff --git a/Makefile b/Makefile index 6add55dc17..1305157607 100644 --- a/Makefile +++ b/Makefile @@ -143,6 +143,7 @@ zentaoxx: sed -i "s#\$this->app->getModuleRoot() . 'im/apischeme.json'#\$this->app->getExtensionRoot() . 'xuan/im/apischeme.json'#g" zentaoxx/extension/xuan/im/model.php sed -i "s/'..\/..\/common\/view\/header.html.php'/\$$app->getModuleRoot() . 'common\/view\/header.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php sed -i "s/'..\/..\/common\/view\/footer.html.php'/\$$app->getModuleRoot() . 'common\/view\/footer.html.php'/g" zentaoxx/extension/xuan/conference/view/admin.html.php + sed -i "s/\$$this->im->userGetChangedPassword()/array()/" zentaoxx/extension/xuan/im/control.php echo "ALTER TABLE \`zt_user\` ADD \`pinyin\` varchar(255) NOT NULL DEFAULT '' AFTER \`realname\`;" >> zentaoxx/db/xuanxuan.sql mkdir zentaoxx/tools; cp tools/cn2tw.php zentaoxx/tools; cd zentaoxx/tools; php cn2tw.php cp tools/en2other.php zentaoxx/tools; cd zentaoxx/tools; php en2other.php ../ diff --git a/VERSION b/VERSION index 1084f6a8ec..5f9cbaa8b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -17.3 +17.4 diff --git a/api/v1/entries/productplans.php b/api/v1/entries/productplans.php index f8313c1683..6fc0b0757e 100644 --- a/api/v1/entries/productplans.php +++ b/api/v1/entries/productplans.php @@ -24,7 +24,7 @@ class productplansEntry extends entry if(!$productID) return $this->sendError(400, 'No product id.'); $control = $this->loadController('productplan', 'browse'); - $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all'), $this->param('order', 'begin_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); + $control->browse($productID, $this->param('branch', 0), $this->param('status', 'all'), $this->param('query', 0), $this->param('order', 'begin_desc'), 0, $this->param('limit', 20), $this->param('page', 1)); /* Response */ $data = $this->getData(); diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index b4d2dba06e..5be0be2c25 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -210,7 +210,7 @@ class userEntry extends Entry if(!common::hasPriv('my', 'work')) break; $control = $this->loadController('my', 'bug'); - $control->bug($this->param('type', 'assignedTo'), $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 5), $this->param('page', 1)); + $control->bug($this->param('type', 'assignedTo'), 0, $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 5), $this->param('page', 1)); $data = $this->getData(); if($data->status == 'success') @@ -266,7 +266,7 @@ class userEntry extends Entry if(!common::hasPriv('my', 'work')) break; $control = $this->loadController('my', 'story'); - $control->story($this->param('type', 'assignedTo'), $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 5), $this->param('page', 1)); + $control->story($this->param('type', 'assignedTo'), 0, $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 5), $this->param('page', 1)); $data = $this->getData(); if($data->status == 'success') @@ -290,7 +290,7 @@ class userEntry extends Entry if($this->config->edition == 'max') { $control = $this->loadController('my', 'issue'); - $control->issue('createdBy', 'id_desc', 0, $this->param('limit', 5), 1); + $control->issue('createdBy', 0, 'id_desc', 0, $this->param('limit', 5), 1); $data = $this->getData(); if($data->status == 'success') @@ -307,7 +307,7 @@ class userEntry extends Entry if($this->config->edition == 'max') { $control = $this->loadController('my', 'risk'); - $control->risk('createdBy', 'id_desc', 0, $this->param('limit', 5), 1); + $control->risk('createdBy', 0, 'id_desc', 0, $this->param('limit', 5), 1); $data = $this->getData(); if($data->status == 'success') @@ -324,7 +324,7 @@ class userEntry extends Entry if($this->config->edition == 'max') { $control = $this->loadController('my', 'myMeeting'); - $control->myMeeting('all', 'id_desc', 0, $this->param('limit', 5), 1); + $control->myMeeting('all', '', 'id_desc', 0, $this->param('limit', 5), 1); $data = $this->getData(); if($data->status == 'success') diff --git a/config/config.php b/config/config.php index c2ae4e73e7..ae288b21ab 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 = '17.3'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->version = '17.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. $config->liteVersion = '1.2'; // 迅捷版版本。 The version of Lite. $config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. $config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. diff --git a/config/filter.php b/config/filter.php index 95c366a47d..16374266ab 100755 --- a/config/filter.php +++ b/config/filter.php @@ -29,6 +29,7 @@ $filter->default->cookie['fingerprint'] = 'reg::word'; $filter->default->cookie['hideMenu'] = 'equal::true'; $filter->default->cookie['tab'] = 'reg::word'; $filter->default->cookie['goback'] = 'reg::any'; +$filter->default->cookie['maxImport'] = 'reg::any'; $filter->index = new stdclass(); $filter->my = new stdclass(); diff --git a/config/zentaopms.php b/config/zentaopms.php index 1c33bb6d96..593a24f637 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -222,6 +222,8 @@ $config->openMethods[] = 'kanban.deleteobjectcard'; $config->openMethods[] = 'admin.ignore'; $config->openMethods[] = 'personnel.unbindwhitelist'; $config->openMethods[] = 'tree.viewhistory'; +$config->openMethods[] = 'doc.createbasicinfo'; +$config->openMethods[] = 'project.createguide'; /* Define the tables. */ define('TABLE_COMPANY', '`' . $config->db->prefix . 'company`'); @@ -377,6 +379,7 @@ $config->objectTables['gitlab'] = TABLE_PIPELINE; $config->objectTables['jebkins'] = TABLE_PIPELINE; $config->objectTables['stage'] = TABLE_STAGE; $config->objectTables['apistruct'] = TABLE_APISTRUCT; +$config->objectTables['repo'] = TABLE_REPO; $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions'); @@ -388,3 +391,5 @@ $config->programPriv->scrum = array('story', 'projectstory', 'projectrelease $config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('task', 'workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport')); $config->waterfallModules = array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'opportunity', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport'); + +$config->showMainMenu = true; diff --git a/db/standard/zentao17.4.sql b/db/standard/zentao17.4.sql new file mode 100644 index 0000000000..991af67102 --- /dev/null +++ b/db/standard/zentao17.4.sql @@ -0,0 +1,3932 @@ +CREATE TABLE `zt_account` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `type` varchar(255) NOT NULL, + `provider` varchar(255) NOT NULL, + `adminURI` varchar(255) NOT NULL, + `account` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `mobile` varchar(255) NOT NULL, + `extra` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `status` varchar(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `name` (`name`), + KEY `provider` (`provider`), + KEY `status` (`status`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_acl` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL DEFAULT '0', + `type` char(40) NOT NULL DEFAULT 'whitelist', + `source` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_action` ( + `id` int(9) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL DEFAULT '', + `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` text NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `actor` varchar(100) NOT NULL DEFAULT '', + `action` varchar(80) NOT NULL DEFAULT '', + `date` datetime NOT NULL, + `comment` text NOT NULL, + `extra` text, + `read` enum('0','1') NOT NULL DEFAULT '0', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `efforted` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `actor` (`actor`), + KEY `project` (`project`), + KEY `action` (`action`), + KEY `objectID` (`objectID`) +) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_activity` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `process` mediumint(9) NOT NULL, + `name` varchar(255) NOT NULL, + `optional` varchar(255) NOT NULL, + `tailorNorm` varchar(255) NOT NULL, + `content` mediumtext NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `order` mediumint(8) DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=90 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_api` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `product` varchar(255) NOT NULL DEFAULT '', + `lib` int(10) unsigned NOT NULL DEFAULT '0', + `module` int(10) unsigned NOT NULL DEFAULT '0', + `title` varchar(100) NOT NULL DEFAULT '', + `path` varchar(255) NOT NULL DEFAULT '', + `protocol` varchar(10) NOT NULL DEFAULT '', + `method` varchar(10) NOT NULL DEFAULT '', + `requestType` varchar(100) NOT NULL DEFAULT '', + `responseType` varchar(100) NOT NULL DEFAULT '', + `status` varchar(20) NOT NULL DEFAULT '', + `owner` varchar(30) NOT NULL DEFAULT '0', + `desc` mediumtext NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '0', + `params` text, + `paramsExample` text, + `responseExample` text, + `response` text, + `commonParams` text, + `addedBy` varchar(30) NOT NULL DEFAULT '0', + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '0', + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_api_lib_release` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `lib` int(10) unsigned NOT NULL DEFAULT '0', + `desc` varchar(255) NOT NULL DEFAULT '', + `version` varchar(255) NOT NULL DEFAULT '', + `snap` mediumtext NOT NULL, + `addedBy` varchar(30) NOT NULL DEFAULT '0', + `addedDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_apispec` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `doc` int(10) unsigned NOT NULL DEFAULT '0', + `module` int(10) unsigned NOT NULL DEFAULT '0', + `title` varchar(100) NOT NULL DEFAULT '', + `path` varchar(255) NOT NULL DEFAULT '', + `protocol` varchar(10) NOT NULL DEFAULT '', + `method` varchar(10) NOT NULL DEFAULT '', + `requestType` varchar(100) NOT NULL DEFAULT '', + `responseType` varchar(100) NOT NULL DEFAULT '', + `status` varchar(20) NOT NULL DEFAULT '', + `owner` varchar(255) NOT NULL DEFAULT '0', + `desc` mediumtext NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '0', + `params` text, + `paramsExample` text, + `responseExample` text, + `response` text, + `addedBy` varchar(30) NOT NULL DEFAULT '0', + `addedDate` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=176 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_apistruct` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `lib` int(10) unsigned NOT NULL DEFAULT '0', + `name` varchar(30) NOT NULL DEFAULT '', + `type` varchar(50) NOT NULL DEFAULT '', + `desc` mediumtext NOT NULL DEFAULT '', + `version` smallint(5) unsigned NOT NULL DEFAULT '0', + `attribute` text, + `addedBy` varchar(30) NOT NULL DEFAULT '0', + `addedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '0', + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_apistruct_spec` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `type` varchar(50) NOT NULL DEFAULT '', + `desc` varchar(255) NOT NULL DEFAULT '', + `attribute` text, + `version` smallint(5) unsigned NOT NULL DEFAULT '0', + `addedBy` varchar(30) NOT NULL DEFAULT '0', + `addedDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approval` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `flow` mediumint(8) NOT NULL, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `nodes` mediumtext NOT NULL, + `version` mediumint(9) NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'doing', + `result` varchar(20) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalflow` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `code` varchar(100) NOT NULL, + `desc` mediumtext NOT NULL, + `version` mediumint(8) NOT NULL DEFAULT '1', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `type` varchar(30) NOT NULL, + `deleted` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalflowobject` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `root` int(8) NOT NULL, + `flow` int(8) NOT NULL, + `objectType` char(30) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `extra` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalflowspec` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `flow` mediumint(8) NOT NULL, + `version` mediumint(8) NOT NULL, + `nodes` mediumtext NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalnode` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `approval` mediumint(8) NOT NULL, + `type` enum('review','cc') NOT NULL, + `title` varchar(255) NOT NULL, + `account` char(30) NOT NULL, + `node` varchar(100) NOT NULL, + `reviewType` varchar(100) NOT NULL DEFAULT 'manual', + `multipleType` enum('and','or') NOT NULL DEFAULT 'and', + `prev` mediumtext NOT NULL, + `next` mediumtext NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'wait', + `result` varchar(10) NOT NULL, + `date` date NOT NULL, + `opinion` mediumtext NOT NULL, + `extra` mediumtext NOT NULL, + `reviewedBy` char(30) NOT NULL, + `reviewedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_reviewed_date` (`reviewedDate`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalobject` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `approval` int(8) NOT NULL, + `objectType` char(30) NOT NULL, + `objectID` mediumint(8) NOT NULL, + `extra` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_approvalrole` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `code` char(30) NOT NULL, + `name` varchar(255) NOT NULL, + `desc` text NOT NULL, + `users` longtext NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_asset` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `status` varchar(30) NOT NULL, + `type` varchar(30) NOT NULL, + `group` varchar(128) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(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 `zt_assetlib` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `type` varchar(255) NOT NULL, + `desc` mediumtext 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; +CREATE TABLE `zt_attend` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `signIn` time NOT NULL, + `signOut` time NOT NULL, + `status` varchar(30) NOT NULL DEFAULT '', + `ip` varchar(15) NOT NULL, + `device` varchar(30) NOT NULL, + `client` varchar(20) NOT NULL, + `manualIn` time NOT NULL, + `manualOut` time NOT NULL, + `reason` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `reviewStatus` varchar(30) NOT NULL DEFAULT '', + `reviewedBy` char(30) NOT NULL, + `reviewedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `attend` (`date`,`account`), + KEY `account` (`account`), + KEY `date` (`date`), + KEY `status` (`status`), + KEY `reason` (`reason`), + KEY `reviewStatus` (`reviewStatus`), + KEY `reviewedBy` (`reviewedBy`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_attendstat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `month` char(10) NOT NULL DEFAULT '', + `normal` decimal(12,2) NOT NULL DEFAULT '0.00', + `late` decimal(12,2) NOT NULL DEFAULT '0.00', + `early` decimal(12,2) NOT NULL DEFAULT '0.00', + `absent` decimal(12,2) NOT NULL DEFAULT '0.00', + `trip` decimal(12,2) NOT NULL DEFAULT '0.00', + `egress` decimal(12,2) NOT NULL DEFAULT '0.00', + `lieu` decimal(12,2) NOT NULL DEFAULT '0.00', + `paidLeave` decimal(12,2) NOT NULL DEFAULT '0.00', + `unpaidLeave` decimal(12,2) NOT NULL DEFAULT '0.00', + `timeOvertime` decimal(12,2) NOT NULL DEFAULT '0.00', + `restOvertime` decimal(12,2) NOT NULL DEFAULT '0.00', + `holidayOvertime` decimal(12,2) NOT NULL DEFAULT '0.00', + `deserve` decimal(12,2) NOT NULL DEFAULT '0.00', + `actual` decimal(12,2) NOT NULL DEFAULT '0.00', + `status` char(30) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + UNIQUE KEY `attend` (`month`,`account`), + KEY `account` (`account`), + KEY `month` (`month`), + KEY `status` (`status`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_auditcl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `model` char(30) NOT NULL DEFAULT 'waterfall', + `practiceArea` char(30) NOT NULL, + `type` char(30) NOT NULL, + `title` varchar(255) NOT NULL, + `objectType` char(30) NOT NULL, + `objectID` int(10) DEFAULT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_auditplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `dateType` char(30) DEFAULT NULL, + `config` text, + `objectID` mediumint(9) NOT NULL, + `objectType` char(30) NOT NULL, + `process` mediumint(9) NOT NULL, + `processType` char(30) NOT NULL, + `checkDate` date NOT NULL, + `checkedBy` varchar(30) NOT NULL, + `realCheckDate` date NOT NULL, + `result` char(30) NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `checkBy` varchar(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_auditresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `auditplan` mediumint(8) NOT NULL, + `listID` mediumint(8) NOT NULL, + `result` char(30) NOT NULL, + `checkedBy` varchar(30) NOT NULL, + `checkedDate` date NOT NULL, + `comment` text NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_baseimage` ( + `id` smallint(7) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `path` varchar(255) NOT NULL DEFAULT '', + `osType` varchar(50) NOT NULL DEFAULT '', + `os` varchar(50) NOT NULL DEFAULT '', + `osCategory` varchar(50) NOT NULL DEFAULT '', + `osArch` varchar(50) NOT NULL DEFAULT '', + `osLang` varchar(50) NOT NULL DEFAULT '', + `suggestCore` tinyint(1) unsigned NOT NULL DEFAULT '0', + `suggestMemory` mediumint(6) unsigned NOT NULL DEFAULT '0', + `suggestVolume` mediumint(6) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_baseimagebrowser` ( + `vmBackingID` int(10) NOT NULL, + `browserID` int(10) NOT NULL, + PRIMARY KEY (`vmBackingID`,`browserID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_basicmeas` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `purpose` varchar(50) NOT NULL, + `scope` char(30) NOT NULL, + `object` char(30) NOT NULL, + `name` varchar(90) NOT NULL, + `code` char(30) NOT NULL, + `unit` varchar(10) NOT NULL, + `configure` text, + `params` text, + `definition` text, + `source` varchar(255) DEFAULT NULL, + `collectType` varchar(30) NOT NULL, + `collectConf` text NOT NULL, + `execTime` varchar(30) NOT NULL, + `collectedBy` varchar(10) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `order` mediumint(8) unsigned NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=MyISAM AUTO_INCREMENT=54 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_block` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `module` varchar(20) NOT NULL, + `type` char(30) 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 `account_vision_module_type_order` (`account`,`vision`,`module`,`type`,`order`), + KEY `account` (`account`) +) ENGINE=MyISAM AUTO_INCREMENT=11 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, + `default` enum('0','1') NOT NULL DEFAULT '0', + `status` enum('active','closed') NOT NULL DEFAULT 'active', + `desc` varchar(255) NOT NULL, + `createdDate` date NOT NULL, + `closedDate` date 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_browser` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL DEFAULT '', + `type` varchar(255) NOT NULL DEFAULT '', + `version` varchar(255) NOT NULL DEFAULT '', + `lang` varchar(255) NOT NULL DEFAULT '', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_budget` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `stage` char(30) NOT NULL, + `subject` mediumint(8) NOT NULL, + `amount` char(30) NOT NULL, + `name` varchar(255) NOT NULL, + `desc` mediumtext NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_bug` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `injection` mediumint(8) unsigned NOT NULL, + `identify` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `execution` 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` mediumtext 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, + `feedbackBy` varchar(100) NOT NULL, + `notifyEmail` varchar(100) 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', + `feedback` mediumint(8) unsigned NOT NULL DEFAULT '0', + `result` mediumint(8) unsigned NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `mr` mediumint(8) unsigned NOT NULL, + `entry` text NOT NULL, + `lines` varchar(10) NOT NULL, + `v1` varchar(40) NOT NULL, + `v2` varchar(40) NOT NULL, + `repoType` varchar(30) NOT NULL DEFAULT '', + `issueKey` varchar(50) 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 `execution` (`execution`), + KEY `status` (`status`), + KEY `plan` (`plan`), + KEY `story` (`story`), + KEY `case` (`case`), + KEY `toStory` (`toStory`), + KEY `result` (`result`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_build` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `execution` 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` mediumtext NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `execution` (`execution`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_burn` ( + `execution` mediumint(8) unsigned NOT NULL, + `product` 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, + `storyPoint` float NOT NULL, + PRIMARY KEY (`execution`,`date`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_case` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `execution` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` mediumint(8) unsigned NOT NULL DEFAULT '0', + `story` mediumint(30) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `title` varchar(255) NOT NULL, + `precondition` text NOT NULL, + `keywords` varchar(255) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '3', + `type` char(30) NOT NULL DEFAULT '1', + `auto` varchar(10) NOT NULL DEFAULT 'no', + `frame` varchar(10) NOT NULL, + `stage` varchar(255) NOT NULL, + `howRun` varchar(30) NOT NULL, + `scriptedBy` varchar(30) NOT NULL, + `scriptedDate` date NOT NULL, + `scriptStatus` varchar(30) NOT NULL, + `scriptLocation` varchar(255) NOT NULL, + `status` char(30) NOT NULL DEFAULT '1', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `color` char(7) NOT NULL, + `frequency` enum('1','2','3') NOT NULL DEFAULT '1', + `order` tinyint(30) unsigned NOT NULL DEFAULT '0', + `openedBy` char(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` date NOT NULL, + `lastEditedBy` char(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '0', + `linkCase` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL, + `fromCaseID` mediumint(8) unsigned NOT NULL, + `fromCaseVersion` mediumint(8) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `lastRunner` varchar(30) NOT NULL, + `lastRunDate` datetime NOT NULL, + `lastRunResult` char(30) NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `story` (`story`), + KEY `fromBug` (`fromBug`), + KEY `module` (`module`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_casestep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(3) unsigned NOT NULL DEFAULT '0', + `type` varchar(10) NOT NULL DEFAULT 'step', + `desc` text NOT NULL, + `expect` text NOT NULL, + PRIMARY KEY (`id`), + KEY `case` (`case`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cfd` ( + `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `execution` int(8) NOT NULL, + `type` char(30) NOT NULL, + `name` char(30) NOT NULL, + `count` smallint NOT NULL, + `date` date NOT NULL, + UNIQUE KEY `execution_type_name_date` (`execution`,`type`,`name`,`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_cmcl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` char(30) NOT NULL, + `title` int(11) NOT NULL, + `contents` text NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `order` int(11) 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; +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 AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_compile` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `queue` mediumint(8) NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `atTime` varchar(10) NOT NULL, + `testtask` mediumint(8) unsigned NOT NULL, + `tag` varchar(255) NOT NULL, + `times` tinyint(3) unsigned NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `updateDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_config` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `owner` char(30) NOT NULL DEFAULT '', + `module` varchar(30) NOT NULL, + `section` char(30) NOT NULL DEFAULT '', + `key` char(30) NOT NULL DEFAULT '', + `value` longtext NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`vision`,`owner`,`module`,`section`,`key`) +) ENGINE=MyISAM AUTO_INCREMENT=33 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 AUTO_INCREMENT=20 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_deploy` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `begin` datetime NOT NULL, + `end` datetime NOT NULL, + `name` varchar(255) NOT NULL, + `desc` mediumtext NOT NULL, + `status` varchar(20) NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `notify` text NOT NULL, + `cases` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `result` varchar(20) NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_deployproduct` ( + `deploy` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `release` mediumint(8) unsigned NOT NULL, + `package` varchar(255) NOT NULL, + UNIQUE KEY `deploy_product_release` (`deploy`,`product`,`release`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_deployscope` ( + `deploy` mediumint(8) unsigned NOT NULL, + `service` mediumint(8) unsigned NOT NULL, + `hosts` text NOT NULL, + `remove` text NOT NULL, + `add` text NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_deploystep` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `deploy` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `begin` datetime NOT NULL, + `end` datetime NOT NULL, + `stage` varchar(30) NOT NULL, + `content` text NOT NULL, + `status` varchar(30) NOT NULL, + `assignedTo` char(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `finishedBy` char(30) NOT NULL, + `finishedDate` datetime 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_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_design` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` varchar(255) NOT NULL, + `product` varchar(255) NOT NULL, + `commit` text NOT NULL, + `commitedBy` varchar(30) NOT NULL, + `execution` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `story` char(30) NOT NULL, + `desc` mediumtext NOT NULL, + `version` smallint(6) NOT NULL, + `type` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_designspec` ( + `design` mediumint(8) NOT NULL, + `version` smallint(6) NOT NULL, + `name` varchar(255) NOT NULL, + `desc` mediumtext NOT NULL, + `files` varchar(255) NOT NULL, + UNIQUE KEY `design` (`design`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `lib` varchar(30) NOT NULL, + `template` varchar(30) NOT NULL, + `templateType` varchar(30) NOT NULL, + `chapterType` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `parent` smallint(5) 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', + `views` smallint(5) unsigned NOT NULL, + `assetLib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `assetLibType` varchar(30) NOT NULL DEFAULT '', + `from` mediumint(8) unsigned NOT NULL DEFAULT '0', + `fromVersion` smallint(6) NOT NULL DEFAULT '1', + `draft` longtext NOT NULL, + `collector` text NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `approvedDate` date NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `mailto` text, + `acl` varchar(10) NOT NULL DEFAULT 'open', + `groups` varchar(255) NOT NULL, + `users` text NOT NULL, + `version` smallint(5) unsigned NOT NULL DEFAULT '1', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `execution` (`execution`), + KEY `lib` (`lib`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doccontent` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `doc` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `digest` varchar(255) NOT NULL, + `content` longtext NOT NULL, + `files` text NOT NULL, + `type` varchar(10) NOT NULL, + `version` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `doc_version` (`doc`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_doclib` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `name` varchar(60) NOT NULL, + `baseUrl` varchar(255) NOT NULL DEFAULT '', + `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, + `desc` mediumtext NOT NULL, + `order` tinyint(5) unsigned NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `execution` (`execution`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_domain` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `domain` varchar(255) NOT NULL, + `adminURI` varchar(255) NOT NULL, + `resolverURI` varchar(255) NOT NULL, + `register` varchar(255) NOT NULL, + `expiredDate` datetime NOT NULL, + `renew` varchar(255) NOT NULL, + `account` varchar(255) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `domain` (`domain`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_durationestimation` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `stage` mediumint(9) NOT NULL, + `workload` varchar(255) NOT NULL, + `worktimeRate` varchar(255) NOT NULL, + `people` varchar(255) NOT NULL, + `startDate` date NOT NULL, + `endDate` date 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; +CREATE TABLE `zt_effort` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `product` text NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `work` text, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `date` date NOT NULL, + `left` float NOT NULL, + `consumed` float NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `execution` (`execution`), + KEY `objectID` (`objectID`), + KEY `date` (`date`), + KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +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, + `freePasswd` enum('0','1') NOT NULL DEFAULT '0', + `ip` varchar(100) NOT NULL, + `desc` mediumtext 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`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_expect` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `userID` mediumint(8) NOT NULL, + `project` mediumint(8) NOT NULL DEFAULT '0', + `expect` text NOT NULL, + `progress` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`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` mediumtext 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_faq` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `module` mediumint(9) NOT NULL, + `product` mediumint(9) NOT NULL, + `question` varchar(255) NOT NULL, + `answer` text NOT NULL, + `addedtime` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_feedback` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `product` mediumint(8) unsigned NOT NULL, + `module` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `type` char(30) NOT NULL, + `solution` char(30) NOT NULL, + `desc` text NOT NULL, + `status` varchar(30) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `public` enum('0','1') NOT NULL DEFAULT '0', + `notify` enum('0','1') NOT NULL DEFAULT '0', + `notifyEmail` varchar(100) NOT NULL, + `likes` text NOT NULL, + `result` mediumint(8) unsigned NOT NULL, + `faq` mediumint(8) unsigned NOT NULL, + `openedBy` char(30) NOT NULL, + `openedDate` datetime NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` datetime NOT NULL, + `processedBy` char(30) NOT NULL, + `processedDate` datetime NOT NULL, + `closedBy` char(30) NOT NULL, + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedTo` varchar(255) NOT NULL, + `assignedDate` datetime NOT NULL, + `feedbackBy` varchar(100) NOT NULL, + `mailto` varchar(255) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_feedbackview` ( + `account` char(30) NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + UNIQUE KEY `account_product` (`account`,`product`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_file` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `pathname` char(100) NOT NULL, + `title` varchar(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_gapanalysis` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `role` varchar(20) NOT NULL, + `analysis` mediumtext NOT NULL, + `needTrain` enum('no','yes') NOT NULL DEFAULT 'no', + `createdBy` char(30) DEFAULT 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`), + UNIQUE KEY `project_account` (`project`,`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_group` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `name` char(30) NOT NULL, + `role` char(30) NOT NULL DEFAULT '', + `desc` char(255) NOT NULL DEFAULT '', + `acl` text, + `developer` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=17 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` int(9) 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 `zt_holiday` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(30) NOT NULL DEFAULT '', + `type` enum('holiday','working') NOT NULL DEFAULT 'holiday', + `desc` mediumtext NOT NULL, + `year` char(4) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + PRIMARY KEY (`id`), + KEY `year` (`year`), + KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_host` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `assetID` mediumint(8) unsigned NOT NULL, + `admin` smallint(5) unsigned NOT NULL DEFAULT '0', + `serverRoom` mediumint(8) unsigned NOT NULL, + `cabinet` varchar(128) NOT NULL, + `serverModel` varchar(256) NOT NULL, + `hardwareType` varchar(64) NOT NULL, + `hostType` enum('physical','virtual') NOT NULL, + `cpuBrand` varchar(128) NOT NULL, + `cpuModel` varchar(128) NOT NULL, + `cpuNumber` varchar(16) NOT NULL, + `cpuCores` varchar(30) NOT NULL, + `cpuRate` varchar(30) NOT NULL, + `memory` varchar(30) NOT NULL, + `diskType` varchar(30) NOT NULL, + `diskSize` varchar(30) NOT NULL, + `unit` enum('GB','TB') NOT NULL DEFAULT 'GB', + `privateIP` varchar(128) NOT NULL, + `publicIP` varchar(128) NOT NULL, + `nic` varchar(128) NOT NULL, + `mac` varchar(128) NOT NULL, + `osName` varchar(64) NOT NULL, + `osVersion` varchar(64) NOT NULL, + `webserver` varchar(128) NOT NULL, + `database` varchar(128) NOT NULL, + `language` varchar(16) NOT NULL, + `status` varchar(50) NOT NULL, + `agentPort` varchar(10) NOT NULL, + `instanceNum` tinyint(4) NOT NULL DEFAULT '0', + `pri` smallint(5) unsigned NOT NULL DEFAULT '0', + `heartbeatTime` datetime NOT NULL, + `tags` varchar(50) NOT NULL DEFAULT '', + `provider` varchar(255) NOT NULL DEFAULT '', + `bridgeID` varchar(255) NOT NULL DEFAULT '', + `cloudKey` varchar(255) NOT NULL DEFAULT '', + `cloudSecret` varchar(255) NOT NULL DEFAULT '', + `cloudRegion` varchar(255) NOT NULL DEFAULT '', + `cloudNamespace` varchar(255) NOT NULL DEFAULT '', + `cloudUser` varchar(255) NOT NULL DEFAULT '', + `cloudAccount` varchar(255) NOT NULL DEFAULT '', + `cloudPassword` varchar(255) NOT NULL DEFAULT '', + `couldVPC` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_chat` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `name` varchar(60) NOT NULL DEFAULT '', + `type` varchar(20) NOT NULL DEFAULT 'group', + `admins` varchar(255) NOT NULL DEFAULT '', + `committers` varchar(255) NOT NULL DEFAULT '', + `subject` mediumint(8) unsigned NOT NULL DEFAULT '0', + `public` enum('0','1') NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL DEFAULT '', + `createdDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `ownedBy` varchar(30) NOT NULL DEFAULT '', + `editedBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastMessage` int(11) unsigned NOT NULL DEFAULT '0', + `lastMessageIndex` int(11) unsigned NOT NULL DEFAULT 0, + `dismissDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `pinnedMessages` text NOT NULL, + PRIMARY KEY (`id`), + KEY `gid` (`gid`), + KEY `name` (`name`), + KEY `type` (`type`), + KEY `public` (`public`), + KEY `createdBy` (`createdBy`), + KEY `editedBy` (`editedBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_chat_message_index` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL, + `tableName` char(64) NOT NULL, + `start` int(11) unsigned NOT NULL, + `end` int(11) unsigned NOT NULL, + `startIndex` int(11) unsigned NOT NULL, + `endIndex` int(11) unsigned NOT NULL, + `startDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `endDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `count` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `chattable` (`gid`,`tableName`), + KEY `start` (`start`), + KEY `end` (`end`), + KEY `startDate` (`startDate`), + KEY `endDate` (`endDate`), + KEY `chatstartindex` (`gid`,`startIndex`), + KEY `chatendindex` (`gid`,`endIndex`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_chatuser` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `cgid` char(40) NOT NULL DEFAULT '', + `user` mediumint(8) NOT NULL DEFAULT '0', + `order` smallint(5) NOT NULL DEFAULT '0', + `star` enum('0','1') NOT NULL DEFAULT '0', + `hide` enum('0','1') NOT NULL DEFAULT '0', + `mute` enum('0','1') NOT NULL DEFAULT '0', + `freeze` enum('0','1') NOT NULL DEFAULT '0', + `join` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `quit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `category` varchar(40) NOT NULL DEFAULT '', + `lastReadMessage` int(11) unsigned NOT NULL DEFAULT '0', + `lastReadMessageIndex` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + UNIQUE KEY `chatuser` (`cgid`,`user`), + KEY `cgid` (`cgid`), + KEY `user` (`user`), + KEY `order` (`order`), + KEY `star` (`star`), + KEY `hide` (`hide`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_client` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `version` char(30) NOT NULL DEFAULT '', + `desc` varchar(100) NOT NULL DEFAULT '', + `changeLog` text NOT NULL, + `strategy` varchar(10) NOT NULL DEFAULT '', + `downloads` text NOT NULL, + `createdDate` datetime NOT NULL, + `createdBy` varchar(30) NOT NULL DEFAULT '', + `editedDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL DEFAULT '', + `status` enum('released','wait') NOT NULL DEFAULT 'wait', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_conference` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `rid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `status` enum('closed','open') NOT NULL DEFAULT 'closed', + `participants` text NOT NULL, + `invitee` text NOT NULL, + `openedBy` mediumint(8) NOT NULL DEFAULT '0', + `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_conferenceaction` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `rid` char(40) NOT NULL DEFAULT '', + `type` enum('create','invite','join','leave','close','publish') NOT NULL DEFAULT 'create', + `data` text NOT NULL, + `user` mediumint(8) NOT NULL DEFAULT '0', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `device` char(40) NOT NULL DEFAULT 'default', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_message` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `index` int(11) unsigned NOT NULL DEFAULT 0, + `type` enum('normal','broadcast','notify','bulletin') NOT NULL DEFAULT 'normal', + `content` text NOT NULL, + `contentType` enum('text','plain','emotion','image','file','object','code') NOT NULL DEFAULT 'text', + `data` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `mgid` (`gid`), + KEY `mcgid` (`cgid`), + KEY `muser` (`user`), + KEY `mtype` (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_message_backup` ( + `id` int(11) unsigned NOT NULL, + `gid` char(40) NOT NULL DEFAULT '', + `cgid` char(40) NOT NULL DEFAULT '', + `user` varchar(30) NOT NULL DEFAULT '', + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `index` int(11) unsigned NOT NULL DEFAULT 0, + `type` enum('normal','broadcast','notify') NOT NULL DEFAULT 'normal', + `content` text NOT NULL, + `contentType` enum('text','plain','emotion','image','file','object','code') NOT NULL DEFAULT 'text', + `data` text NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_message_index` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `tableName` char(64) NOT NULL, + `start` int(11) unsigned NOT NULL, + `end` int(11) unsigned NOT NULL, + `startDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `endDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `chats` text NOT NULL, + PRIMARY KEY (`id`), + KEY `tableName` (`tableName`), + KEY `start` (`start`), + KEY `end` (`end`), + KEY `startDate` (`startDate`), + KEY `endDate` (`endDate`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_messagestatus` ( + `user` mediumint(8) NOT NULL DEFAULT '0', + `message` int(11) unsigned NOT NULL, + `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', + UNIQUE KEY `user` (`user`,`message`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_queue` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` char(30) NOT NULL, + `content` text NOT NULL, + `addDate` datetime NOT NULL, + `processDate` datetime NOT NULL, + `result` text NOT NULL, + `status` char(30) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_im_userdevice` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user` mediumint(8) NOT NULL DEFAULT '0', + `device` char(40) NOT NULL DEFAULT 'default', + `deviceID` char(40) NOT NULL DEFAULT '', + `token` char(64) NOT NULL DEFAULT '', + `validUntil` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `lastLogout` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + UNIQUE KEY `userdevice` (`user`,`device`), + KEY `user` (`user`), + KEY `lastLogin` (`lastLogin`), + KEY `lastLogout` (`lastLogout`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_intervention` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `activity` mediumint(8) NOT NULL, + `status` char(30) NOT NULL, + `partake` text NOT NULL, + `begin` date NOT NULL, + `realBegin` date NOT NULL, + `situation` varchar(255) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `project` (`project`,`activity`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_issue` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `resolvedBy` varchar(30) NOT NULL, + `project` varchar(255) NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `desc` mediumtext NOT NULL, + `pri` char(30) NOT NULL, + `severity` char(30) NOT NULL, + `type` char(30) NOT NULL, + `activity` varchar(255) NOT NULL, + `deadline` date NOT NULL, + `resolution` char(30) NOT NULL, + `resolutionComment` text NOT NULL, + `objectID` varchar(255) NOT NULL, + `resolvedDate` date NOT NULL, + `status` varchar(30) NOT NULL, + `owner` varchar(255) NOT NULL, + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `from` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `activateBy` varchar(30) NOT NULL, + `activateDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` date NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `approvedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_job` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `frame` varchar(20) NOT NULL, + `engine` varchar(20) NOT NULL, + `server` mediumint(8) unsigned NOT NULL, + `pipeline` varchar(500) NOT NULL, + `triggerType` varchar(255) NOT NULL, + `sonarqubeServer` mediumint(8) unsigned NOT NULL, + `projectKey` varchar(255) NOT NULL, + `svnDir` varchar(255) NOT NULL, + `atDay` varchar(255) DEFAULT NULL, + `atTime` varchar(10) DEFAULT NULL, + `customParam` text NOT NULL, + `comment` varchar(255) DEFAULT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `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_kanban` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `space` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `owner` varchar(30) NOT NULL, + `team` text NOT NULL, + `desc` mediumtext NOT NULL, + `acl` char(30) NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `archived` enum('0','1') NOT NULL DEFAULT '1', + `performable` enum('0','1') NOT NULL DEFAULT '0', + `status` enum('active','closed') NOT NULL DEFAULT 'active', + `order` mediumint(8) NOT NULL DEFAULT '0', + `displayCards` smallint(6) NOT NULL DEFAULT '0', + `showWIP` enum('0','1') NOT NULL DEFAULT '1', + `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', + `object` varchar(255) NOT NULL, + `alignment` varchar(10) NOT NULL DEFAULT 'center', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `closedBy` char(30) NOT NULL, + `closedDate` datetime NOT NULL, + `activatedBy` char(30) NOT NULL, + `activatedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbancard` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `kanban` mediumint(8) unsigned NOT NULL, + `region` mediumint(8) unsigned NOT NULL, + `group` mediumint(8) unsigned NOT NULL, + `fromID` mediumint(8) unsigned NOT NULL, + `fromType` varchar(30) NOT NULL, + `name` varchar(255) NOT NULL, + `status` varchar(30) NOT NULL DEFAULT 'doing', + `pri` mediumint(8) unsigned NOT NULL, + `assignedTo` text NOT NULL, + `desc` mediumtext NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `estimate` float unsigned NOT NULL, + `progress` float unsigned NOT NULL DEFAULT '0', + `color` char(7) NOT NULL, + `acl` char(30) NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) NOT NULL DEFAULT '0', + `archived` enum('0','1') NOT NULL DEFAULT '0', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `archivedBy` char(30) NOT NULL, + `archivedDate` datetime NOT NULL, + `assignedBy` char(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbancell` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `kanban` mediumint(8) NOT NULL, + `lane` mediumint(8) NOT NULL, + `column` mediumint(8) NOT NULL, + `type` char(30) NOT NULL, + `cards` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `card_group` (`kanban`,`type`,`lane`,`column`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbancolumn` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `region` mediumint(8) unsigned NOT NULL, + `group` mediumint(8) NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `limit` smallint(6) NOT NULL DEFAULT '-1', + `order` mediumint(8) NOT NULL DEFAULT '0', + `archived` enum('0','1') NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbangroup` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `kanban` mediumint(8) unsigned NOT NULL, + `region` mediumint(8) unsigned NOT NULL, + `order` smallint(6) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbanlane` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `execution` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `region` mediumint(8) unsigned NOT NULL, + `group` mediumint(8) unsigned NOT NULL, + `groupby` char(30) NOT NULL, + `extra` char(30) NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `order` smallint(6) NOT NULL DEFAULT '0', + `lastEditedTime` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbanregion` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `space` mediumint(8) unsigned NOT NULL, + `kanban` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `order` mediumint(8) NOT NULL DEFAULT '0', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_kanbanspace` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `type` varchar(50) NOT NULL, + `owner` varchar(30) NOT NULL, + `team` text NOT NULL, + `desc` mediumtext NOT NULL, + `acl` char(30) NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `status` enum('active','closed') NOT NULL DEFAULT 'active', + `order` mediumint(8) NOT NULL DEFAULT '0', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `lastEditedBy` char(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `closedBy` char(30) NOT NULL, + `closedDate` datetime NOT NULL, + `activatedBy` char(30) NOT NULL, + `activatedDate` datetime NOT 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', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + PRIMARY KEY (`id`), + UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`,`vision`) +) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_leave` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `year` char(4) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `start` time NOT NULL, + `finish` time NOT NULL, + `hours` float(4,1) unsigned NOT NULL DEFAULT '0.0', + `backDate` datetime NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `status` varchar(30) NOT NULL DEFAULT '', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `reviewedBy` char(30) NOT NULL, + `reviewedDate` datetime NOT NULL, + `level` tinyint(3) NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `reviewers` text NOT NULL, + `backReviewers` text NOT NULL, + PRIMARY KEY (`id`), + KEY `year` (`year`), + KEY `type` (`type`), + KEY `status` (`status`), + KEY `createdBy` (`createdBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_lieu` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `year` char(4) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `start` time NOT NULL, + `finish` time NOT NULL, + `hours` float(4,1) unsigned NOT NULL DEFAULT '0.0', + `overtime` char(255) NOT NULL, + `trip` char(255) NOT NULL, + `desc` text NOT NULL, + `status` varchar(30) NOT NULL DEFAULT '', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `reviewedBy` char(30) NOT NULL, + `reviewedDate` datetime NOT NULL, + `level` tinyint(3) NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `reviewers` text NOT NULL, + PRIMARY KEY (`id`), + KEY `year` (`year`), + KEY `status` (`status`), + KEY `createdBy` (`createdBy`) +) 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_measqueue` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `mid` mediumint(8) unsigned NOT NULL, + `status` varchar(255) NOT NULL, + `logs` text, + `execTime` varchar(10) NOT NULL, + `params` text, + `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_measrecords` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `type` varchar(30) NOT NULL, + `mid` mediumint(8) NOT NULL, + `measCode` char(50) NOT NULL DEFAULT '', + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `params` text NOT NULL, + `year` char(4) NOT NULL, + `month` char(6) NOT NULL, + `week` char(8) NOT NULL, + `day` char(8) NOT NULL, + `value` varchar(255) NOT NULL, + `date` date NOT NULL, + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `project` (`project`), + KEY `time` (`year`,`month`,`day`,`week`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_meastemplate` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `model` char(30) NOT NULL, + `name` varchar(255) NOT NULL, + `content` mediumtext NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_meeting` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) NOT NULL, + `execution` mediumint(8) NOT NULL, + `name` varchar(255) NOT NULL, + `type` varchar(255) NOT NULL, + `begin` time NOT NULL, + `end` time NOT NULL, + `dept` mediumint(8) NOT NULL, + `mode` varchar(255) NOT NULL, + `host` varchar(30) NOT NULL, + `participant` text NOT NULL, + `date` date NOT NULL, + `room` int(11) NOT NULL, + `minutes` text NOT NULL, + `minutedBy` varchar(30) NOT NULL, + `minutedDate` datetime NOT NULL, + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) 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; +CREATE TABLE `zt_meetingroom` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `position` varchar(30) NOT NULL, + `seats` int(11) NOT NULL, + `equipment` varchar(255) NOT NULL, + `openTime` varchar(255) 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; +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, + `from` mediumint(8) unsigned NOT NULL DEFAULT '0', + `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 AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_mr` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `hostID` mediumint(8) unsigned NOT NULL, + `sourceProject` varchar(50) NOT NULL, + `sourceBranch` varchar(100) NOT NULL, + `targetProject` varchar(50) NOT NULL, + `targetBranch` varchar(100) NOT NULL, + `mriid` int(10) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `description` text NOT NULL, + `assignee` varchar(255) NOT NULL, + `reviewer` varchar(255) NOT NULL, + `approver` varchar(255) 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', + `status` char(30) NOT NULL, + `mergeStatus` char(30) NOT NULL, + `approvalStatus` char(30) NOT NULL, + `needApproved` enum('0','1') NOT NULL DEFAULT '0', + `needCI` enum('0','1') NOT NULL DEFAULT '0', + `repoID` mediumint(8) unsigned NOT NULL, + `jobID` mediumint(8) unsigned NOT NULL, + `compileID` mediumint(8) unsigned NOT NULL, + `compileStatus` char(30) NOT NULL, + `removeSourceBranch` enum('0','1') NOT NULL DEFAULT '0', + `synced` enum('0','1') NOT NULL DEFAULT '1', + `syncError` varchar(255) NOT NULL, + `hasNoConflict` enum('0','1') NOT NULL DEFAULT '0', + `diffs` longtext, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_mrapproval` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `mrID` mediumint(8) unsigned NOT NULL, + `account` varchar(255) NOT NULL, + `date` datetime NOT NULL, + `action` char(30) NOT NULL, + `comment` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_nc` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `auditplan` mediumint(8) NOT NULL, + `listID` mediumint(8) NOT NULL, + `title` varchar(255) NOT NULL, + `desc` mediumtext NOT NULL, + `type` char(30) NOT NULL, + `status` varchar(30) NOT NULL DEFAULT 'active', + `severity` char(30) NOT NULL, + `deadline` date NOT NULL, + `resolvedBy` varchar(30) NOT NULL, + `resolution` char(30) NOT NULL, + `resolvedDate` date NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` date NOT NULL, + `parent` mediumint(8) unsigned NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` date NOT NULL, + `activateDate` date 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; +CREATE TABLE `zt_notify` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `objectType` varchar(50) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `action` mediumint(9) NOT NULL, + `toList` varchar(255) NOT NULL, + `ccList` text NOT NULL, + `subject` varchar(255) NOT NULL, + `data` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `sendTime` datetime NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'wait', + `failReason` text NOT NULL, + PRIMARY KEY (`id`), + KEY `objectType_toList_status` (`objectType`,`toList`,`status`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `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_object` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) NOT NULL, + `from` mediumint(8) NOT NULL, + `title` varchar(255) NOT NULL, + `category` char(30) NOT NULL, + `version` varchar(255) NOT NULL, + `type` enum('reviewed','taged') NOT NULL, + `range` text NOT NULL, + `data` text NOT NULL, + `storyEst` char(30) NOT NULL, + `taskEst` char(30) NOT NULL, + `requestEst` char(30) NOT NULL, + `testEst` char(30) NOT NULL, + `devEst` char(30) NOT NULL, + `designEst` char(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_opportunity` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `source` char(30) NOT NULL, + `type` char(30) NOT NULL, + `strategy` char(30) NOT NULL, + `status` varchar(30) NOT NULL DEFAULT 'active', + `impact` mediumint(8) NOT NULL, + `chance` mediumint(8) NOT NULL, + `ratio` mediumint(8) NOT NULL, + `pri` char(30) NOT NULL, + `identifiedDate` date NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` date NOT NULL, + `approvedDate` date NOT NULL, + `prevention` mediumtext NOT NULL, + `plannedClosedDate` date NOT NULL, + `actualClosedDate` date NOT NULL, + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `from` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `activatedBy` varchar(30) NOT NULL, + `activatedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `cancelReason` char(30) NOT NULL, + `hangupedBy` varchar(30) NOT NULL, + `hangupedDate` datetime NOT NULL, + `resolution` mediumtext NOT NULL, + `resolvedBy` varchar(30) NOT NULL, + `resolvedDate` datetime NOT NULL, + `lastCheckedBy` varchar(30) NOT NULL, + `lastCheckedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_overtime` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `year` char(4) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `start` time NOT NULL, + `finish` time NOT NULL, + `hours` float(4,1) unsigned NOT NULL DEFAULT '0.0', + `leave` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `status` varchar(30) NOT NULL DEFAULT '', + `rejectReason` varchar(100) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `reviewedBy` char(30) NOT NULL, + `reviewedDate` datetime NOT NULL, + `level` tinyint(3) NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `reviewers` text NOT NULL, + PRIMARY KEY (`id`), + KEY `year` (`year`), + KEY `type` (`type`), + KEY `status` (`status`), + KEY `createdBy` (`createdBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_pipeline` ( + `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` char(30) NOT NULL, + `name` varchar(50) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `account` varchar(30) DEFAULT NULL, + `password` varchar(255) NOT NULL, + `token` varchar(255) DEFAULT NULL, + `private` char(32) 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 `zt_planstory` ( + `plan` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL, + `order` mediumint(9) NOT NULL, + UNIQUE KEY `plan_story` (`plan`,`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_process` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `model` char(30) NOT NULL DEFAULT 'waterfall', + `name` varchar(255) NOT NULL, + `type` char(30) NOT NULL, + `abbr` char(30) NOT NULL, + `desc` mediumtext NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `order` mediumint(9) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_product` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `program` mediumint(8) unsigned NOT NULL, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `bind` enum('0','1') NOT NULL DEFAULT '0', + `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` mediumtext NOT NULL, + `PO` varchar(30) NOT NULL, + `QD` varchar(30) NOT NULL, + `RD` varchar(30) NOT NULL, + `feedback` varchar(30) NOT NULL, + `acl` enum('open','private','custom') NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `reviewer` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `createdVersion` varchar(20) NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `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, + `status` enum('wait','doing','done','closed') NOT NULL DEFAULT 'wait', + `desc` mediumtext NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `order` text NOT NULL, + `closedReason` varchar(20) 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_programactivity` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `process` mediumint(8) NOT NULL, + `activity` mediumint(8) NOT NULL, + `name` varchar(255) NOT NULL, + `content` text NOT NULL, + `reason` varchar(255) NOT NULL, + `result` char(30) NOT NULL, + `linkedBy` char(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_programoutput` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `process` mediumint(8) NOT NULL, + `activity` mediumint(8) NOT NULL, + `output` mediumint(8) NOT NULL, + `content` text NOT NULL, + `name` varchar(255) NOT NULL, + `reason` varchar(255) NOT NULL, + `result` char(30) NOT NULL, + `linkedBy` char(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_programprocess` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `process` mediumint(8) NOT NULL, + `name` varchar(255) NOT NULL, + `type` char(30) NOT NULL, + `abbr` char(30) NOT NULL, + `desc` text NOT NULL, + `reason` varchar(255) NOT NULL, + `linkedBy` char(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_programreport` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `template` mediumint(8) NOT NULL, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `params` text NOT NULL, + `content` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_project` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) NOT NULL DEFAULT '0', + `model` char(30) NOT NULL, + `type` char(30) NOT NULL DEFAULT 'sprint', + `lifetime` char(30) NOT NULL DEFAULT '', + `budget` varchar(30) NOT NULL DEFAULT '0', + `budgetUnit` char(30) NOT NULL DEFAULT 'CNY', + `attribute` varchar(30) NOT NULL DEFAULT '', + `percent` float unsigned NOT NULL DEFAULT '0', + `milestone` enum('0','1') NOT NULL DEFAULT '0', + `output` text NOT NULL, + `auth` char(30) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` varchar(255) NOT NULL, + `grade` tinyint(3) unsigned NOT NULL, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `realBegan` date NOT NULL, + `realEnd` date NOT NULL, + `days` smallint(5) unsigned NOT NULL, + `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL DEFAULT '', + `pri` enum('1','2','3','4') NOT NULL DEFAULT '1', + `desc` mediumtext NOT NULL, + `version` smallint(6) NOT NULL, + `parentVersion` smallint(6) NOT NULL, + `planDuration` int(11) NOT NULL, + `realDuration` int(11) NOT NULL, + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `openedVersion` varchar(20) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `canceledBy` varchar(30) NOT NULL DEFAULT '', + `canceledDate` datetime NOT NULL, + `suspendedDate` date 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` char(30) NOT NULL DEFAULT 'open', + `whitelist` text NOT NULL, + `order` mediumint(8) unsigned NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `displayCards` smallint(6) NOT NULL DEFAULT '0', + `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', + `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_projectadmin` ( + `group` smallint(6) NOT NULL, + `account` char(30) NOT NULL, + `programs` text NOT NULL, + `projects` text NOT NULL, + `products` text NOT NULL, + `executions` text NOT NULL, + UNIQUE KEY `group_account` (`group`, `account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectcase` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `case` mediumint(8) unsigned NOT NULL DEFAULT '0', + `count` mediumint(8) unsigned NOT NULL DEFAULT '1', + `version` smallint(6) NOT NULL DEFAULT '1', + `order` smallint(6) unsigned NOT NULL, + UNIQUE KEY `project` (`project`,`case`) +) 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` varchar(255) NOT NULL, + PRIMARY KEY (`project`,`product`,`branch`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectspec` ( + `project` mediumint(8) NOT NULL, + `version` smallint(6) NOT NULL, + `name` varchar(255) NOT NULL, + `milestone` enum('0','1') NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + UNIQUE KEY `project` (`project`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_projectstory` ( + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL, + `branch` 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`), + KEY `story` (`story`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relation` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) NOT NULL, + `product` mediumint(8) NOT NULL, + `execution` 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, + PRIMARY KEY (`id`), + UNIQUE KEY `relation` (`product`,`relation`,`AType`,`BType`,`AID`,`BID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_relationoftasks` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `execution` mediumint(8) unsigned NOT NULL, + `pretask` mediumint(8) unsigned NOT NULL, + `condition` enum('begin','end') NOT NULL, + `task` mediumint(8) unsigned NOT NULL, + `action` enum('begin','end') NOT NULL, + PRIMARY KEY (`id`), + KEY `relationoftasks` (`execution`,`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_release` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `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` mediumtext NOT NULL, + `mailto` text, + `notify` varchar(255) DEFAULT 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 `zt_repo` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `product` varchar(255) NOT NULL, + `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, + `serviceHost` varchar(50) NOT NULL, + `serviceProject` varchar(100) NOT NULL, + `commits` mediumint(8) unsigned NOT NULL, + `account` varchar(30) NOT NULL, + `password` varchar(30) NOT NULL, + `encrypt` varchar(30) NOT NULL DEFAULT 'plain', + `acl` text NOT NULL, + `synced` tinyint(1) NOT NULL DEFAULT '0', + `lastSync` datetime NOT NULL, + `desc` text NOT NULL, + `extra` char(30) NOT NULL, + `preMerge` enum('0','1') NOT NULL DEFAULT '0', + `job` mediumint(8) unsigned NOT NULL, + `fileServerUrl` text, + `fileServerAccount` varchar(40) NOT NULL DEFAULT '', + `fileServerPassword` varchar(100) NOT NULL DEFAULT '', + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `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 `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_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 `zt_report` ( + `id` mediumint(9) NOT NULL AUTO_INCREMENT, + `code` varchar(100) NOT NULL, + `name` text NOT NULL, + `module` varchar(100) NOT NULL, + `sql` text NOT NULL, + `vars` text NOT NULL, + `langs` text NOT NULL, + `params` text NOT NULL, + `step` tinyint(1) NOT NULL DEFAULT '2', + `desc` text NOT NULL, + `addedBy` char(30) NOT NULL, + `addedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=MyISAM AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_researchplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `customer` varchar(255) NOT NULL, + `stakeholder` varchar(255) NOT NULL, + `objective` varchar(255) NOT NULL, + `begin` datetime NOT NULL, + `end` datetime NOT NULL, + `location` varchar(255) NOT NULL, + `team` varchar(255) NOT NULL, + `method` enum('','videoConference','interview','questionnaire','telephoneInterview') NOT NULL, + `outline` mediumtext NOT NULL, + `schedule` mediumtext 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; +CREATE TABLE `zt_researchreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `relatedPlan` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `author` varchar(30) NOT NULL, + `content` mediumtext NOT NULL, + `customer` varchar(255) NOT NULL, + `researchObjects` varchar(255) NOT NULL, + `begin` datetime NOT NULL, + `end` datetime NOT NULL, + `location` varchar(255) NOT NULL, + `method` enum('','videoConference','interview','questionnaire','telephoneInterview') 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; +CREATE TABLE `zt_review` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `object` mediumint(8) NOT NULL, + `template` mediumint(8) NOT NULL, + `doc` mediumint(8) DEFAULT NULL, + `docVersion` smallint(6) NOT NULL, + `status` char(30) NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `auditedBy` varchar(255) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deadline` date NOT NULL, + `lastReviewedBy` varchar(255) DEFAULT NULL, + `lastReviewedDate` date NOT NULL, + `lastAuditedBy` varchar(255) NOT NULL, + `lastAuditedDate` date NOT NULL, + `lastEditedBy` varchar(255) NOT NULL, + `lastEditedDate` date NOT NULL, + `result` char(30) NOT NULL, + `auditResult` char(30) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_reviewcl` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `object` char(30) NOT NULL, + `category` char(30) NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `order` mediumint(8) DEFAULT '0', + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_reviewissue` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `review` mediumint(8) NOT NULL, + `approval` mediumint(8) NOT NULL, + `injection` mediumint(8) NOT NULL, + `identify` mediumint(8) NOT NULL, + `type` char(30) NOT NULL DEFAULT 'review', + `listID` mediumint(8) NOT NULL, + `title` varchar(255) NOT NULL, + `opinion` varchar(255) NOT NULL, + `opinionDate` date NOT NULL, + `status` char(30) NOT NULL, + `resolution` char(30) NOT NULL, + `resolutionBy` char(30) NOT NULL, + `resolutionDate` date NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_reviewlist` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `object` char(30) NOT NULL, + `category` char(30) NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedBy` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_reviewresult` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `review` mediumint(8) NOT NULL, + `type` char(30) NOT NULL DEFAULT 'review', + `result` char(30) NOT NULL, + `opinion` text NOT NULL, + `reviewer` char(30) NOT NULL, + `remainIssue` char(30) NOT NULL, + `createdDate` date NOT NULL, + `consumed` float NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `reviewer` (`review`,`reviewer`,`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_risk` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` varchar(255) NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `source` char(30) NOT NULL, + `category` char(30) NOT NULL, + `strategy` char(30) NOT NULL, + `status` varchar(30) NOT NULL DEFAULT 'active', + `impact` char(30) NOT NULL, + `probability` char(30) NOT NULL, + `rate` char(30) NOT NULL, + `pri` char(30) NOT NULL, + `identifiedDate` date NOT NULL, + `prevention` mediumtext NOT NULL, + `remedy` mediumtext NOT NULL, + `plannedClosedDate` date NOT NULL, + `actualClosedDate` date NOT NULL, + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `from` mediumint(8) unsigned NOT NULL DEFAULT '0', + `version` smallint(6) NOT NULL DEFAULT '1', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `resolution` mediumtext NOT NULL, + `resolvedBy` varchar(30) NOT NULL, + `activateBy` varchar(30) NOT NULL, + `activateDate` date NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` date NOT NULL, + `cancelBy` varchar(30) NOT NULL, + `cancelDate` date NOT NULL, + `cancelReason` char(30) NOT NULL, + `hangupBy` varchar(30) NOT NULL, + `hangupDate` date NOT NULL, + `trackedBy` varchar(30) NOT NULL, + `trackedDate` date NOT NULL, + `assignedDate` date NOT NULL, + `approvedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_riskissue` ( + `risk` mediumint(8) unsigned NOT NULL, + `issue` mediumint(8) unsigned NOT NULL, + UNIQUE KEY `risk_issue` (`risk`,`issue`) +) 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 `zt_searchdict` ( + `key` smallint(5) unsigned NOT NULL, + `value` char(3) NOT NULL, + PRIMARY KEY (`key`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_searchindex` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `objectType` char(20) NOT NULL, + `objectID` mediumint(9) NOT NULL, + `title` text NOT NULL, + `content` text NOT NULL, + `addedDate` datetime NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `object` (`objectType`,`objectID`), + KEY `addedDate` (`addedDate`), + FULLTEXT KEY `content` (`content`), + FULLTEXT KEY `title` (`title`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_serverroom` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + `city` varchar(128) NOT NULL, + `line` varchar(20) NOT NULL, + `bandwidth` varchar(128) NOT NULL, + `provider` varchar(128) NOT NULL, + `owner` varchar(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(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 `zt_service` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `external` enum('0','1') NOT NULL DEFAULT '0', + `port` smallint(5) unsigned NOT NULL, + `entry` varchar(255) NOT NULL, + `deploy` varchar(255) NOT NULL, + `version` varchar(64) NOT NULL, + `color` char(7) NOT NULL, + `desc` mediumtext, + `dept` varchar(128) NOT NULL, + `devel` varchar(30) NOT NULL, + `qa` varchar(30) NOT NULL, + `ops` varchar(30) NOT NULL, + `hosts` text, + `softName` varchar(128) NOT NULL, + `softVersion` varchar(128) NOT NULL, + `type` varchar(20) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime 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(5) unsigned NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_solutions` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `contents` text NOT NULL COMMENT '问题描述', + `support` text NOT NULL COMMENT '是否需要高层支持', + `measures` text NOT NULL COMMENT '解决建议', + `type` char(30) NOT NULL, + `addedBy` varchar(30) NOT NULL, + `addedDate` date NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_sqlview` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(90) NOT NULL, + `code` varchar(45) NOT NULL, + `sql` 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; +CREATE TABLE `zt_stage` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `percent` varchar(255) NOT NULL, + `type` varchar(255) 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 AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_stakeholder` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, + `objectID` mediumint(8) NOT NULL, + `objectType` char(30) NOT NULL, + `user` char(30) NOT NULL, + `type` char(30) NOT NULL, + `key` enum('0','1') NOT NULL, + `from` char(30) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` date NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL, + KEY `objectID` (`objectID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_story` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `parent` mediumint(9) NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `plan` text, + `source` varchar(20) NOT NULL, + `sourceNote` varchar(255) NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `feedback` mediumint(8) unsigned NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL, + `keywords` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL DEFAULT 'story', + `category` varchar(30) NOT NULL DEFAULT 'feature', + `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, + `lib` mediumint(8) unsigned NOT NULL DEFAULT '0', + `fromStory` mediumint(8) unsigned NOT NULL DEFAULT '0', + `fromVersion` smallint(6) NOT NULL DEFAULT '1', + `openedBy` varchar(30) NOT NULL DEFAULT '', + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL DEFAULT '', + `assignedDate` datetime NOT NULL, + `approvedDate` date NOT NULL, + `lastEditedBy` varchar(30) NOT NULL DEFAULT '', + `lastEditedDate` datetime NOT NULL, + `changedBy` VARCHAR(30) NOT NULL, + `changedDate` DATETIME NOT NULL, + `reviewedBy` varchar(255) NOT NULL, + `reviewedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `closedBy` varchar(30) NOT NULL DEFAULT '', + `closedDate` datetime NOT NULL, + `closedReason` varchar(30) NOT NULL, + `activatedDate` datetime 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', + `storyChanged` enum('0','1') NOT NULL DEFAULT '0', + `feedbackBy` varchar(100) NOT NULL, + `notifyEmail` varchar(100) NOT NULL, + `URChanged` enum('0','1') NOT NULL DEFAULT '0', + `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_storyestimate` ( + `story` mediumint(9) NOT NULL, + `round` smallint(6) NOT NULL, + `estimate` text NOT NULL, + `average` float NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + UNIQUE KEY `story` (`story`,`round`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_storyreview` ( + `story` mediumint(9) NOT NULL, + `version` smallint(6) NOT NULL, + `reviewer` varchar(30) NOT NULL, + `result` varchar(30) NOT NULL, + `reviewDate` datetime NOT NULL, + UNIQUE KEY `story` (`story`,`version`,`reviewer`) +) 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` mediumtext NOT NULL, + `verify` mediumtext NOT NULL, + UNIQUE KEY `story` (`story`,`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `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, + `project` mediumint(8) unsigned NOT NULL, + `parent` mediumint(8) NOT NULL DEFAULT '0', + `execution` mediumint(8) unsigned NOT NULL DEFAULT '0', + `module` mediumint(8) unsigned NOT NULL DEFAULT '0', + `design` mediumint(8) unsigned NOT NULL, + `story` mediumint(8) unsigned NOT NULL DEFAULT '0', + `storyVersion` smallint(6) NOT NULL DEFAULT '1', + `designVersion` smallint(6) unsigned NOT NULL, + `fromBug` mediumint(8) unsigned NOT NULL DEFAULT '0', + `fromIssue` mediumint(8) unsigned NOT NULL DEFAULT '0', + `feedback` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `type` varchar(20) NOT NULL, + `mode` varchar(10) 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` mediumtext NOT NULL, + `version` smallint(6) NOT NULL, + `openedBy` varchar(30) NOT NULL, + `openedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `estStarted` date NOT NULL, + `realStarted` datetime NOT NULL, + `finishedBy` varchar(30) NOT NULL, + `finishedDate` datetime NOT NULL, + `finishedList` text NOT NULL, + `canceledBy` varchar(30) NOT NULL, + `canceledDate` datetime NOT NULL, + `closedBy` varchar(30) NOT NULL, + `closedDate` datetime NOT NULL, + `planDuration` int(11) NOT NULL, + `realDuration` int(11) NOT NULL, + `closedReason` varchar(30) NOT NULL, + `lastEditedBy` varchar(30) NOT NULL, + `lastEditedDate` datetime NOT NULL, + `activatedDate` datetime NOT NULL, + `repo` mediumint(8) unsigned NOT NULL, + `mr` 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, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + PRIMARY KEY (`id`), + KEY `execution` (`execution`), + KEY `story` (`story`), + KEY `parent` (`parent`), + KEY `assignedTo` (`assignedTo`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskestimate` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `task` mediumint(8) unsigned NOT NULL DEFAULT '0', + `date` date NOT NULL, + `left` float unsigned NOT NULL DEFAULT '0', + `consumed` float unsigned NOT NULL, + `account` char(30) NOT NULL DEFAULT '', + `work` text, + PRIMARY KEY (`id`), + KEY `task` (`task`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_taskspec` ( + `task` mediumint(8) NOT NULL, + `version` smallint(6) NOT NULL, + `name` varchar(255) NOT NULL, + `estStarted` date NOT NULL, + `deadline` date NOT NULL, + UNIQUE KEY `task` (`task`,`version`) +) 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','execution') NOT NULL DEFAULT 'project', + `account` char(30) NOT NULL DEFAULT '', + `role` char(30) NOT NULL DEFAULT '', + `position` varchar(30) NOT NULL, + `limited` char(8) NOT NULL DEFAULT 'no', + `join` date NOT NULL DEFAULT '0000-00-00', + `days` smallint(5) unsigned NOT NULL, + `hours` float(3,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, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `execution` mediumint(8) unsigned NOT NULL, + `tasks` varchar(255) NOT NULL, + `builds` varchar(255) NOT NULL, + `title` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `owner` char(30) NOT NULL, + `members` text NOT NULL, + `stories` text NOT NULL, + `bugs` text NOT NULL, + `cases` text NOT NULL, + `report` text NOT NULL, + `objectType` varchar(20) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_testresult` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `run` mediumint(8) unsigned NOT NULL, + `case` mediumint(8) unsigned NOT NULL, + `version` smallint(5) unsigned NOT NULL, + `job` mediumint(8) unsigned NOT NULL, + `compile` mediumint(8) unsigned NOT NULL, + `caseResult` char(30) NOT NULL, + `stepResults` text NOT NULL, + `lastRunner` varchar(30) NOT NULL, + `date` datetime NOT NULL, + `duration` float NOT NULL, + `xml` text NOT NULL, + `deploy` mediumint(8) unsigned 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, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `desc` mediumtext 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, + `project` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL, + `name` char(90) NOT NULL, + `execution` mediumint(8) unsigned NOT NULL DEFAULT '0', + `build` char(30) NOT NULL, + `type` varchar(255) NOT NULL DEFAULT '', + `owner` varchar(30) NOT NULL, + `pri` tinyint(3) unsigned NOT NULL DEFAULT '0', + `begin` date NOT NULL, + `end` date NOT NULL, + `realFinishedDate` datetime NOT NULL, + `mailto` text, + `desc` mediumtext NOT NULL, + `report` text NOT NULL, + `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `testreport` mediumint(8) unsigned NOT NULL, + `auto` varchar(10) NOT NULL DEFAULT 'no', + `subStatus` varchar(30) NOT NULL DEFAULT '', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `product` (`product`), + KEY `build` (`build`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_todo` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `account` char(30) NOT NULL, + `date` date NOT NULL, + `begin` smallint(4) unsigned zerofill NOT NULL, + `end` smallint(4) unsigned zerofill NOT NULL, + `feedback` mediumint(8) unsigned NOT NULL, + `type` char(15) 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` mediumtext 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, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + PRIMARY KEY (`id`), + KEY `account` (`account`), + KEY `assignedTo` (`assignedTo`), + KEY `finishedBy` (`finishedBy`), + KEY `date` (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_traincategory` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` char(30) NOT NULL DEFAULT '', + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `grade` tinyint(3) NOT NULL, + `order` mediumint(8) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `parent` (`parent`), + KEY `path` (`path`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_traincontents` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `code` varchar(50) NOT NULL, + `course` mediumint(8) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL, + `type` varchar(30) NOT NULL, + `parent` mediumint(8) unsigned NOT NULL DEFAULT '0', + `path` char(255) NOT NULL DEFAULT '', + `desc` text NOT NULL, + `order` mediumint(8) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `deleted` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_traincourse` ( + `id` mediumint(8) NOT NULL AUTO_INCREMENT, + `code` varchar(50) NOT NULL, + `category` mediumint(8) NOT NULL, + `name` varchar(255) NOT NULL, + `status` varchar(10) NOT NULL, + `teacher` varchar(30) NOT NULL DEFAULT '', + `desc` mediumtext NOT NULL, + `createdBy` varchar(255) NOT NULL, + `createdDate` date NOT NULL, + `editedBy` varchar(255) NOT NULL, + `editedDate` date NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_trainplan` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `place` varchar(255) NOT NULL, + `trainee` text NOT NULL, + `lecturer` varchar(20) NOT NULL, + `type` enum('inside','outside') NOT NULL DEFAULT 'inside', + `status` varchar(20) NOT NULL, + `summary` mediumtext NOT NULL, + `createdBy` char(30) DEFAULT 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 `zt_trainrecords` ( + `user` char(30) NOT NULL, + `objectId` mediumint(8) unsigned NOT NULL, + `objectType` varchar(10) NOT NULL, + `status` varchar(10) NOT NULL, + PRIMARY KEY (`user`,`objectId`,`objectType`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_trip` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` enum('trip','egress') NOT NULL DEFAULT 'trip', + `customers` varchar(20) NOT NULL, + `name` char(30) NOT NULL, + `desc` text NOT NULL, + `year` char(4) NOT NULL, + `begin` date NOT NULL, + `end` date NOT NULL, + `start` time NOT NULL, + `finish` time NOT NULL, + `from` char(50) NOT NULL, + `to` char(50) NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `year` (`year`), + KEY `createdBy` (`createdBy`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_user` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `company` mediumint(8) unsigned NOT NULL, + `type` char(30) NOT NULL DEFAULT 'inside', + `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 '', + `pinyin` varchar(255) NOT NULL DEFAULT '', + `nickname` char(60) NOT NULL DEFAULT '', + `commiter` varchar(100) NOT NULL, + `avatar` text NOT NULL, + `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 '', + `nature` text NOT NULL, + `analysis` text NOT NULL, + `strategy` text NOT NULL, + `join` date NOT NULL DEFAULT '0000-00-00', + `visits` mediumint(8) unsigned NOT NULL DEFAULT '0', + `visions` varchar(20) NOT NULL DEFAULT 'rnd,lite', + `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', + `feedback` enum('0','1') NOT NULL DEFAULT '0', + `ranzhi` char(30) NOT NULL DEFAULT '', + `ldap` char(30) NOT NULL, + `score` int(11) NOT NULL DEFAULT '0', + `scoreLevel` int(11) NOT NULL DEFAULT '0', + `resetToken` varchar(50) NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `clientStatus` enum('online','away','busy','offline','meeting') NOT NULL DEFAULT 'offline', + `clientLang` varchar(10) NOT NULL DEFAULT 'zh-cn', + PRIMARY KEY (`id`), + UNIQUE KEY `account` (`account`), + KEY `dept` (`dept`), + KEY `email` (`email`), + KEY `commiter` (`commiter`), + KEY `deleted` (`deleted`) +) ENGINE=MyISAM AUTO_INCREMENT=2 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', + `project` text NOT NULL, + 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', + `common` 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, + `programs` mediumtext NOT NULL, + `products` mediumtext NOT NULL, + `projects` mediumtext NOT NULL, + `sprints` mediumtext NOT NULL, + UNIQUE KEY `account` (`account`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_vm` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `hostID` int(10) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) NOT NULL DEFAULT '', + `osCategory` varchar(50) NOT NULL DEFAULT '', + `osType` varchar(50) NOT NULL DEFAULT '', + `osArch` varchar(50) NOT NULL DEFAULT '', + `osLang` varchar(50) NOT NULL DEFAULT '', + `osCpu` tinyint(2) NOT NULL DEFAULT 0, + `osMemory` smallint(6) NOT NULL DEFAULT 0, + `osDisk` smallint(6) NOT NULL DEFAULT 0, + `status` varchar(50) NOT NULL DEFAULT '', + `destroyAt` datetime DEFAULT NULL, + `macAddress` varchar(255) NOT NULL DEFAULT '', + `workspace` varchar(255) NOT NULL DEFAULT '', + `templateID` int(10) unsigned NOT NULL DEFAULT '0', + `baseImageID` int(10) unsigned NOT NULL DEFAULT '0', + `baseImagePath` varchar(255) NOT NULL DEFAULT '', + `desc` varchar(255) NOT NULL DEFAULT '', + `heatbeat` datetime DEFAULT NULL, + `vncPort` int(10) NOT NULL DEFAULT 0, + `instance` varchar(255) NOT NULL DEFAULT '', + `eip` varchar(255) NOT NULL DEFAULT '', + `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', + `public` varchar(50) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_vmtemplate` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `hostID` int(10) unsigned NOT NULL DEFAULT '0', + `templateName` varchar(255) NOT NULL DEFAULT '', + `osType` varchar(50) NOT NULL DEFAULT '', + `osCategory` varchar(50) NOT NULL DEFAULT '', + `osVersion` varchar(50) NOT NULL DEFAULT '', + `osLang` varchar(50) NOT NULL, + `cpuCoreNum` smallint(4) NOT NULL DEFAULT 0, + `memorySize` int NOT NULL DEFAULT 0, + `diskSize` int NOT NULL DEFAULT 0, + `osArch` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_webhook` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(15) 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, + `executions` 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; +CREATE TABLE `zt_weeklyreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `weekStart` date NOT NULL, + `pv` float(9,2) NOT NULL, + `ev` float(9,2) NOT NULL, + `ac` float(9,2) NOT NULL, + `sv` float(9,2) NOT NULL, + `cv` float(9,2) NOT NULL, + `staff` smallint(5) unsigned NOT NULL, + `progress` varchar(255) NOT NULL, + `workload` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `week` (`project`,`weekStart`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workestimation` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `project` mediumint(8) unsigned NOT NULL, + `scale` decimal(10,2) unsigned NOT NULL, + `productivity` decimal(10,2) unsigned NOT NULL, + `duration` decimal(10,2) unsigned NOT NULL, + `unitLaborCost` decimal(10,2) unsigned NOT NULL, + `totalLaborCost` decimal(10,2) unsigned NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `assignedTo` varchar(30) NOT NULL, + `assignedDate` datetime NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', + `dayHour` decimal(10,2) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflow` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `parent` varchar(30) NOT NULL, + `child` varchar(30) NOT NULL, + `type` varchar(10) NOT NULL DEFAULT 'flow', + `navigator` varchar(10) NOT NULL, + `app` varchar(20) NOT NULL, + `position` varchar(30) NOT NULL, + `module` varchar(30) NOT NULL, + `table` varchar(50) NOT NULL, + `name` varchar(30) NOT NULL, + `titleField` varchar(30) NOT NULL, + `contentField` text NOT NULL, + `flowchart` text NOT NULL, + `js` text NOT NULL, + `css` text NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `buildin` tinyint(1) unsigned NOT NULL, + `administrator` text NOT NULL, + `desc` text NOT NULL, + `version` varchar(10) NOT NULL DEFAULT '1.0', + `status` varchar(10) NOT NULL DEFAULT 'wait', + `approval` enum('enabled', 'disabled') NOT NULL DEFAULT 'disabled', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`app`,`module`,`vision`), + KEY `type` (`type`), + KEY `app` (`app`), + KEY `module` (`module`), + KEY `order` (`order`) +) ENGINE=MyISAM AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowaction` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `action` varchar(50) NOT NULL, + `method` varchar(50) NOT NULL, + `name` varchar(50) NOT NULL, + `type` enum('single','batch') NOT NULL DEFAULT 'single', + `batchMode` enum('same','different') NOT NULL DEFAULT 'different', + `extensionType` varchar(10) NOT NULL DEFAULT 'override' COMMENT 'none | extend | override', + `open` varchar(20) NOT NULL, + `position` enum('menu','browseandview','browse','view') NOT NULL DEFAULT 'browseandview', + `layout` char(20) NOT NULL, + `show` enum('dropdownlist','direct') NOT NULL DEFAULT 'dropdownlist', + `order` smallint(5) unsigned NOT NULL, + `buildin` tinyint(1) unsigned NOT NULL, + `role` varchar(10) NOT NULL DEFAULT 'custom', + `virtual` tinyint(1) unsigned NOT NULL, + `conditions` text NOT NULL, + `verifications` text NOT NULL, + `hooks` text NOT NULL, + `linkages` text NOT NULL, + `js` text NOT NULL, + `css` text NOT NULL, + `toList` char(255) NOT NULL, + `blocks` text NOT NULL, + `desc` text NOT NULL, + `status` varchar(10) NOT NULL DEFAULT 'enable', + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`module`,`action`,`vision`), + KEY `module` (`module`), + KEY `action` (`action`), + KEY `order` (`order`) +) ENGINE=MyISAM AUTO_INCREMENT=190 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowdatasource` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` enum('system','sql','func','option','lang','category') NOT NULL DEFAULT 'option', + `name` varchar(30) NOT NULL, + `code` varchar(30) NOT NULL, + `datasource` text NOT NULL, + `view` varchar(20) NOT NULL, + `keyField` varchar(50) NOT NULL, + `valueField` varchar(50) NOT NULL, + `buildin` tinyint(1) unsigned NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `type` (`type`) +) ENGINE=MyISAM AUTO_INCREMENT=71 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowfield` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `field` varchar(50) NOT NULL, + `type` varchar(20) NOT NULL DEFAULT 'varchar', + `length` varchar(10) NOT NULL, + `name` varchar(50) NOT NULL, + `control` varchar(20) NOT NULL, + `expression` text NOT NULL, + `options` text NOT NULL, + `default` varchar(100) NOT NULL, + `rules` varchar(255) NOT NULL, + `placeholder` varchar(100) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `searchOrder` smallint(5) unsigned NOT NULL DEFAULT '0', + `exportOrder` smallint(5) unsigned NOT NULL DEFAULT '0', + `canExport` enum('0','1') NOT NULL DEFAULT '0', + `canSearch` enum('0','1') NOT NULL DEFAULT '0', + `isValue` enum('0','1') NOT NULL DEFAULT '0', + `readonly` enum('0','1') NOT NULL DEFAULT '0', + `buildin` tinyint(1) unsigned NOT NULL, + `role` varchar(10) NOT NULL DEFAULT 'custom', + `desc` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`module`,`field`), + KEY `module` (`module`), + KEY `field` (`field`), + KEY `order` (`order`) +) ENGINE=MyISAM AUTO_INCREMENT=360 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowlabel` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `action` varchar(30) NOT NULL DEFAULT 'browse', + `code` varchar(30) NOT NULL, + `label` varchar(255) NOT NULL, + `params` text NOT NULL, + `orderBy` text NOT NULL, + `order` tinyint(3) NOT NULL, + `buildin` tinyint(1) unsigned NOT NULL, + `role` varchar(10) NOT NULL DEFAULT 'custom', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `module` (`module`) +) ENGINE=MyISAM AUTO_INCREMENT=53 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowlayout` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `action` varchar(50) NOT NULL, + `field` varchar(50) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + `width` smallint(5) NOT NULL, + `position` text NOT NULL, + `readonly` enum('0','1') NOT NULL DEFAULT '0', + `mobileShow` enum('0','1') NOT NULL DEFAULT '1', + `summary` varchar(20) NOT NULL, + `defaultValue` text NOT NULL, + `layoutRules` varchar(255) NOT NULL, + `vision` varchar(10) NOT NULL DEFAULT 'rnd', + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`module`,`action`,`field`,`vision`), + KEY `module` (`module`), + KEY `action` (`action`), + KEY `order` (`order`) +) ENGINE=MyISAM AUTO_INCREMENT=138 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowlinkdata` ( + `objectType` varchar(30) NOT NULL, + `objectID` mediumint(8) unsigned NOT NULL, + `linkedType` varchar(30) NOT NULL, + `linkedID` mediumint(8) unsigned NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + UNIQUE KEY `unique` (`objectType`,`objectID`,`linkedType`,`linkedID`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowrelation` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `prev` varchar(30) NOT NULL, + `next` varchar(30) NOT NULL, + `field` varchar(50) NOT NULL, + `actions` varchar(20) NOT NULL, + `actionCodes` text NOT NULL, + `buildin` enum('0','1') NOT NULL DEFAULT '0', + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowrelationlayout` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `prev` varchar(30) NOT NULL, + `next` varchar(30) NOT NULL, + `action` varchar(50) NOT NULL, + `field` varchar(50) NOT NULL, + `order` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique` (`prev`,`next`,`action`,`field`), + KEY `prev` (`prev`), + KEY `next` (`next`), + KEY `action` (`action`), + KEY `order` (`order`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowreport` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL COMMENT 'module name', + `name` varchar(100) NOT NULL COMMENT 'report name', + `type` enum('pie','line','bar') NOT NULL DEFAULT 'pie' COMMENT 'report type', + `countType` enum('sum','count') NOT NULL DEFAULT 'sum' COMMENT 'report count method', + `displayType` enum('value','percent') NOT NULL DEFAULT 'value' COMMENT 'report display method', + `dimension` varchar(130) NOT NULL COMMENT 'dimension field code of zt_workflowfield', + `fields` text NOT NULL COMMENT 'count fileds code of zt_workflowfield,use comma split', + `order` smallint(5) unsigned NOT NULL DEFAULT '0', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowrule` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `type` enum('system','regex','func') NOT NULL DEFAULT 'regex', + `name` varchar(30) NOT NULL, + `rule` text NOT NULL, + `createdBy` char(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` char(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `type` (`type`) +) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowsql` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `field` varchar(50) NOT NULL, + `action` varchar(50) NOT NULL, + `sql` text NOT NULL, + `vars` text NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `module` (`module`), + KEY `field` (`field`), + KEY `action` (`action`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_workflowversion` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `module` varchar(30) NOT NULL, + `version` varchar(10) NOT NULL, + `fields` text NOT NULL, + `actions` text NOT NULL, + `layouts` text NOT NULL, + `sqls` text NOT NULL, + `labels` text NOT NULL, + `table` text NOT NULL, + `datas` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `moduleversion` (`module`,`version`), + KEY `module` (`module`), + KEY `version` (`version`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE `zt_zoutput` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `activity` mediumint(8) NOT NULL, + `name` varchar(255) NOT NULL, + `content` mediumtext NOT NULL, + `optional` char(20) NOT NULL, + `tailorNorm` varchar(255) NOT NULL, + `status` varchar(30) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, + `order` mediumint(8) DEFAULT '0', + `deleted` enum('0','1') NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=130 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_dayactions` AS SELECT + 1 AS `actions`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daybugopen` AS SELECT + 1 AS `bugopen`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daybugresolve` AS SELECT + 1 AS `bugresolve`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_dayeffort` AS SELECT + 1 AS `consumed`, + 1 AS `date`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daystoryclose` AS SELECT + 1 AS `storyclose`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daystoryopen` AS SELECT + 1 AS `storyopen`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daytaskfinish` AS SELECT + 1 AS `taskfinish`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_daytaskopen` AS SELECT + 1 AS `taskopen`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_dayuserlogin` AS SELECT + 1 AS `userlogin`, + 1 AS `day`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_executionsummary` AS SELECT + 1 AS `execution`, + 1 AS `estimate`, + 1 AS `consumed`, + 1 AS `left`, + 1 AS `number`, + 1 AS `undone`, + 1 AS `totalReal`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_productbugs` AS SELECT + 1 AS `product`, + 1 AS `bugs`, + 1 AS `resolutions`, + 1 AS `seriousBugs`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_productstories` AS SELECT + 1 AS `product`, + 1 AS `stories`, + 1 AS `undone`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_projectbugs` AS SELECT + 1 AS `execution`, + 1 AS `bugs`, + 1 AS `resolutions`, + 1 AS `seriousBugs`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_projectstories` AS SELECT + 1 AS `execution`, + 1 AS `stories`, + 1 AS `undone`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_projectsummary` AS SELECT + 1 AS `project`, + 1 AS `estimate`, + 1 AS `consumed`, + 1 AS `left`, + 1 AS `number`, + 1 AS `undone`, + 1 AS `totalReal`*/; +SET character_set_client = @saved_cs_client; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `ztv_projectteams` AS SELECT + 1 AS `execution`, + 1 AS `teams`*/; +SET character_set_client = @saved_cs_client; +/*!50001 DROP VIEW IF EXISTS `view_datasource_10`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_10` AS select `zt_build`.`id` AS `id`,`zt_build`.`name` AS `name` from `zt_build` where (`zt_build`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_11`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_11` AS select `zt_module`.`id` AS `id`,`zt_module`.`name` AS `name` from `zt_module` where (`zt_module`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_12`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_12` AS select `zt_productplan`.`id` AS `id`,`zt_productplan`.`title` AS `title` from `zt_productplan` where (`zt_productplan`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_4`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_4` AS select `zt_story`.`id` AS `id`,`zt_story`.`title` AS `title` from `zt_story` where (`zt_story`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_41`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_41` AS select `zt_case`.`id` AS `id`,`zt_case`.`title` AS `title` from `zt_case` where (`zt_case`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_46`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_46` AS select `zt_task`.`id` AS `id`,`zt_task`.`name` AS `name` from `zt_task` where ((`zt_task`.`deleted` = '0') and (`zt_task`.`vision` = 'lite')) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_5`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_5` AS select `zt_task`.`id` AS `id`,`zt_task`.`name` AS `name` from `zt_task` where ((`zt_task`.`deleted` = '0') and (`zt_task`.`vision` = 'rnd')) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `view_datasource_6`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `view_datasource_6` AS select `zt_bug`.`id` AS `id`,`zt_bug`.`title` AS `title` from `zt_bug` where (`zt_bug`.`deleted` = '0') */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_dayactions`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_dayactions` AS select count(0) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daybugopen`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daybugopen` AS select count(0) AS `bugopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daybugresolve`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daybugresolve` AS select count(0) AS `bugresolve`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'resolved')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_dayeffort`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_dayeffort` AS select round(sum(`zt_effort`.`consumed`),1) AS `consumed`,`zt_effort`.`date` AS `date` from `zt_effort` group by `zt_effort`.`date` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daystoryclose`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daystoryclose` AS select count(0) AS `storyclose`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'story') and (`zt_action`.`action` = 'closed')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daystoryopen`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daystoryopen` AS select count(0) AS `storyopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'story') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daytaskfinish`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daytaskfinish` AS select count(0) AS `taskfinish`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'task') and (`zt_action`.`action` = 'finished')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_daytaskopen`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_daytaskopen` AS select count(0) AS `taskopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'task') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_dayuserlogin`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_dayuserlogin` AS select count(0) AS `userlogin`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'user') and (`zt_action`.`action` = 'login')) group by left(`zt_action`.`date`,10) */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_executionsummary`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_executionsummary` AS select `zt_task`.`execution` AS `execution`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`estimate`,0)) AS `estimate`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0)) AS `consumed`,sum(if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0)) AS `left`,count(0) AS `number`,sum(if(((`zt_task`.`status` <> 'done') and (`zt_task`.`status` <> 'closed')),1,0)) AS `undone`,sum((if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0) + if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0))) AS `totalReal` from `zt_task` where (`zt_task`.`deleted` = '0') group by `zt_task`.`execution` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_productbugs`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_productbugs` AS select `zt_bug`.`product` AS `product`,count(0) AS `bugs`,sum(if((`zt_bug`.`resolution` = ''),0,1)) AS `resolutions`,sum(if((`zt_bug`.`severity` <= 2),1,0)) AS `seriousBugs` from `zt_bug` where (`zt_bug`.`deleted` = '0') group by `zt_bug`.`product` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_productstories`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_productstories` AS select `zt_story`.`product` AS `product`,count('*') AS `stories`,sum(if((`zt_story`.`status` = 'closed'),0,1)) AS `undone` from `zt_story` where (`zt_story`.`deleted` = '0') group by `zt_story`.`product` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_projectbugs`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_projectbugs` AS select `zt_bug`.`execution` AS `execution`,count(0) AS `bugs`,sum(if((`zt_bug`.`resolution` = ''),0,1)) AS `resolutions`,sum(if((`zt_bug`.`severity` <= 2),1,0)) AS `seriousBugs` from `zt_bug` where (`zt_bug`.`deleted` = '0') group by `zt_bug`.`execution` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_projectstories`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_projectstories` AS select `t1`.`project` AS `execution`,count('*') AS `stories`,sum(if((`t2`.`status` = 'closed'),0,1)) AS `undone` from ((`zt_projectstory` `t1` left join `zt_story` `t2` on((`t1`.`story` = `t2`.`id`))) left join `zt_project` `t3` on((`t1`.`project` = `t3`.`id`))) where ((`t2`.`deleted` = '0') and (`t3`.`type` in ('sprint','stage'))) group by `t1`.`project` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_projectsummary`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_projectsummary` AS select `zt_task`.`project` AS `project`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`estimate`,0)) AS `estimate`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0)) AS `consumed`,sum(if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0)) AS `left`,count(0) AS `number`,sum(if(((`zt_task`.`status` <> 'done') and (`zt_task`.`status` <> 'closed')),1,0)) AS `undone`,sum((if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0) + if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0))) AS `totalReal` from `zt_task` where (`zt_task`.`deleted` = '0') group by `zt_task`.`project` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!50001 DROP VIEW IF EXISTS `ztv_projectteams`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `ztv_projectteams` AS select `zt_team`.`root` AS `execution`,count('*') AS `teams` from `zt_team` where (`zt_team`.`type` = 'execution') group by `zt_team`.`root` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; diff --git a/db/update17.3.sql b/db/update17.3.sql new file mode 100644 index 0000000000..d883ea35f2 --- /dev/null +++ b/db/update17.3.sql @@ -0,0 +1,16 @@ +ALTER TABLE `zt_mr` CHANGE COLUMN `gitlabID` `hostID` mediumint(8) UNSIGNED NOT NULL AFTER `id`; +ALTER TABLE `zt_mr` MODIFY COLUMN `sourceProject` varchar(50) NOT NULL AFTER `hostID`; +ALTER TABLE `zt_mr` MODIFY COLUMN `targetProject` varchar(50) NOT NULL AFTER `sourceBranch`; +UPDATE `zt_project` SET `status`='closed' WHERE `type` IN ('sprint', 'stage', 'kanban') AND `model`='' AND `status` = 'done'; +ALTER TABLE `zt_repo` ADD COLUMN `serviceHost` varchar(50) NOT NULL AFTER `client`; +ALTER TABLE `zt_repo` ADD COLUMN `serviceProject` varchar(100) NOT NULL AFTER `serviceHost`; +UPDATE `zt_repo` SET `serviceHost` = `client`, `serviceProject` = `path` WHERE `SCM` = 'Gitlab' AND `client` <> '' AND `path` <> ''; +UPDATE `zt_repo` SET `client` = '', `path` = '' WHERE `SCM` = 'Gitlab'; + +UPDATE `zt_workflowfield` SET `options`='user' WHERE `buildin`='1' AND `options`='8'; +INSERT IGNORE INTO `zt_workflowfield` (`module`, `field`, `type`, `length`, `name`, `control`, `expression`, `options`, `default`, `rules`, `placeholder`, `order`, `searchOrder`, `exportOrder`, `canExport`, `canSearch`, `isValue`, `readonly`, `buildin`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES +('testtask', 'execution', 'mediumint', '8', '所属执行', 'select', '', '44', '0', '', '', 5, 0, 0, '0', '1', '0', '1', 1, '', '', '2022-03-18 09:16:38', '', '0000-00-00 00:00:00'), +('testcase', 'execution', 'mediumint', '8', '所属执行', 'select', '', '44', '0', '', '', 4, 0, 0, '0', '1', '0', '1', 1, '', '', '2022-03-18 09:16:38', '', '0000-00-00 00:00:00'), +('task', 'execution', 'mediumint', '8', '所属执行', 'select', '', '44', '0', '', '', 4, 0, 0, '0', '1', '0', '1', 1, '', '', '2022-03-18 09:16:38', '', '0000-00-00 00:00:00'), +('bug', 'execution', 'mediumint', '8', '所属执行', 'select', '', '44', '0', '', '', 6, 0, 0, '0', '1', '0', '1', 1, '', '', '2022-03-18 09:16:38', '', '0000-00-00 00:00:00'), +('build', 'execution', 'mediumint', '8', '所属执行', 'select', '', '44', '0', '', '', 5, 0, 0, '0', '1', '0', '1', 1, '', '', '2022-03-18 09:16:38', '', '0000-00-00 00:00:00'); diff --git a/db/update17.4.sql b/db/update17.4.sql new file mode 100644 index 0000000000..ff29c01259 --- /dev/null +++ b/db/update17.4.sql @@ -0,0 +1,31 @@ +ALTER TABLE `zt_task` ADD `order` mediumint(8) NOT NULL DEFAULT 0 AFTER `activatedDate`; +ALTER TABLE `zt_task` ADD INDEX `order` (`order`); +ALTER TABLE `zt_story` ADD COLUMN `linkRequirements` varchar(255) NOT NULL AFTER `linkStories`; + +ALTER TABLE `zt_productplan` ADD `createdBy` varchar(30) NOT NULL AFTER `closedReason`; +ALTER TABLE `zt_productplan` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; + +ALTER TABLE `zt_release` ADD `createdBy` varchar(30) NOT NULL AFTER `subStatus`; +ALTER TABLE `zt_release` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; + +ALTER TABLE `zt_testtask` ADD `createdBy` varchar(30) NOT NULL AFTER `subStatus`; +ALTER TABLE `zt_testtask` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; + +ALTER TABLE `zt_build` ADD `createdBy` varchar(30) NOT NULL AFTER `desc`; +ALTER TABLE `zt_build` ADD `createdDate` datetime NOT NULL AFTER `createdBy`; + +INSERT IGNORE INTO `zt_workflowfield` (`module`, `field`, `type`, `length`, `name`, `control`, `expression`, `options`, `default`, `rules`, `placeholder`, `order`, `searchOrder`, `exportOrder`, `canExport`, `canSearch`, `isValue`, `readonly`, `buildin`, `role`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES +('testtask', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 393, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('testtask', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 394, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('productplan', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 11, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('productplan', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 12, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('build', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('build', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('release', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 14, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), +('release', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'); + +UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='feedbackType' ORDER BY `id` DESC LIMIT 1) WHERE `module`='feedback' AND `field`='type'; +UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='feedbackSolution' ORDER BY `id` DESC LIMIT 1) WHERE `module`='feedback' AND `field`='solution'; +UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='feedbackclosedReason' ORDER BY `id` DESC LIMIT 1), `control`='select' WHERE `module`='feedback' AND `field`='closedReason'; + +UPDATE `zt_project` SET `closedDate`='' AND `closedBy`='' WHERE `status` != 'closed'; \ No newline at end of file diff --git a/db/zentao.sql b/db/zentao.sql index 808fa6805e..ca94b63909 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `zt_acl` ( `type` char(40) NOT NULL DEFAULT 'whitelist', `source` char(30) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_action`; CREATE TABLE IF NOT EXISTS `zt_action` ( `id` int(9) unsigned NOT NULL auto_increment, @@ -29,9 +29,9 @@ CREATE TABLE IF NOT EXISTS `zt_action` ( KEY `project` (`project`), KEY `action` (`action`), KEY `objectID` (`objectID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_api_lib_release`; -CREATE TABLE `zt_api_lib_release` ( +CREATE TABLE IF NOT EXISTS `zt_api_lib_release` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT, `lib` int UNSIGNED NOT NULL DEFAULT 0, `desc` varchar(255) NOT NULL DEFAULT '', @@ -40,9 +40,9 @@ CREATE TABLE `zt_api_lib_release` ( `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_api`; -CREATE TABLE `zt_api` ( +CREATE TABLE IF NOT EXISTS `zt_api` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT, `product` varchar(255) NOT NULL DEFAULT '', `lib` int UNSIGNED NOT NULL DEFAULT 0, @@ -68,9 +68,9 @@ CREATE TABLE `zt_api` ( `editedDate` datetime NOT NULL, `deleted` enum ('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_apispec`; -CREATE TABLE `zt_apispec` ( +CREATE TABLE IF NOT EXISTS `zt_apispec` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT, `doc` int UNSIGNED NOT NULL DEFAULT 0, `module` int UNSIGNED NOT NULL DEFAULT 0, @@ -91,9 +91,9 @@ CREATE TABLE `zt_apispec` ( `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_apistruct`; -CREATE TABLE `zt_apistruct` ( +CREATE TABLE IF NOT EXISTS `zt_apistruct` ( `id` int unsigned NOT NULL AUTO_INCREMENT, `lib` int UNSIGNED NOT NULL DEFAULT 0, `name` varchar(30) NOT NULL DEFAULT '', @@ -107,9 +107,9 @@ CREATE TABLE `zt_apistruct` ( `editedDate` datetime NOT NULL, `deleted` enum ('0', '1') NOT NULL DEFAULT '0', primary key (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_apistruct_spec`; -CREATE TABLE `zt_apistruct_spec` ( +CREATE TABLE IF NOT EXISTS `zt_apistruct_spec` ( `id` int UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL DEFAULT '', `type` varchar(50) NOT NULL DEFAULT '', @@ -119,9 +119,9 @@ CREATE TABLE `zt_apistruct_spec` ( `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NOT NULL, primary key (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approval`; -CREATE TABLE `zt_approval` ( +CREATE TABLE IF NOT EXISTS `zt_approval` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT, `flow` mediumint(8) NOT NULL, `objectType` varchar(30) NOT NULL, @@ -134,9 +134,9 @@ CREATE TABLE `zt_approval` ( `createdDate` datetime NOT NULL, `deleted` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalflow`; -CREATE TABLE `zt_approvalflow` ( +CREATE TABLE IF NOT EXISTS `zt_approvalflow` ( `id` int(8) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `code` varchar(100) NOT NULL, @@ -147,9 +147,9 @@ CREATE TABLE `zt_approvalflow` ( `type` varchar(30) NOT NULL, `deleted` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalflowobject`; -CREATE TABLE `zt_approvalflowobject` ( +CREATE TABLE IF NOT EXISTS `zt_approvalflowobject` ( `id` int(8) NOT NULL AUTO_INCREMENT, `root` int(8) NOT NULL, `flow` int(8) NOT NULL, @@ -157,9 +157,9 @@ CREATE TABLE `zt_approvalflowobject` ( `objectID` mediumint(9) NOT NULL, `extra` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalflowspec`; -CREATE TABLE `zt_approvalflowspec` ( +CREATE TABLE IF NOT EXISTS `zt_approvalflowspec` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT, `flow` mediumint(8) NOT NULL, `version` mediumint(8) NOT NULL, @@ -167,9 +167,9 @@ CREATE TABLE `zt_approvalflowspec` ( `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalnode`; -CREATE TABLE `zt_approvalnode` ( +CREATE TABLE IF NOT EXISTS `zt_approvalnode` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT, `approval` mediumint(8) NOT NULL, `type` enum('review','cc') NOT NULL, @@ -189,18 +189,18 @@ CREATE TABLE `zt_approvalnode` ( `reviewedDate` datetime NOT NULL, PRIMARY KEY (`id`), KEY `idx_reviewed_date` (`reviewedDate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalobject`; -CREATE TABLE `zt_approvalobject` ( +CREATE TABLE IF NOT EXISTS `zt_approvalobject` ( `id` int(8) NOT NULL AUTO_INCREMENT, `approval` int(8) NOT NULL, `objectType` char(30) NOT NULL, `objectID` mediumint(8) NOT NULL, `extra` varchar(255) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_approvalrole`; -CREATE TABLE `zt_approvalrole` ( +CREATE TABLE IF NOT EXISTS `zt_approvalrole` ( `id` int(8) NOT NULL AUTO_INCREMENT, `code` char(30) NOT NULL, `name` varchar(255) NOT NULL, @@ -208,7 +208,7 @@ CREATE TABLE `zt_approvalrole` ( `users` longtext NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_block`; CREATE TABLE IF NOT EXISTS `zt_block` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -227,7 +227,7 @@ CREATE TABLE IF NOT EXISTS `zt_block` ( PRIMARY KEY (`id`), UNIQUE KEY `account_vision_module_type_order` (`account`,`vision`,`module`,`type`,`order`), KEY `account` (`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_branch`; CREATE TABLE IF NOT EXISTS `zt_branch` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -242,7 +242,7 @@ CREATE TABLE IF NOT EXISTS `zt_branch` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `product` (`product`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_bug`; CREATE TABLE IF NOT EXISTS `zt_bug` ( `id` mediumint(8) NOT NULL auto_increment, @@ -315,7 +315,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( KEY `toStory` (`toStory`), KEY `result` (`result`), KEY `assignedTo` (`assignedTo`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_build`; CREATE TABLE IF NOT EXISTS `zt_build` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -331,11 +331,13 @@ CREATE TABLE IF NOT EXISTS `zt_build` ( `bugs` text NOT NULL, `builder` char(30) NOT NULL default '', `desc` mediumtext NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), KEY `execution` (`execution`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_burn`; CREATE TABLE IF NOT EXISTS `zt_burn` ( `execution` mediumint(8) unsigned NOT NULL, @@ -347,7 +349,7 @@ CREATE TABLE IF NOT EXISTS `zt_burn` ( `consumed` float NOT NULL, `storyPoint` float NOT NULL, PRIMARY KEY (`execution`,`date`,`task`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_case`; CREATE TABLE IF NOT EXISTS `zt_case` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -398,7 +400,7 @@ CREATE TABLE IF NOT EXISTS `zt_case` ( KEY `story` (`story`), KEY `fromBug` (`fromBug`), KEY `module` (`module`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_casestep`; CREATE TABLE IF NOT EXISTS `zt_casestep` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -411,9 +413,9 @@ CREATE TABLE IF NOT EXISTS `zt_casestep` ( PRIMARY KEY (`id`), KEY `case` (`case`), KEY `version` (`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_cfd`; -CREATE TABLE `zt_cfd` ( +CREATE TABLE IF NOT EXISTS `zt_cfd` ( `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, `execution` int(8) NOT NULL, `type` char(30) NOT NULL, @@ -421,7 +423,7 @@ CREATE TABLE `zt_cfd` ( `count` smallint NOT NULL, `date` date NOT NULL, UNIQUE KEY `execution_type_name_date` (`execution`,`type`,`name`,`date`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_company`; CREATE TABLE IF NOT EXISTS `zt_company` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -436,7 +438,7 @@ CREATE TABLE IF NOT EXISTS `zt_company` ( `admins` char(255) default NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_compile`; CREATE TABLE IF NOT EXISTS `zt_compile` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -454,7 +456,7 @@ CREATE TABLE IF NOT EXISTS `zt_compile` ( `updateDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_config`; CREATE TABLE IF NOT EXISTS `zt_config` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -466,7 +468,7 @@ CREATE TABLE IF NOT EXISTS `zt_config` ( `value` longtext NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `unique` (`vision`,`owner`,`module`,`section`,`key`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_cron`; CREATE TABLE IF NOT EXISTS `zt_cron` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -483,7 +485,7 @@ CREATE TABLE IF NOT EXISTS `zt_cron` ( `lastTime` datetime NOT NULL, PRIMARY KEY (`id`), KEY `lastTime` (`lastTime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_dept`; CREATE TABLE IF NOT EXISTS `zt_dept` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -498,7 +500,7 @@ CREATE TABLE IF NOT EXISTS `zt_dept` ( PRIMARY KEY (`id`), KEY `parent` (`parent`), KEY `path` (`path`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_design`; CREATE TABLE IF NOT EXISTS `zt_design` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -522,7 +524,7 @@ CREATE TABLE IF NOT EXISTS `zt_design` ( `version` smallint(6) NOT NULL, `type` char(30) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_designspec`; CREATE TABLE IF NOT EXISTS `zt_designspec` ( `design` mediumint(8) NOT NULL, @@ -531,7 +533,7 @@ CREATE TABLE IF NOT EXISTS `zt_designspec` ( `desc` mediumtext NOT NULL, `files` varchar(255) NOT NULL, UNIQUE KEY `design` (`design`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_doc`; CREATE TABLE IF NOT EXISTS `zt_doc` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -561,7 +563,7 @@ CREATE TABLE IF NOT EXISTS `zt_doc` ( KEY `product` (`product`), KEY `execution` (`execution`), KEY `lib` (`lib`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_doccontent`; CREATE TABLE IF NOT EXISTS `zt_doccontent` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -574,7 +576,7 @@ CREATE TABLE IF NOT EXISTS `zt_doccontent` ( `version` smallint(5) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `doc_version` (`doc`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_doclib`; CREATE TABLE IF NOT EXISTS `zt_doclib` ( `id` smallint(5) unsigned NOT NULL auto_increment, @@ -596,7 +598,7 @@ CREATE TABLE IF NOT EXISTS `zt_doclib` ( PRIMARY KEY (`id`), KEY `product` (`product`), KEY `execution` (`execution`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_effort`; CREATE TABLE IF NOT EXISTS `zt_effort` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -613,7 +615,7 @@ CREATE TABLE IF NOT EXISTS `zt_effort` ( `status` enum('1','2','3') NOT NULL default '1', PRIMARY KEY (`id`), KEY `user` (`user`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_entry`; CREATE TABLE IF NOT EXISTS `zt_entry` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -631,7 +633,7 @@ CREATE TABLE IF NOT EXISTS `zt_entry` ( `editedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_expect`; CREATE TABLE IF NOT EXISTS `zt_expect` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -642,7 +644,7 @@ CREATE TABLE IF NOT EXISTS `zt_expect` ( `createdBy` char(30) NOT NULL, `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_extension`; CREATE TABLE IF NOT EXISTS `zt_extension` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -664,7 +666,7 @@ CREATE TABLE IF NOT EXISTS `zt_extension` ( UNIQUE KEY `code` (`code`), KEY `name` (`name`), KEY `installedTime` (`installedTime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_file`; CREATE TABLE IF NOT EXISTS `zt_file` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -682,7 +684,7 @@ CREATE TABLE IF NOT EXISTS `zt_file` ( PRIMARY KEY (`id`), KEY `objectType` (`objectType`), KEY `objectID` (`objectID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_group`; CREATE TABLE IF NOT EXISTS `zt_group` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -693,14 +695,14 @@ CREATE TABLE IF NOT EXISTS `zt_group` ( `desc` char(255) NOT NULL default '', `acl` text, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_grouppriv`; CREATE TABLE IF NOT EXISTS `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; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_holiday`; CREATE TABLE IF NOT EXISTS `zt_holiday` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -713,7 +715,7 @@ CREATE TABLE IF NOT EXISTS `zt_holiday` ( PRIMARY KEY (`id`), KEY `year` (`year`), KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_history`; CREATE TABLE IF NOT EXISTS `zt_history` ( `id` int(9) unsigned NOT NULL auto_increment, @@ -724,7 +726,7 @@ CREATE TABLE IF NOT EXISTS `zt_history` ( `diff` mediumtext NOT NULL, PRIMARY KEY (`id`), KEY `action` (`action`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_job`; CREATE TABLE IF NOT EXISTS `zt_job` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -752,9 +754,9 @@ CREATE TABLE IF NOT EXISTS `zt_job` ( `lastTag` varchar(255) DEFAULT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbanspace`; -CREATE TABLE `zt_kanbanspace` ( +CREATE TABLE IF NOT EXISTS `zt_kanbanspace` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(50) NOT NULL, @@ -775,9 +777,9 @@ CREATE TABLE `zt_kanbanspace` ( `activatedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanban`; -CREATE TABLE `zt_kanban` ( +CREATE TABLE IF NOT EXISTS `zt_kanban` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `space` mediumint(8) unsigned NOT NULL, `name` varchar(255) NOT NULL, @@ -805,9 +807,9 @@ CREATE TABLE `zt_kanban` ( `activatedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbanregion`; -CREATE TABLE `zt_kanbanregion` ( +CREATE TABLE IF NOT EXISTS `zt_kanbanregion` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `space` mediumint(8) unsigned NOT NULL, `kanban` mediumint(8) unsigned NOT NULL, @@ -819,9 +821,9 @@ CREATE TABLE `zt_kanbanregion` ( `lastEditedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbancard`; -CREATE TABLE `zt_kanbancard` ( +CREATE TABLE IF NOT EXISTS `zt_kanbancard` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `kanban` mediumint(8) unsigned NOT NULL, `region` mediumint(8) unsigned NOT NULL, @@ -852,9 +854,9 @@ CREATE TABLE `zt_kanbancard` ( `assignedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbancell`; -CREATE TABLE `zt_kanbancell` ( +CREATE TABLE IF NOT EXISTS `zt_kanbancell` ( `id` int(8) NOT NULL AUTO_INCREMENT, `kanban` mediumint(8) NOT NULL, `lane` mediumint(8) NOT NULL, @@ -863,15 +865,15 @@ CREATE TABLE `zt_kanbancell` ( `cards` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `card_group` (`kanban`,`type`,`lane`,`column`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbangroup`; -CREATE TABLE `zt_kanbangroup` ( +CREATE TABLE IF NOT EXISTS `zt_kanbangroup` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `kanban` mediumint(8) unsigned NOT NULL, `region` mediumint(8) unsigned NOT NULL, `order` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbanlane`; CREATE TABLE IF NOT EXISTS `zt_kanbanlane` ( `id` int(8) NOT NULL AUTO_INCREMENT, @@ -887,7 +889,7 @@ CREATE TABLE IF NOT EXISTS `zt_kanbanlane` ( `lastEditedTime` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_kanbancolumn`; CREATE TABLE IF NOT EXISTS `zt_kanbancolumn` ( `id` int(8) NOT NULL AUTO_INCREMENT, @@ -902,7 +904,7 @@ CREATE TABLE IF NOT EXISTS `zt_kanbancolumn` ( `archived` enum('0', '1') NOT NULL DEFAULT '0', `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_lang`; CREATE TABLE IF NOT EXISTS `zt_lang` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -915,7 +917,7 @@ CREATE TABLE IF NOT EXISTS `zt_lang` ( `vision` varchar(10) NOT NULL DEFAULT 'rnd', PRIMARY KEY (`id`), UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`,`vision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_log`; CREATE TABLE IF NOT EXISTS `zt_log` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -930,7 +932,7 @@ CREATE TABLE IF NOT EXISTS `zt_log` ( PRIMARY KEY `id` (`id`), KEY `objectType` (`objectType`), KEY `obejctID` (`objectID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_module`; CREATE TABLE IF NOT EXISTS `zt_module` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -951,14 +953,14 @@ CREATE TABLE IF NOT EXISTS `zt_module` ( KEY `root` (`root`), KEY `type` (`type`), KEY `path` (`path`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_mr`; CREATE TABLE IF NOT EXISTS `zt_mr` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `gitlabID` mediumint(8) unsigned NOT NULL, - `sourceProject` int unsigned NOT NULL, + `hostID` mediumint(8) unsigned NOT NULL, + `sourceProject` varchar(50) NOT NULL, `sourceBranch` varchar(100) NOT NULL, - `targetProject` int unsigned NOT NULL, + `targetProject` varchar(50) NOT NULL, `targetBranch` varchar(100) NOT NULL, `mriid` int unsigned NOT NULL, `title` varchar(255) NOT NULL, @@ -987,7 +989,7 @@ CREATE TABLE IF NOT EXISTS `zt_mr` ( `hasNoConflict` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '0', `diffs` longtext COLLATE 'utf8_general_ci' NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_mrapproval`; CREATE TABLE IF NOT EXISTS `zt_mrapproval` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -997,7 +999,7 @@ CREATE TABLE IF NOT EXISTS `zt_mrapproval` ( `action` char(30) NOT NULL, `comment` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_notify`; CREATE TABLE IF NOT EXISTS `zt_notify` ( `id` mediumint unsigned NOT NULL AUTO_INCREMENT, @@ -1015,7 +1017,7 @@ CREATE TABLE IF NOT EXISTS `zt_notify` ( `failReason` text NOT NULL, PRIMARY KEY (`id`), KEY `objectType_toList_status` (`objectType`,`toList`,`status`) -) ENGINE='MyISAM' COLLATE 'utf8_general_ci'; +) ENGINE='InnoDB' COLLATE 'utf8_general_ci'; -- DROP TABLE IF EXISTS `zt_oauth`; CREATE TABLE IF NOT EXISTS `zt_oauth` ( `account` varchar(30) NOT NULL, @@ -1025,7 +1027,7 @@ CREATE TABLE IF NOT EXISTS `zt_oauth` ( KEY `account` (`account`), KEY `providerType` (`providerType`), KEY `providerID` (`providerID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_pipeline`; CREATE TABLE IF NOT EXISTS `zt_pipeline` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1042,14 +1044,14 @@ CREATE TABLE IF NOT EXISTS `zt_pipeline` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_planstory`; CREATE TABLE IF NOT EXISTS `zt_planstory` ( `plan` mediumint(8) unsigned NOT NULL, `story` mediumint(8) unsigned NOT NULL, `order` mediumint(9) NOT NULL, UNIQUE KEY `plan_story` (`plan`,`story`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_product`; CREATE TABLE IF NOT EXISTS `zt_product` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1077,7 +1079,7 @@ CREATE TABLE IF NOT EXISTS `zt_product` ( PRIMARY KEY (`id`), KEY `acl` (`acl`), KEY `order` (`order`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_productplan`; CREATE TABLE IF NOT EXISTS `zt_productplan` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1091,11 +1093,13 @@ CREATE TABLE IF NOT EXISTS `zt_productplan` ( `end` date NOT NULL, `order` text NOT NULL, `closedReason` varchar(20) NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), KEY `end` (`end`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_project`; CREATE TABLE IF NOT EXISTS `zt_project` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1157,9 +1161,9 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( KEY `status` (`status`), KEY `acl` (`acl`), KEY `order` (`order`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_projectadmin`; -CREATE TABLE `zt_projectadmin` ( +CREATE TABLE IF NOT EXISTS `zt_projectadmin` ( `group` smallint(6) NOT NULL, `account` char(30) NOT NULL, `programs` text NOT NULL, @@ -1167,7 +1171,7 @@ CREATE TABLE `zt_projectadmin` ( `products` text NOT NULL, `executions` text NOT NULL, UNIQUE KEY `group_account` (`group`, `account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_projectcase`; CREATE TABLE IF NOT EXISTS `zt_projectcase` ( `project` mediumint(8) unsigned NOT NULL DEFAULT '0', @@ -1177,7 +1181,7 @@ CREATE TABLE IF NOT EXISTS `zt_projectcase` ( `version` smallint(6) NOT NULL DEFAULT '1', `order` smallint(6) unsigned NOT NULL, UNIQUE KEY `project` (`project`,`case`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_projectproduct`; CREATE TABLE IF NOT EXISTS `zt_projectproduct` ( `project` mediumint(8) unsigned NOT NULL, @@ -1185,7 +1189,7 @@ CREATE TABLE IF NOT EXISTS `zt_projectproduct` ( `branch` mediumint(8) unsigned NOT NULL, `plan` varchar(255) NOT NULL, PRIMARY KEY (`project`, `product`, `branch`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_projectspec`; CREATE TABLE IF NOT EXISTS `zt_projectspec` ( `project` mediumint(8) NOT NULL, @@ -1195,7 +1199,7 @@ CREATE TABLE IF NOT EXISTS `zt_projectspec` ( `begin` date NOT NULL, `end` date NOT NULL, UNIQUE KEY `project` (`project`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_projectstory`; CREATE TABLE IF NOT EXISTS `zt_projectstory` ( `project` mediumint(8) unsigned NOT NULL default '0', @@ -1206,7 +1210,7 @@ CREATE TABLE IF NOT EXISTS `zt_projectstory` ( `order` smallint(6) unsigned NOT NULL, UNIQUE KEY `project` (`project`,`story`), KEY `story` (`story`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_relation`; CREATE TABLE IF NOT EXISTS `zt_relation` ( `id` int(8) NOT NULL AUTO_INCREMENT, @@ -1223,7 +1227,7 @@ CREATE TABLE IF NOT EXISTS `zt_relation` ( `extra` char(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `relation` (`product`,`relation`,`AType`,`BType`, `AID`, `BID`) -) ENGINE='MyISAM' DEFAULT CHARSET=utf8; +) ENGINE='InnoDB' DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_release`; CREATE TABLE IF NOT EXISTS `zt_release` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1242,11 +1246,13 @@ CREATE TABLE IF NOT EXISTS `zt_release` ( `notify` varchar(255), `status` varchar(20) NOT NULL default 'normal', `subStatus` varchar(30) NOT NULL default '', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), KEY `build` (`build`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_repo`; CREATE TABLE IF NOT EXISTS `zt_repo` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, @@ -1257,6 +1263,8 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( `encoding` varchar(20) NOT NULL, `SCM` varchar(10) NOT NULL, `client` varchar(100) NOT NULL, + `serviceHost` varchar(50) NOT NULL, + `serviceProject` varchar(100) NOT NULL, `commits` mediumint(8) unsigned NOT NULL, `account` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, @@ -1273,7 +1281,7 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( `fileServerPassword` varchar(100) NOT NULL default '', `deleted` tinyint(1) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_repobranch`; CREATE TABLE IF NOT EXISTS `zt_repobranch` ( `repo` mediumint(8) unsigned NOT NULL, @@ -1282,7 +1290,7 @@ CREATE TABLE IF NOT EXISTS `zt_repobranch` ( UNIQUE KEY `repo_revision_branch` (`repo`,`revision`,`branch`), KEY `branch` (`branch`), KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_repofiles`; CREATE TABLE IF NOT EXISTS `zt_repofiles` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -1297,7 +1305,7 @@ CREATE TABLE IF NOT EXISTS `zt_repofiles` ( KEY `parent` (`parent`), KEY `repo` (`repo`), KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_repohistory`; CREATE TABLE IF NOT EXISTS `zt_repohistory` ( `id` mediumint(9) NOT NULL AUTO_INCREMENT, @@ -1310,7 +1318,7 @@ CREATE TABLE IF NOT EXISTS `zt_repohistory` ( PRIMARY KEY (`id`), KEY `repo` (`repo`), KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_score`; CREATE TABLE IF NOT EXISTS `zt_score` ( `id` bigint(12) unsigned NOT NULL AUTO_INCREMENT, @@ -1326,13 +1334,13 @@ CREATE TABLE IF NOT EXISTS `zt_score` ( KEY `account` (`account`), KEY `model` (`module`), KEY `method` (`method`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_searchdict`; CREATE TABLE IF NOT EXISTS `zt_searchdict` ( `key` smallint(5) unsigned NOT NULL, `value` char(3) NOT NULL, PRIMARY KEY (`key`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_searchindex`; CREATE TABLE IF NOT EXISTS `zt_searchindex` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -1346,9 +1354,8 @@ CREATE TABLE IF NOT EXISTS `zt_searchindex` ( PRIMARY KEY (`id`), UNIQUE KEY `object` (`objectType`,`objectID`), KEY `addedDate` (`addedDate`), - FULLTEXT KEY `content` (`content`), - FULLTEXT KEY `title` (`title`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; + FULLTEXT KEY `title_content` (`title`, `content`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_stage`; CREATE TABLE IF NOT EXISTS `zt_stage` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1361,7 +1368,7 @@ CREATE TABLE IF NOT EXISTS `zt_stage` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_stakeholder`; CREATE TABLE IF NOT EXISTS `zt_stakeholder` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -1377,7 +1384,7 @@ CREATE TABLE IF NOT EXISTS `zt_stakeholder` ( `editedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL, KEY `objectID` (`objectID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_story`; CREATE TABLE IF NOT EXISTS `zt_story` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1419,6 +1426,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( `toBug` mediumint(8) unsigned NOT NULL, `childStories` varchar(255) NOT NULL, `linkStories` varchar(255) NOT NULL, + `linkRequirements` varchar(255) NOT NULL, `duplicateStory` mediumint(8) unsigned NOT NULL, `version` smallint(6) NOT NULL default '1', `feedbackBy` varchar(100) NOT NULL, @@ -1429,7 +1437,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( KEY `product` (`product`), KEY `status` (`status`), KEY `assignedTo` (`assignedTo`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_storyreview`; CREATE TABLE IF NOT EXISTS `zt_storyreview` ( `story` mediumint(9) NOT NULL, @@ -1438,7 +1446,7 @@ CREATE TABLE IF NOT EXISTS `zt_storyreview` ( `result` varchar(30) NOT NULL, `reviewDate` datetime NOT NULL, UNIQUE KEY `story` (`story`,`version`,`reviewer`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_storyestimate`; CREATE TABLE IF NOT EXISTS `zt_storyestimate` ( `story` mediumint(9) NOT NULL, @@ -1448,7 +1456,7 @@ CREATE TABLE IF NOT EXISTS `zt_storyestimate` ( `openedBy` varchar(30) NOT NULL, `openedDate` datetime NOT NULL, UNIQUE KEY `story` (`story`,`round`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_storyspec`; CREATE TABLE IF NOT EXISTS `zt_storyspec` ( `story` mediumint(9) NOT NULL, @@ -1457,7 +1465,7 @@ CREATE TABLE IF NOT EXISTS `zt_storyspec` ( `spec` mediumtext NOT NULL, `verify` mediumtext NOT NULL, UNIQUE KEY `story` (`story`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_storystage`; CREATE TABLE IF NOT EXISTS `zt_storystage` ( `story` mediumint(8) unsigned NOT NULL, @@ -1466,7 +1474,7 @@ CREATE TABLE IF NOT EXISTS `zt_storystage` ( `stagedBy` char(30) NOT NULL, UNIQUE KEY `story_branch` (`story`,`branch`), KEY `story` (`story`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_suitecase`; CREATE TABLE IF NOT EXISTS `zt_suitecase` ( `suite` mediumint(8) unsigned NOT NULL, @@ -1474,7 +1482,7 @@ CREATE TABLE IF NOT EXISTS `zt_suitecase` ( `case` mediumint(8) unsigned NOT NULL, `version` smallint(5) unsigned NOT NULL, UNIQUE KEY `suitecase` (`suite`,`case`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_task`; CREATE TABLE IF NOT EXISTS `zt_task` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1521,6 +1529,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( `lastEditedBy` varchar(30) NOT NULL, `lastEditedDate` datetime NOT NULL, `activatedDate` datetime NOT NULL, + `order` mediumint(8) unsigned NOT NULL, `repo` mediumint(8) unsigned NOT NULL, `mr` mediumint(8) unsigned NOT NULL, `entry` varchar(255) NOT NULL, @@ -1533,8 +1542,9 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( KEY `execution` (`execution`), KEY `story` (`story`), KEY `parent` (`parent`), - KEY `assignedTo` (`assignedTo`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; + KEY `assignedTo` (`assignedTo`), + KEY `order` (`order`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_taskestimate`; CREATE TABLE IF NOT EXISTS `zt_taskestimate` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1546,7 +1556,7 @@ CREATE TABLE IF NOT EXISTS `zt_taskestimate` ( `work` text, PRIMARY KEY (`id`), KEY `task` (`task`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_taskspec`; CREATE TABLE IF NOT EXISTS `zt_taskspec` ( `task` mediumint(8) NOT NULL, @@ -1555,7 +1565,7 @@ CREATE TABLE IF NOT EXISTS `zt_taskspec` ( `estStarted` date NOT NULL, `deadline` date NOT NULL, UNIQUE KEY `task` (`task`,`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_team`; CREATE TABLE IF NOT EXISTS `zt_team` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1573,7 +1583,7 @@ CREATE TABLE IF NOT EXISTS `zt_team` ( `order` TINYINT(3) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `team` (`root`,`type`,`account`) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testreport`; CREATE TABLE IF NOT EXISTS `zt_testreport` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1597,7 +1607,7 @@ CREATE TABLE IF NOT EXISTS `zt_testreport` ( `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testresult`; CREATE TABLE IF NOT EXISTS `zt_testresult` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1616,7 +1626,7 @@ CREATE TABLE IF NOT EXISTS `zt_testresult` ( KEY `case` (`case`), KEY `version` (`version`), KEY `run` (`run`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testrun`; CREATE TABLE IF NOT EXISTS `zt_testrun` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1630,7 +1640,7 @@ CREATE TABLE IF NOT EXISTS `zt_testrun` ( `status` char(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `task` (`task`,`case`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testsuite`; CREATE TABLE IF NOT EXISTS `zt_testsuite` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1646,7 +1656,7 @@ CREATE TABLE IF NOT EXISTS `zt_testsuite` ( `deleted` enum('0','1') NOT NULL, PRIMARY KEY (`id`), KEY `product` (`product`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testtask`; CREATE TABLE IF NOT EXISTS `zt_testtask` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1668,11 +1678,13 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` ( `testreport` mediumint(8) unsigned NOT NULL, `auto` varchar(10) NOT NULL DEFAULT 'no', `subStatus` varchar(30) NOT NULL default '', + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), KEY `build` (`build`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_todo`; CREATE TABLE IF NOT EXISTS `zt_todo` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1703,7 +1715,7 @@ CREATE TABLE IF NOT EXISTS `zt_todo` ( KEY `assignedTo` (`assignedTo`), KEY `finishedBy` (`finishedBy`), KEY `date` (`date`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_user`; CREATE TABLE IF NOT EXISTS `zt_user` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1751,7 +1763,7 @@ CREATE TABLE IF NOT EXISTS `zt_user` ( KEY `email` (`email`), KEY `commiter` (`commiter`), KEY `deleted` (`deleted`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_usercontact`; CREATE TABLE IF NOT EXISTS `zt_usercontact` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1760,14 +1772,14 @@ CREATE TABLE IF NOT EXISTS `zt_usercontact` ( `userList` text NOT NULL, PRIMARY KEY (`id`), KEY `account` (`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_usergroup`; CREATE TABLE IF NOT EXISTS `zt_usergroup` ( `account` char(30) NOT NULL default '', `group` mediumint(8) unsigned NOT NULL default '0', `project` text NOT NULL, UNIQUE KEY `account` (`account`,`group`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_userquery`; CREATE TABLE IF NOT EXISTS `zt_userquery` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1781,7 +1793,7 @@ CREATE TABLE IF NOT EXISTS `zt_userquery` ( PRIMARY KEY (`id`), KEY `account` (`account`), KEY `module` (`module`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_usertpl`; CREATE TABLE IF NOT EXISTS `zt_usertpl` ( `id` mediumint(8) unsigned NOT NULL auto_increment, @@ -1792,7 +1804,7 @@ CREATE TABLE IF NOT EXISTS `zt_usertpl` ( `public` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `account` (`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_userview`; CREATE TABLE IF NOT EXISTS `zt_userview` ( `account` char(30) NOT NULL, @@ -1801,7 +1813,7 @@ CREATE TABLE IF NOT EXISTS `zt_userview` ( `projects` mediumtext NOT NULL, `sprints` mediumtext NOT NULL, UNIQUE KEY `account` (`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_weeklyreport`; CREATE TABLE IF NOT EXISTS `zt_weeklyreport`( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1817,7 +1829,7 @@ CREATE TABLE IF NOT EXISTS `zt_weeklyreport`( `workload` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `week` (`project`,`weekStart`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_webhook`; CREATE TABLE IF NOT EXISTS `zt_webhook` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -1839,7 +1851,7 @@ CREATE TABLE IF NOT EXISTS `zt_webhook` ( `editedDate` datetime NOT NULL, `deleted` enum('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('*', '*', '*', '*', '*', '', '监控定时任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), @@ -6165,7 +6177,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_chat` ( KEY `public` (`public`), KEY `createdBy` (`createdBy`), KEY `editedBy` (`editedBy`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_chatuser`; CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( @@ -6189,7 +6201,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_chatuser` ( KEY `star` (`star`), KEY `hide` (`hide`), UNIQUE KEY `chatuser` (`cgid`, `user`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_client`; CREATE TABLE IF NOT EXISTS `zt_im_client` ( @@ -6205,7 +6217,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_client` ( `editedBy` varchar(30) NOT NULL DEFAULT '', `status` enum('released','wait') NOT NULL DEFAULT 'wait', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_message`; CREATE TABLE IF NOT EXISTS `zt_im_message` ( @@ -6225,7 +6237,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_message` ( KEY `mcgid` (`cgid`), KEY `muser` (`user`), KEY `mtype` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_message_backup`; CREATE TABLE IF NOT EXISTS `zt_im_message_backup` ( @@ -6240,7 +6252,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_message_backup` ( `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text', `data` text NOT NULL DEFAULT '', `deleted` enum('0','1') NOT NULL DEFAULT '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_message_index`; CREATE TABLE IF NOT EXISTS `zt_im_message_index` ( @@ -6257,7 +6269,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_message_index` ( KEY `end` (`end`), KEY `startDate` (`startDate`), KEY `endDate` (`endDate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_chat_message_index`; CREATE TABLE IF NOT EXISTS `zt_im_chat_message_index` ( @@ -6279,7 +6291,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_chat_message_index` ( KEY `endDate` (`endDate`), KEY `chatstartindex` (`gid`,`startIndex`), KEY `chatendindex` (`gid`,`endIndex`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_messagestatus`; CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( @@ -6287,7 +6299,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` ( `message` int(11) unsigned NOT NULL, `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting', UNIQUE KEY `user` (`user`,`message`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_queue`; CREATE TABLE IF NOT EXISTS `zt_im_queue` ( @@ -6299,7 +6311,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_queue` ( `result` text NOT NULL, `status` char(30) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_conference`; CREATE TABLE IF NOT EXISTS `zt_im_conference` ( @@ -6312,7 +6324,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_conference` ( `openedBy` mediumint(8) NOT NULL DEFAULT 0, `openedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_conferenceaction`; CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( @@ -6324,7 +6336,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` ( `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `device` char(40) NOT NULL DEFAULT 'default', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_userdevice`; CREATE TABLE IF NOT EXISTS `zt_im_userdevice` ( @@ -6341,7 +6353,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_userdevice` ( KEY `lastLogin` (`lastLogin`), KEY `lastLogout` (`lastLogout`), UNIQUE KEY `userdevice` (`user`, `device`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_file` CHANGE `pathname` `pathname` char(100) NOT NULL; ALTER TABLE `zt_user` ADD `clientStatus` enum('online', 'away', 'busy', 'offline', 'meeting') NOT NULL DEFAULT 'offline'; @@ -6818,7 +6830,7 @@ CREATE TABLE IF NOT EXISTS `zt_report` ( `addedDate` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE OR REPLACE VIEW `ztv_executionsummary` AS select `zt_task`.`execution` AS `execution`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`estimate`,0)) AS `estimate`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0)) AS `consumed`,sum(if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0)) AS `left`,count(0) AS `number`,sum(if(((`zt_task`.`status` <> 'done') and (`zt_task`.`status` <> 'closed')),1,0)) AS `undone`,sum((if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0) + if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0))) AS `totalReal` from `zt_task` where (`zt_task`.`deleted` = '0') group by `zt_task`.`execution`; CREATE OR REPLACE VIEW `ztv_projectsummary` AS select `zt_task`.`project` AS `project`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`estimate`,0)) AS `estimate`,sum(if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0)) AS `consumed`,sum(if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0)) AS `left`,count(0) AS `number`,sum(if(((`zt_task`.`status` <> 'done') and (`zt_task`.`status` <> 'closed')),1,0)) AS `undone`,sum((if((`zt_task`.`parent` >= '0'),`zt_task`.`consumed`,0) + if(((`zt_task`.`status` <> 'cancel') and (`zt_task`.`status` <> 'closed') and (`zt_task`.`parent` >= '0')),`zt_task`.`left`,0))) AS `totalReal` from `zt_task` where (`zt_task`.`deleted` = '0') group by `zt_task`.`project`; @@ -6942,7 +6954,7 @@ CREATE TABLE IF NOT EXISTS `zt_feedback` ( `mailto` varchar(255) NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_bug` ADD `feedback` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `caseVersion`; ALTER TABLE `zt_story` ADD `feedback` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `fromBug`; @@ -6954,7 +6966,7 @@ CREATE TABLE IF NOT EXISTS `zt_feedbackview` ( `account` char(30) NOT NULL, `product` mediumint(8) unsigned NOT NULL, UNIQUE KEY `account_product` (`account`,`product`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_serverroom`; CREATE TABLE IF NOT EXISTS `zt_serverroom` ( @@ -6971,7 +6983,7 @@ CREATE TABLE IF NOT EXISTS `zt_serverroom` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_account`; CREATE TABLE IF NOT EXISTS `zt_account` ( @@ -6995,7 +7007,7 @@ CREATE TABLE IF NOT EXISTS `zt_account` ( key `name` (`name`), key `provider` (`provider`), key `status` (`status`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_asset`; CREATE TABLE IF NOT EXISTS `zt_asset` ( @@ -7010,7 +7022,7 @@ CREATE TABLE IF NOT EXISTS `zt_asset` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_host`; CREATE TABLE IF NOT EXISTS `zt_host` ( @@ -7057,7 +7069,7 @@ CREATE TABLE IF NOT EXISTS `zt_host` ( `cloudPassword` varchar(255) NOT NULL DEFAULT '', `couldVPC` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_service`; CREATE TABLE IF NOT EXISTS `zt_service` ( @@ -7088,7 +7100,7 @@ CREATE TABLE IF NOT EXISTS `zt_service` ( `order` smallint(5) unsigned NOT NULL default '0', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'tree', 'editHost'); @@ -7118,7 +7130,7 @@ CREATE TABLE IF NOT EXISTS `zt_attend` ( KEY `reviewStatus` (`reviewStatus`), KEY `reviewedBy` (`reviewedBy`), UNIQUE KEY `attend` (`date`,`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_attendstat`; CREATE TABLE IF NOT EXISTS `zt_attendstat` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7144,7 +7156,7 @@ CREATE TABLE IF NOT EXISTS `zt_attendstat` ( KEY `month` (`month`), KEY `status` (`status`), UNIQUE KEY `attend` (`month`,`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_overtime`; CREATE TABLE IF NOT EXISTS `zt_overtime` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7168,7 +7180,7 @@ CREATE TABLE IF NOT EXISTS `zt_overtime` ( KEY `type` (`type`), KEY `status` (`status`), KEY `createdBy` (`createdBy`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_holiday`; CREATE TABLE IF NOT EXISTS `zt_holiday` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7181,7 +7193,7 @@ CREATE TABLE IF NOT EXISTS `zt_holiday` ( PRIMARY KEY (`id`), KEY `year` (`year`), KEY `name` (`name`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_leave`; CREATE TABLE IF NOT EXISTS `zt_leave` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7204,7 +7216,7 @@ CREATE TABLE IF NOT EXISTS `zt_leave` ( KEY `type` (`type`), KEY `status` (`status`), KEY `createdBy` (`createdBy`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_lieu`; CREATE TABLE IF NOT EXISTS `zt_lieu` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7226,7 +7238,7 @@ CREATE TABLE IF NOT EXISTS `zt_lieu` ( KEY `year` (`year`), KEY `status` (`status`), KEY `createdBy` (`createdBy`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_trip`; CREATE TABLE IF NOT EXISTS `zt_trip` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7246,7 +7258,7 @@ CREATE TABLE IF NOT EXISTS `zt_trip` ( PRIMARY KEY (`id`), KEY `year` (`year`), KEY `createdBy` (`createdBy`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_deploy`; CREATE TABLE IF NOT EXISTS `zt_deploy` ( @@ -7265,7 +7277,7 @@ CREATE TABLE IF NOT EXISTS `zt_deploy` ( `result` varchar(20) NOT NULL, `deleted` enum('0','1') NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_deployproduct`; CREATE TABLE IF NOT EXISTS `zt_deployproduct` ( `deploy` mediumint(8) unsigned NOT NULL, @@ -7273,7 +7285,7 @@ CREATE TABLE IF NOT EXISTS `zt_deployproduct` ( `release` mediumint(8) unsigned NOT NULL, `package` varchar(255) NOT NULL, UNIQUE KEY `deploy_product_release` (`deploy`,`product`,`release`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_deploystep`; CREATE TABLE IF NOT EXISTS `zt_deploystep` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, @@ -7292,7 +7304,7 @@ CREATE TABLE IF NOT EXISTS `zt_deploystep` ( `createdDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_testresult` ADD `deploy` mediumint(8) unsigned NOT NULL; -- DROP TABLE IF EXISTS `zt_deployscope`; CREATE TABLE IF NOT EXISTS `zt_deployscope` ( @@ -7301,7 +7313,7 @@ CREATE TABLE IF NOT EXISTS `zt_deployscope` ( `hosts` text NOT NULL, `remove` text NOT NULL, `add` text NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_vm`; CREATE TABLE IF NOT EXISTS `zt_vm` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -7333,7 +7345,7 @@ CREATE TABLE IF NOT EXISTS `zt_vm` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', `public` varchar(50) NOT NULL DEFAULT '', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_baseimage`; CREATE TABLE IF NOT EXISTS `zt_baseimage` ( `id` SMALLINT(7) unsigned NOT NULL AUTO_INCREMENT, @@ -7348,7 +7360,7 @@ CREATE TABLE IF NOT EXISTS `zt_baseimage` ( `suggestMemory` mediumint(6) unsigned NOT NULL DEFAULT 0, `suggestVolume` mediumint(6) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_vmtemplate`; CREATE TABLE IF NOT EXISTS `zt_vmtemplate` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -7364,7 +7376,7 @@ CREATE TABLE IF NOT EXISTS `zt_vmtemplate` ( `diskSize` int NOT NULL DEFAULT 0, `osArch` varchar(50) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_browser`; CREATE TABLE IF NOT EXISTS `zt_browser` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -7375,16 +7387,16 @@ CREATE TABLE IF NOT EXISTS `zt_browser` ( `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_baseimagebrowser`; CREATE TABLE IF NOT EXISTS `zt_baseimagebrowser` ( `vmBackingID` int(10) NOT NULL, `browserID` int(10) NOT NULL, PRIMARY KEY (`vmBackingID`, `browserID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_traincourse`; -CREATE TABLE `zt_traincourse` ( +CREATE TABLE IF NOT EXISTS `zt_traincourse` ( `id` mediumint(8) NOT NULL AUTO_INCREMENT, `code` varchar(50) NOT NULL, `category` mediumint(8) NOT NULL, @@ -7398,7 +7410,7 @@ CREATE TABLE `zt_traincourse` ( `editedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_traincontents`; CREATE TABLE IF NOT EXISTS `zt_traincontents` ( @@ -7417,7 +7429,7 @@ CREATE TABLE IF NOT EXISTS `zt_traincontents` ( `editedDate` datetime NOT NULL, `deleted` tinyint(1) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_traincategory`; CREATE TABLE IF NOT EXISTS `zt_traincategory` ( @@ -7431,7 +7443,7 @@ CREATE TABLE IF NOT EXISTS `zt_traincategory` ( PRIMARY KEY (`id`), KEY `parent` (`parent`), KEY `path` (`path`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_trainrecords`; CREATE TABLE IF NOT EXISTS `zt_trainrecords` ( @@ -7440,7 +7452,7 @@ CREATE TABLE IF NOT EXISTS `zt_trainrecords` ( `objectType` varchar(10) NOT NULL, `status` varchar(10) NOT NULL, PRIMARY KEY (`user`, `objectId`, `objectType`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_doc` ADD `parent` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `type`, @@ -7470,7 +7482,7 @@ CREATE TABLE IF NOT EXISTS `zt_faq` ( `answer` text NOT NULL, `addedtime` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_task` ADD `feedback` mediumint(8) unsigned NOT NULL AFTER `fromBug`; ALTER TABLE `zt_todo` ADD `feedback` mediumint(8) unsigned NOT NULL AFTER `end`; @@ -7492,7 +7504,7 @@ CREATE TABLE IF NOT EXISTS `zt_domain`( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), key `domain` (`domain`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP VIEW IF EXISTS `view_datasource_5`; CREATE VIEW `view_datasource_5` AS select `id`,`name` from `zt_task` where `deleted` = '0' and vision = 'rnd'; @@ -8528,7 +8540,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflow` ( KEY `module` (`module`), KEY `order` (`order`), UNIQUE KEY `unique` (`app`, `module`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowaction`; CREATE TABLE IF NOT EXISTS `zt_workflowaction` ( @@ -8567,7 +8579,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowaction` ( KEY `action` (`action`), KEY `order` (`order`), UNIQUE KEY `unique` (`module`, `action`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowdatasource`; CREATE TABLE IF NOT EXISTS `zt_workflowdatasource` ( @@ -8586,7 +8598,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowdatasource` ( `editedDate` datetime NOT NULL, PRIMARY KEY (`id`), KEY `type` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowfield`; CREATE TABLE IF NOT EXISTS `zt_workflowfield` ( @@ -8621,7 +8633,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowfield` ( KEY `field` (`field`), KEY `order` (`order`), UNIQUE KEY `unique` (`module`, `field`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowlayout`; CREATE TABLE IF NOT EXISTS `zt_workflowlayout` ( @@ -8642,7 +8654,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowlayout` ( KEY `action` (`action`), KEY `order` (`order`), UNIQUE KEY `unique` (`module`, `action`, `field`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowlabel`; CREATE TABLE IF NOT EXISTS `zt_workflowlabel` ( @@ -8662,7 +8674,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowlabel` ( `editedDate` datetime NOT NULL, PRIMARY KEY (`id`), KEY `module` (`module`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowlinkdata`; CREATE TABLE IF NOT EXISTS `zt_workflowlinkdata` ( @@ -8673,7 +8685,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowlinkdata` ( `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, UNIQUE KEY `unique` (`objectType`, `objectID`, `linkedType`, `linkedID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowrelation`; CREATE TABLE IF NOT EXISTS `zt_workflowrelation` ( @@ -8687,7 +8699,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowrelation` ( `createdBy` char(30) NOT NULL, `createdDate` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowrelationlayout`; CREATE TABLE IF NOT EXISTS `zt_workflowrelationlayout` ( @@ -8703,7 +8715,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowrelationlayout` ( KEY `action` (`action`), KEY `order` (`order`), UNIQUE KEY `unique` (`prev`, `next`, `action`, `field`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowrule`; CREATE TABLE IF NOT EXISTS `zt_workflowrule` ( @@ -8717,7 +8729,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowrule` ( `editedDate` datetime NOT NULL, PRIMARY KEY (`id`), KEY `type` (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowsql`; CREATE TABLE IF NOT EXISTS `zt_workflowsql` ( @@ -8735,7 +8747,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowsql` ( KEY `module` (`module`), KEY `field` (`field`), KEY `action` (`action`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowversion`; CREATE TABLE IF NOT EXISTS `zt_workflowversion` ( @@ -8753,7 +8765,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowversion` ( UNIQUE KEY `moduleversion` (`module`, `version`), KEY `module` (`module`), KEY `version` (`version`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workflowreport`; CREATE TABLE IF NOT EXISTS `zt_workflowreport` ( @@ -8769,7 +8781,7 @@ CREATE TABLE IF NOT EXISTS `zt_workflowreport` ( `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, PRIMARY KEY `id` (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_action` CHANGE `action` `action` varchar(80) NOT NULL DEFAULT ''; ALTER TABLE `zt_action` CHANGE `extra` `extra` text; @@ -8992,7 +9004,7 @@ CREATE TABLE IF NOT EXISTS `zt_durationestimation` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_workestimation`; CREATE TABLE IF NOT EXISTS `zt_workestimation` ( @@ -9012,7 +9024,7 @@ CREATE TABLE IF NOT EXISTS `zt_workestimation` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', `dayHour` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_intervention`; CREATE TABLE IF NOT EXISTS `zt_intervention` ( @@ -9029,7 +9041,7 @@ CREATE TABLE IF NOT EXISTS `zt_intervention` ( `deleted` enum('0','1') NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `project` (`project`,`activity`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_activity`; CREATE TABLE IF NOT EXISTS `zt_activity` ( @@ -9050,7 +9062,7 @@ CREATE TABLE IF NOT EXISTS `zt_activity` ( `order` mediumint(8) DEFAULT '0', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_auditcl`; CREATE TABLE IF NOT EXISTS `zt_auditcl` ( @@ -9071,7 +9083,7 @@ CREATE TABLE IF NOT EXISTS `zt_auditcl` ( `assignedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_auditplan`; CREATE TABLE IF NOT EXISTS `zt_auditplan` ( @@ -9099,7 +9111,7 @@ CREATE TABLE IF NOT EXISTS `zt_auditplan` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', `checkBy` varchar(30) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_auditresult`; CREATE TABLE IF NOT EXISTS `zt_auditresult` ( @@ -9120,7 +9132,7 @@ CREATE TABLE IF NOT EXISTS `zt_auditresult` ( `assignedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_nc`; CREATE TABLE IF NOT EXISTS `zt_nc` ( @@ -9149,7 +9161,7 @@ CREATE TABLE IF NOT EXISTS `zt_nc` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_zoutput`; CREATE TABLE IF NOT EXISTS `zt_zoutput` ( @@ -9167,7 +9179,7 @@ CREATE TABLE IF NOT EXISTS `zt_zoutput` ( `order` mediumint(8) DEFAULT '0', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_process`; CREATE TABLE IF NOT EXISTS `zt_process` ( @@ -9188,7 +9200,7 @@ CREATE TABLE IF NOT EXISTS `zt_process` ( `assignedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_programactivity`; CREATE TABLE IF NOT EXISTS `zt_programactivity` ( @@ -9206,7 +9218,7 @@ CREATE TABLE IF NOT EXISTS `zt_programactivity` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_programoutput`; CREATE TABLE IF NOT EXISTS `zt_programoutput` ( @@ -9225,7 +9237,7 @@ CREATE TABLE IF NOT EXISTS `zt_programoutput` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_programprocess`; CREATE TABLE IF NOT EXISTS `zt_programprocess` ( @@ -9242,7 +9254,7 @@ CREATE TABLE IF NOT EXISTS `zt_programprocess` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_basicmeas`; CREATE TABLE IF NOT EXISTS `zt_basicmeas` ( @@ -9269,7 +9281,7 @@ CREATE TABLE IF NOT EXISTS `zt_basicmeas` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_budget`; CREATE TABLE IF NOT EXISTS `zt_budget` ( @@ -9286,7 +9298,7 @@ CREATE TABLE IF NOT EXISTS `zt_budget` ( `lastEditedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_researchplan`; CREATE TABLE IF NOT EXISTS `zt_researchplan` ( @@ -9309,7 +9321,7 @@ CREATE TABLE IF NOT EXISTS `zt_researchplan` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_researchreport`; CREATE TABLE IF NOT EXISTS `zt_researchreport` ( @@ -9331,7 +9343,7 @@ CREATE TABLE IF NOT EXISTS `zt_researchreport` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_meeting`; CREATE TABLE IF NOT EXISTS `zt_meeting` ( @@ -9359,7 +9371,7 @@ CREATE TABLE IF NOT EXISTS `zt_meeting` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM CHARSET=utf8; +) ENGINE=InnoDB CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_meetingroom`; CREATE TABLE IF NOT EXISTS `zt_meetingroom` ( @@ -9375,7 +9387,7 @@ CREATE TABLE IF NOT EXISTS `zt_meetingroom` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM CHARSET=utf8; +) ENGINE=InnoDB CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_assetlib`; CREATE TABLE IF NOT EXISTS `zt_assetlib` ( @@ -9389,7 +9401,7 @@ CREATE TABLE IF NOT EXISTS `zt_assetlib` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM CHARSET=utf8; +) ENGINE=InnoDB CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_meastemplate`; CREATE TABLE IF NOT EXISTS `zt_meastemplate` ( @@ -9401,7 +9413,7 @@ CREATE TABLE IF NOT EXISTS `zt_meastemplate` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_programreport`; CREATE TABLE IF NOT EXISTS `zt_programreport` ( @@ -9415,7 +9427,7 @@ CREATE TABLE IF NOT EXISTS `zt_programreport` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_measrecords`; CREATE TABLE IF NOT EXISTS `zt_measrecords` ( @@ -9437,7 +9449,7 @@ CREATE TABLE IF NOT EXISTS `zt_measrecords` ( KEY `product` (`product`), KEY `project` (`project`), KEY `time` (`year`, `month`, `day`, `week`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_object`; CREATE TABLE IF NOT EXISTS `zt_object` ( @@ -9460,7 +9472,7 @@ CREATE TABLE IF NOT EXISTS `zt_object` ( `createdBy` char(30) NOT NULL, `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_review`; CREATE TABLE IF NOT EXISTS `zt_review` ( @@ -9487,7 +9499,7 @@ CREATE TABLE IF NOT EXISTS `zt_review` ( `auditResult` char(30) NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_reviewcl`; CREATE TABLE IF NOT EXISTS `zt_reviewcl` ( @@ -9506,7 +9518,7 @@ CREATE TABLE IF NOT EXISTS `zt_reviewcl` ( `assignedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_reviewresult`; CREATE TABLE IF NOT EXISTS `zt_reviewresult` ( @@ -9520,7 +9532,7 @@ CREATE TABLE IF NOT EXISTS `zt_reviewresult` ( `createdDate` date NOT NULL, `consumed` float NOT NULL, UNIQUE KEY `reviewer` (`review`,`reviewer`,`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_reviewissue`; CREATE TABLE IF NOT EXISTS `zt_reviewissue` ( @@ -9543,7 +9555,7 @@ CREATE TABLE IF NOT EXISTS `zt_reviewissue` ( `createdDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_reviewlist`; CREATE TABLE IF NOT EXISTS `zt_reviewlist` ( @@ -9560,7 +9572,7 @@ CREATE TABLE IF NOT EXISTS `zt_reviewlist` ( `assignedBy` varchar(30) NOT NULL, `assignedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0' -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_cmcl`; CREATE TABLE IF NOT EXISTS `zt_cmcl` ( @@ -9577,7 +9589,7 @@ CREATE TABLE IF NOT EXISTS `zt_cmcl` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_solutions`; CREATE TABLE IF NOT EXISTS `zt_solutions` ( @@ -9594,7 +9606,7 @@ CREATE TABLE IF NOT EXISTS `zt_solutions` ( `editedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_measqueue`; CREATE TABLE IF NOT EXISTS `zt_measqueue` ( @@ -9610,7 +9622,7 @@ CREATE TABLE IF NOT EXISTS `zt_measqueue` ( `updateDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_issue`; CREATE TABLE IF NOT EXISTS `zt_issue` ( @@ -9648,7 +9660,7 @@ CREATE TABLE IF NOT EXISTS `zt_issue` ( `approvedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_risk`; CREATE TABLE IF NOT EXISTS `zt_risk` ( @@ -9694,14 +9706,14 @@ CREATE TABLE IF NOT EXISTS `zt_risk` ( `approvedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_riskissue`; CREATE TABLE IF NOT EXISTS `zt_riskissue` ( `risk` mediumint(8) unsigned NOT NULL, `issue` mediumint(8) unsigned NOT NULL, UNIQUE KEY `risk_issue` (`risk`,`issue`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_opportunity`; CREATE TABLE IF NOT EXISTS `zt_opportunity` ( @@ -9747,7 +9759,7 @@ CREATE TABLE IF NOT EXISTS `zt_opportunity` ( `lastCheckedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_trainplan`; CREATE TABLE IF NOT EXISTS `zt_trainplan` ( @@ -9768,7 +9780,7 @@ CREATE TABLE IF NOT EXISTS `zt_trainplan` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_gapanalysis`; CREATE TABLE IF NOT EXISTS `zt_gapanalysis` ( @@ -9785,7 +9797,7 @@ CREATE TABLE IF NOT EXISTS `zt_gapanalysis` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `project_account` (`project`,`account`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `zt_bug` ADD `injection` mediumint(8) unsigned NOT NULL AFTER `product`, @@ -13568,7 +13580,7 @@ CREATE TABLE IF NOT EXISTS `zt_sqlview` ( `editedDate` datetime NOT NULL, `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; SET global log_bin_trust_function_creators = 1; SET global sql_mode = ''; USE `__TABLE__`; diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d7d9d383e2..74446de91a 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,121 @@ +2022-07-27 17.4 +完成的需求 +开源版: +25633 项目集可以按照状态进行检索 +30848 通用看板团队成员可以从系统通讯录中添加 +32326 地盘最新动态区块中过滤掉当前用户无权访问的动态 +32327 组织动态列表中过滤掉当前用户无权访问的动态 +32331 计划的需求列表打开需求后返回列表时,保持列表排序 +32679 添加待办页面增加指派给操作 +33311 Bug关联相关Bug后可以实现互相关联 +33316 软件需求详情的相关信息中增加相关版本信息 +33317 软件需求详情的相关信息中增加相关发布信息 +33594 地盘项目统计区块的排序规则和项目集列表保持一致 +34037 调整文档中富文本和Markdown类型文档的创建流程 +34136 详情页点击撤销评审后保留在该页面局部刷新 +34172 全局设置中增加是否启用代号的设置功能 +34282 调整文档全局创建流程第一步 +34285 调整文档全局创建流程第二步 +34292 文档编辑默认进入创建页面 +34486 开启或关闭代号功能后项目集的代号信息处理规则 +34487 开启或关闭代号功能后产品的代号信息处理规则 +34488 开启或关闭代号功能后项目的代号信息处理规则 +34489 开启或关闭代号功能后执行的代号信息处理规则 +34577 已删除的项目集、产品、项目、执行不参与是否同名和同代号的判断 +34732 专业研发看板项目二级导航中打印设置菜单 +34733 打印专业研发看板项目设置功能的三级导航菜单 +34734 实现专业研发看板项目的白名单页面及功能 +34735 实现专业研发看板项目的产品页面及功能 +34736 实现专业研发看板项目的团队页面及功能 +34737 专业研发看板二级导航中打印设置菜单 +34738 打印看板设置功能的三级导航菜单 +34739 实现专业研发看板的概况页面及功能 +34740 实现专业研发看板的产品页面及功能 +34741 实现专业研发看板的团队页面及功能 +34806 计划的Bug列表打开Bug后返回列表时,保持列表排序 +34888 权限成员维护页面支持长按鼠标拖动后批量勾选功能 +34923 在权限维护页面点击保存后继续保留在当前页面 +35191 任务提交页面中,测试任务类型的多选文案显示完整 +35205 实现专业研发看板的白名单页面及功能 +35305 搜索展开保存条件时,保存搜索条件按钮左移 +34618 调用API浏览Gitea合并请求列表 +34619 调用API浏览Gitea合并请求概述 +34620 调用API查看Gitea合并请求中的代码改动 +34633 Gitea合并请求可以关联禅道的需求、任务以及Bug +34634 调用API创建Gitea合并请求 +34635 调用API删除Gitea合并请求 +34636 调用API实现Gitea合并请求的评审 +34637 Gitea合并请求合并后调用API删除源分支 +34638 调用API实现Gitea合并请求的合并 +35241 在合并请求列表显示创建时间 +35249 合并请求概况页面显示历史记录 +35251 实现Gitea代码库下的代码对比功能 +企业版: +29884 执行任务导出数据的名称增加来源Bug的信息 +32192 组织菜单调整为团队、日程、日志、动态、公司 +33191 加班申请通过后,办公我的考勤列表中操作/状态列展示“已加班” +33201 办公考勤的列表的标题字号修改为16px +33219 办公公司考勤页面中列表表头固定 +33222 增加办公公司考勤表格的底部栏高度 +33242 反馈页的通知改为“接收邮件通知” +33244 创建反馈时必填项校验在字段下方红字展示 +33248 办公请假页面展示逻辑优化 +33252 反馈功能的权限模块icon调整 +33254 反馈权限列表中用户数量超出列宽时用省略号示意 +33397 缩短办公节假日页面中左侧的时间目录宽度 +33421 运维服务列表页面字段过长时省略显示 +33423 运维账号页面列表为空时的快捷新建页面改为弹窗样式 +34683 增加反馈转研发需求页面中父需求的标题宽度 +34684 增大反馈转研发需求页面中反馈者的输入框宽度 +34721 组织日志页面置顶显示滚动条 +34730 固定组织日志页面日志详情的展示位置 +旗舰版: +31845 修改项目风险列表中的挂起操作图标 +33122 修改问题列表的创建日期显示内容 +33305 项目问题列表页面优先级字段居中显示 +33511 修改资产问题库中问题列表中“优先级”为“P” +33512 修改资产风险库列表页面“优先级”为“P” +33514 修改资产机会库列表页面“优先级”为“P” +33525 资产需求库需求列表页面审批字段居左显示 +33528 资产问题库问题列表页面审批字段居左显示 +33529 资产风险库风险列表页面审批字段居左显示 +33530 资产机会库机会列表页面审批字段居左显示 +33823 问题指派页面增加备注 +34097 修改执行QA不符合项详情页面中解决图标 +34729 QA质量保证计划可以批量编辑 +30071 项目甘特图中增加任务名称的显示 +28556 瀑布项目中计划的甘特图支持按日/周/月维度查看 +29700 项目甘特图中的任务支持点击查看详情 +29944 项目甘特图中支持显示阶段和任务的负责人 +34795 项目甘特图可以在阶段或任务前增加图标显示状态 +34742 项目甘特图中没有起止日期的任务的时间显示为所属阶段时间 +禅道客户端: +34124 XXD可以从XXB主动拉取配置 +34123 喧喧增加禅道的checktable.php以便自动修复数据库 +34122 去掉XXD中无意义的错误日志 +33667 通知中心的信息通知逻辑优化 +33665 修改通知中心的样式 +33464 禅道客户端支持弹窗显示 +33216 禅道客户端重连后不用跳到地盘页面 +33213 喧喧webview中增加加载中的过渡页面 +33196 合并禅道客户端禅道上方导航栏和窗口控制栏 +33187 喧喧一键安装包采用新的控制面板 +33068 实现客户端修改个人信息的功能 +33066 将群的设为公开和白名单设置放入群设置弹窗 +33065 实现只有群主和管理员才能添加群成员的功能 +33063 实现禁用移动端的功能 +33062 实现群主被删除后自动转让的功能 +32013 输出roadrunner相关文档 +修复的Bug +24009 內禅任务详情页面上一个下一个切换错误 +25389 升级时需要把项目负责人加到团队中 +25439 需求换了执行对应的用例无法关联测试单 +22844 项目中创建或者编辑会议页面关联迭代后会清除之前选择的参会人员 +23200 多人任务串行,可以操作出负的消耗工时 +24357 多人任务填写日志后把日志删除对应的消耗工时仍然存在 +25185 内置报表里,执行状态的下拉框里都没有已完成 +25603 修复新版一键安装包中XXD服务可能安装失败的问题。 + 2022-07-13 17.3 完成的需求 14130 点击按钮执行升级后禁用升级按钮 diff --git a/extension/lite/attend/ext/view/personal.html.php b/extension/lite/attend/ext/view/personal.html.php index 0aba583577..4815bfeb3b 100644 --- a/extension/lite/attend/ext/view/personal.html.php +++ b/extension/lite/attend/ext/view/personal.html.php @@ -151,6 +151,10 @@ + + + + diff --git a/extension/lite/common/ext/lang/zh-cn/lite.php b/extension/lite/common/ext/lang/zh-cn/lite.php index edf2a0267d..91cf62d7ba 100644 --- a/extension/lite/common/ext/lang/zh-cn/lite.php +++ b/extension/lite/common/ext/lang/zh-cn/lite.php @@ -197,11 +197,12 @@ $lang->admin->menu->dev['menuOrder'][15] = 'editor'; $lang->admin->menu->dev['menuOrder'][20] = 'entry'; $lang->admin->menu->system['subMenu'] = new stdclass(); -$lang->admin->menu->system['subMenu']->data = array('link' => "{$lang->admin->data}|backup|index", 'subModule' => 'action'); +$lang->admin->menu->system['subMenu']->backup = array('link' => "{$lang->backup->common}|backup|index"); $lang->admin->menu->system['subMenu']->safe = array('link' => "$lang->security|admin|safe", 'alias' => 'checkweak'); $lang->admin->menu->system['subMenu']->cron = array('link' => "{$lang->admin->cron}|cron|index", 'subModule' => 'cron'); $lang->admin->menu->system['subMenu']->timezone = array('link' => "$lang->timezone|custom|timezone"); $lang->admin->menu->system['subMenu']->buildIndex = array('link' => "{$lang->admin->buildIndex}|search|buildindex|"); +$lang->admin->menu->system['subMenu']->trash = array('link' => "{$lang->action->trash}|action|trash"); if($config->visions == ',lite,' and $config->edition != 'open') $lang->admin->menu->system['subMenu']->license = array('link' => "授权信息|admin|license'", 'alias' => 'license'); if($config->visions != ',lite,') unset($lang->admin->menu->system['subMenu']->buildIndex); diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index d7cff9a3e1..5e563f9c1a 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -172,11 +172,6 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; product->getByID($productID)->name ?> -
- - - -
@@ -588,11 +583,5 @@ function setBadgeStyle(obj, isShow) $label.find('.label-badge').css({"color":"#838a9d", "border-color":"#838a9d"}); } } - -function handleLinkButtonClick() -{ - var xxcUrl = "xxc:openInApp/zentao-integrated/" + encodeURIComponent(window.location.href.replace(/.display=card/, '').replace('xhtml', 'html')); - window.open(xxcUrl); -} app->getModuleRoot() . '/common/view/footer.html.php';?> diff --git a/extension/lite/project/ext/view/create.html.php b/extension/lite/project/ext/view/create.html.php index dcaead759c..a105f7a5b7 100644 --- a/extension/lite/project/ext/view/create.html.php +++ b/extension/lite/project/ext/view/create.html.php @@ -40,10 +40,12 @@ project->name;?> + setCode) or $config->setCode == 1):?> project->code;?> + project->PM;?> diff --git a/extension/lite/project/ext/view/execution.html.php b/extension/lite/project/ext/view/execution.html.php index a11aaf3846..8961898aad 100644 --- a/extension/lite/project/ext/view/execution.html.php +++ b/extension/lite/project/ext/view/execution.html.php @@ -14,7 +14,7 @@ " . $lang->searchAB, '', "class='btn btn-link querybox-toggle'"); echo html::a('javascript:fullScreen()', " " . $lang->kanban->fullScreen, '', "class='btn btn-link'"); + if(common::hasPriv('execution', 'setKanban')) echo html::a(helper::createLink('execution', 'setKanban', "executionID=$execution->id", '', true), ' ' . $lang->settings, '', "class='iframe btn btn-link text-left' data-width='$width'"); + if(common::hasPriv('execution', 'edit')) echo html::a(helper::createLink('execution', 'edit', "executionID=$execution->id", '', true), ' ' . $lang->edit, '', "class='iframe btn btn-link text-left' data-width='80%'"); $actions = ''; - $printCreateRegion = (common::hasPriv('kanban', 'createRegion') and $groupBy == 'default'); - $printSettingBtn = ($printCreateRegion or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); + $printSettingBtn = (common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); if($printSettingBtn) { - $actions .= html::a('javascript:;', "" . $lang->kanban->setting, '', "data-toggle='dropdown' class='btn btn-link'"); - $actions .= "
'; } echo $actions; @@ -230,9 +228,10 @@ js::set('priv', name;?>
- +
diff --git a/module/execution/view/setkanban.html.php b/module/execution/view/setkanban.html.php new file mode 100644 index 0000000000..7871fe9411 --- /dev/null +++ b/module/execution/view/setkanban.html.php @@ -0,0 +1,42 @@ + + * @package execution + * @version $Id: edit.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + +
+
+
+

+ execution->setKanban;?> +

+
+ + + + + + + 1):?> + + + + + + + + + + +
kanban->columnWidth;?>kanbancolumn->fluidBoardList, $execution->fluidBoard));?>
kanban->laneHeight;?>kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?>
+ +
+
+ diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 0fd94dc27d..6b69a30834 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -49,13 +49,12 @@
- createLink('execution', 'story', "executionID=$execution->id&orderBy=order_desc&type=all"), "{$lang->all}" . ($type == 'all' ? " {$pager->recTotal}" : ''), '', "class='btn btn-link" . ($type == 'all' ? " btn-active-text" : '') . "'"); - echo html::a($this->createLink('execution', 'story', "executionID=$execution->id&orderBy=order_desc&type=unclosed"), "{$lang->story->unclosed}" . ($type == 'unclosed' ? " {$pager->recTotal}" : ''), '', "class='btn btn-link" . ($type == 'unclosed' ? " btn-active-text" : '') . "'"); - } - ?> + story->featureBar['browse'] as $featureType => $label):?> + + $label";?> + {$pager->recTotal}";?> + id&orderBy=order_desc&type=$featureType"), $label, '', "class='btn btn-link $active'");?> + product->searchStory;?>
@@ -155,11 +154,6 @@ project->getById($execution->project)->name . ' / ' . $this->execution->getByID($execution->id)->name) ?> -
- - - -
@@ -398,11 +392,6 @@ $(function() } }); }); -function handleLinkButtonClick() -{ - var xxcUrl = "xxc:openInApp/zentao-integrated/" + encodeURIComponent(window.location.href.replace(/.display=card/, '').replace('xhtml', 'html')); - window.open(xxcUrl); -} $(function(){$('#executionStoryForm').table();}) diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index c22f33ac04..6b722f4ed8 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -59,6 +59,7 @@ body {margin-bottom: 25px;}
type == 'ops' && $menuItem->name == 'needconfirm') continue; @@ -174,11 +175,6 @@ body {margin-bottom: 25px;} -
- - - -
@@ -198,7 +194,7 @@ body {margin-bottom: 25px;}

task->noTask;?> - + " . $lang->task->create, '', "class='btn btn-info'");?>

@@ -475,12 +471,6 @@ $(function() }); app->getViewType() == 'xhtml'):?> -function handleLinkButtonClick() -{ - var xxcUrl = "xxc:openInApp/zentao-integrated/" + encodeURIComponent(window.location.href.replace(/.display=card/, '').replace('xhtml', 'html')); - window.open(xxcUrl); -} - $(function() { function handleClientReady() diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index fffb0e79c6..8ce420b01a 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -71,12 +71,13 @@
"; echo html::a('javascript:;', "", '', "data-toggle='dropdown' class='btn btn-link'"); echo "
'; ?> ';?> - ' . html::a(helper::createLink('execution', 'importBug', "execution=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe'") . '';?> + ' . html::a(helper::createLink('execution', 'importBug', "execution=$execution->id", '', true), $lang->execution->importBug, '', "class='iframe' data-width='90%'") . '';?> ' . html::a(helper::createLink('task', 'create', "execution=$execution->id", '', true), $lang->task->create, '', "class='iframe'") . '';?> ' . html::a(helper::createLink('task', 'batchCreate', "execution=$execution->id", '', true), $lang->execution->batchCreateTask, '', "class='iframe' data-width=90%") . '';?> diff --git a/module/execution/view/team.html.php b/module/execution/view/team.html.php index ef263f7bdb..5573476195 100644 --- a/module/execution/view/team.html.php +++ b/module/execution/view/team.html.php @@ -94,7 +94,7 @@ id, $member->userID)", '', '', "class='btni' title='{$lang->execution->unlinkMember}'"); + echo html::a("javascript:deleteMember($execution->id, $member->userID)", '', '', "class='btn' title='{$lang->execution->unlinkMember}'"); } ?> diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 719f49369c..938dcafd6b 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -10,20 +10,26 @@ * @link http://www.zentao.net */ ?> +config->webRoot . 'js/echarts/echarts.common.min.js'); ?> + +execution->count); ?>
>
+ type) and $execution->type != 'kanban'):?>
name . $lang->execution->burn;?>
+ +
@@ -45,9 +51,11 @@
execution->latestDynamic;?>
+ +
    @@ -67,9 +75,11 @@
    execution->relatedMember;?>
    + +
    @@ -111,9 +121,11 @@
    execution->doclib;?>
    + +
    @@ -138,6 +150,98 @@
    + +
    +
    +
    +
    name . $lang->execution->CFD;?>
    + + + +
    +
    + + +
    +
    +
    + +
    +

    execution->noPrintData;?>

    +
    + + +
    +
    +
    +
    +
    +
    +
    execution->relatedMember;?>
    + + + +
    +
    +
    + + PM):?> + + PM]);?> +
    PM);?> (execution->PM;?>)
    + + PO):?> + + PO]);?> +
    PO);?> (execution->PO;?>)
    + + QD):?> + + QD]);?> +
    QD);?> (execution->QD;?>)
    + + RD):?> + + RD]);?> +
    RD);?> (execution->RD;?>)
    + + + + $i) break;?> +
    account);?>
    + + +
    + id", "  " . $lang->execution->manageMembers, '', "class='text-muted'");?> +
    +
    +
    +
    +
    +
    +
    +
    +
    execution->latestDynamic;?>
    +
    +
    +
      + +
    • major) echo "class='active'";?>> +
      + date;?> + actor) . ' ' . "{$action->actionLabel}" . $action->objectLabel . ' ' . html::a($action->objectLink, $action->objectName, '', "title='$action->objectName'");?> +
      +
    • + +
    +
    +
    +
    + printExtendFields($execution, 'div', "position=left&inForm=0");?>
    @@ -158,14 +262,17 @@
    -

    id;?> code;?> name;?>

    + setCode) and $config->setCode == 0) ? 'hidden' : '';?> +

    id;?> code;?> name;?>

    deleted):?> execution->deleted;?> - + + lifetime)):?> execution->lifeTimeList, $execution->lifetime);?> + delay)):?> execution->delayed;?> @@ -217,7 +324,7 @@

    execution->manageProducts;?> - id", '', '', "class='btn btn-link pull-right muted'");?> + id", '', '', "class='btn btn-link pull-right muted'");?>
    @@ -341,6 +448,7 @@ diff --git a/module/extension/model.php b/module/extension/model.php index 65b218cf7e..00ff3b74ad 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -57,20 +57,8 @@ class extensionModel extends model */ public function fetchAPI($url) { - $this->app->loadConfig('upgrade'); - $version = $this->config->version; - if(strpos($version, 'biz') !== false) - { - $version = str_replace('.', '_', $version); - if(isset($this->config->bizVersion[$version])) $version = $this->config->bizVersion[$version]; - $version = str_replace('_', '.', $version); - } - if(strpos($version, 'pro') !== false) - { - $version = str_replace('.', '_', $version); - if(isset($this->config->proVersion[$version])) $version = $this->config->proVersion[$version]; - $version = str_replace('_', '.', $version); - } + $version = $this->loadModel('upgrade')->getOpenVersion(str_replace('.', '_', $this->config->version)); + $version = str_replace('_', '.', $version); $url .= (strpos($url, '?') === false ? '?' : '&') . 'lang=' . str_replace('-', '_', $this->app->getClientLang()) . '&managerVersion=' . self::EXT_MANAGER_VERSION . '&zentaoVersion=' . $version; $result = json_decode(common::http($url)); diff --git a/module/file/control.php b/module/file/control.php index 5320c04355..aee24d9940 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -341,12 +341,10 @@ class file extends control /* Update test case version for test case synchronization. */ if($file->objectType == 'testcase' and $file->title != $fileName) $this->file->updateTestcaseVersion($file); + $newFile = $this->file->getByID($fileID); - return print(js::reload('parent.parent')); + echo json_encode($newFile); } - - $this->view->file = $this->file->getById($fileID); - $this->display(); } /** diff --git a/module/file/model.php b/module/file/model.php index 2e68a57ab0..307368e266 100644 --- a/module/file/model.php +++ b/module/file/model.php @@ -1017,7 +1017,7 @@ class fileModel extends model { if($this->config->file->storageType == 'fs') { - return getimagesize($file->realPath); + return file_exists($file->realPath) ? getimagesize($file->realPath) : 0; } else if($this->config->file->storageType == 's3') { diff --git a/module/file/view/edit.html.php b/module/file/view/edit.html.php deleted file mode 100644 index 1329925822..0000000000 --- a/module/file/view/edit.html.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @package file - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - - -
    -
    -
    -
    -

    file->inputFileName;?>

    -
    - title, '.') !== false) - { - /* Fix the file name exe.exe */ - $title = explode('.', $file->title); - $extension = end($title); - if($file->extension == 'txt' && $extension != $file->extension) $file->extension = $extension; - array_pop($title); - $file->title = join('.', $title); - } - ?> -
    - - - - - -
    -
    - title, "class='form-control' size='40'");?> - - .extension;?> -
    -
    -
    -
    -
    -
    - diff --git a/module/file/view/viewfiles.html.php b/module/file/view/viewfiles.html.php index 15990a8c8e..a1534e45d3 100644 --- a/module/file/view/viewfiles.html.php +++ b/module/file/view/viewfiles.html.php @@ -6,19 +6,39 @@
      - + + file->uploadDate . substr($file->addedDate, 0, 10); + $fileTitle = "  " . $file->title; + if(strpos($file->title, ".{$file->extension}") === false && $file->extension != 'txt') $fileTitle .= ".{$file->extension}"; + $imageWidth = 0; + if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false) { - $uploadDate = $lang->file->uploadDate . substr($file->addedDate, 0, 10); - $fileTitle = "  " . $file->title; - if(strpos($file->title, ".{$file->extension}") === false && $file->extension != 'txt') $fileTitle .= ".{$file->extension}"; - $imageWidth = 0; - if(stripos('jpg|jpeg|gif|png|bmp', $file->extension) !== false) + $imageSize = $this->file->getImageSize($file); + $imageWidth = $imageSize ? $imageSize[0] : 0; + } + + $fileSize = 0; + /* Show size info. */ + if($file->size < 1024) + { + $fileSize = $file->size . 'B'; + } + elseif($file->size < 1024 * 1024) + { + $file->size = round($file->size / 1024, 2); + $fileSize = $file->size . 'K'; + } + elseif($file->size < 1024 * 1024 * 1024) + { + $file->size = round($file->size / (1024 * 1024), 2); + $fileSize = $file->size . 'M'; + } + else + { + $file->size = round($file->size / (1024 * 1024 * 1024), 2); + $fileSize = $file->size . 'G'; + } + + $downloadLink = $this->createLink('file', 'download', "fileID=$file->id"); + $downloadLink .= strpos($downloadLink, '?') === false ? '?' : '&'; + $downloadLink .= $sessionString; + echo "
    • " . html::a($downloadLink, $fileTitle . " ({$fileSize})", '_blank', "id='fileTitle$file->id' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\""); + + $objectType = zget($this->config->file->objectType, $file->objectType); + if(common::hasPriv($objectType, 'edit', $object)) + { + echo "  "; + + /* Determines whether the file supports preview. */ + if($file->extension == 'txt') { - $imageSize = $this->file->getImageSize($file); - $imageWidth = $imageSize ? $imageSize[0] : 0; + $extension = 'txt'; + if(($postion = strrpos($file->title, '.')) !== false) $extension = substr($file->title, $postion + 1); + if($extension != 'txt') $mode = 'down'; + $file->extension = $extension; } - $fileSize = 0; - /* Show size info. */ - if($file->size < 1024) + /* For the open source version of the file judgment. */ + if(stripos('txt|jpg|jpeg|gif|png|bmp', $file->extension) !== false) { - $fileSize = $file->size . 'B'; - } - elseif($file->size < 1024 * 1024) - { - $file->size = round($file->size / 1024, 2); - $fileSize = $file->size . 'K'; - } - elseif($file->size < 1024 * 1024 * 1024) - { - $file->size = round($file->size / (1024 * 1024), 2); - $fileSize = $file->size . 'M'; - } - else - { - $file->size = round($file->size / (1024 * 1024 * 1024), 2); - $fileSize = $file->size . 'G'; + echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\""); } - $downloadLink = $this->createLink('file', 'download', "fileID=$file->id"); - $downloadLink .= strpos($downloadLink, '?') === false ? '?' : '&'; - $downloadLink .= $sessionString; - echo "
    • " . html::a($downloadLink, $fileTitle . " ({$fileSize})", '_blank', "onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\""); - - $objectType = zget($this->config->file->objectType, $file->objectType); - if(common::hasPriv($objectType, 'edit', $object)) + /* For the max version of the file judgment. */ + if(isset($this->config->file->libreOfficeTurnon) and $this->config->file->libreOfficeTurnon == 1) { - echo "  "; - - /* Determines whether the file supports preview. */ - if($file->extension == 'txt') - { - $extension = 'txt'; - if(($postion = strrpos($file->title, '.')) !== false) $extension = substr($file->title, $postion + 1); - if($extension != 'txt') $mode = 'down'; - $file->extension = $extension; - } - - /* For the open source version of the file judgment. */ - if(stripos('txt|jpg|jpeg|gif|png|bmp', $file->extension) !== false) + $officeTypes = 'doc|docx|xls|xlsx|ppt|pptx|pdf'; + if(stripos($officeTypes, $file->extension) !== false) { echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\""); } - - /* For the max version of the file judgment. */ - if(isset($this->config->file->libreOfficeTurnon) and $this->config->file->libreOfficeTurnon == 1) - { - $officeTypes = 'doc|docx|xls|xlsx|ppt|pptx|pdf'; - if(stripos($officeTypes, $file->extension) !== false) - { - echo html::a($downloadLink, $lang->file->preview, '_blank', "class='fileAction btn btn-link text-primary' onclick=\"return downloadFile($file->id, '$file->extension', $imageWidth, '$file->title')\""); - } - } - - common::printLink('file', 'download', "fileID=$file->id", $lang->file->downloadFile, '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'"); - common::printLink('file', 'edit', "fileID=$file->id", $lang->file->edit, '', "data-width='400' class='fileAction btn btn-link edit iframe text-primary' title='{$lang->file->edit}'"); - if(common::hasPriv('file', 'delete')) echo html::a('###', $lang->delete, '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'"); - echo ''; } - echo '
    • '; + + common::printLink('file', 'download', "fileID=$file->id", $lang->file->downloadFile, '_blank', "class='fileAction btn btn-link text-primary' title='{$lang->file->downloadFile}'"); + if(common::hasPriv('file', 'edit')) echo html::a('###', $lang->file->edit, '', "id='renameFile$file->id' class='fileAction btn btn-link edit text-primary' onclick='showRenameBox($file->id)' title='{$lang->file->edit}'"); + if(common::hasPriv('file', 'delete')) echo html::a('###', $lang->delete, '', "class='fileAction btn btn-link text-primary' onclick='deleteFile($file->id)' title='$lang->delete'"); + echo ''; } - } - ?> + echo '';?> + +
    • +
      + title, '.') !== false) + { + /* Fix the file name exe.exe */ + $title = explode('.', $file->title); + $extension = end($title); + if($file->extension == 'txt' && $extension != $file->extension) $file->extension = $extension; + array_pop($title); + $file->title = join('.', $title); + } + ?> + +
      +
    • + + +
    diff --git a/module/git/model.php b/module/git/model.php index 1632d45f6a..231e79682f 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -131,8 +131,14 @@ class gitModel extends model $gitlabAccountPairs = array(); if($repo->SCM == 'Gitlab') { - $gitlabUserList = $this->loadModel('gitlab')->apiGetUsers($repo->gitlab); - $acountIDPairs = $this->gitlab->getUserIdAccountPairs($repo->gitlab); + $gitlabUserList = $this->loadModel('gitlab')->apiGetUsers($repo->gitService); + $acountIDPairs = $this->gitlab->getUserIdAccountPairs($repo->gitService); + foreach($gitlabUserList as $gitlabUser) $gitlabAccountPairs[$gitlabUser->realname] = zget($acountIDPairs, $gitlabUser->id, ''); + } + elseif($repo->SCM == 'Gitea') + { + $gitlabUserList = $this->loadModel('gitea')->apiGetUsers($repo->gitService); + $acountIDPairs = $this->gitea->getUserAccountIdPairs($repo->gitService, 'openID,account'); foreach($gitlabUserList as $gitlabUser) $gitlabAccountPairs[$gitlabUser->realname] = zget($acountIDPairs, $gitlabUser->id, ''); } @@ -166,7 +172,10 @@ class gitModel extends model if($printLog) $this->printLog("parsing log {$log->revision}"); if($printLog) $this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------"); - $objects = $this->repo->parseComment($log->msg); + $objects = $this->repo->parseComment($log->msg); + $lastVersion = $version; + $version = $this->repo->saveOneCommit($repo->id, $log, $version, $branch); + if($objects) { if($printLog) $this->printLog('extract' . @@ -174,7 +183,7 @@ class gitModel extends model ' task:' . join(' ', $objects['tasks']) . ' bug:' . join(',', $objects['bugs'])); - $this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git', $gitlabAccountPairs); + if($lastVersion != $version) $this->repo->saveAction2PMS($objects, $log, $this->repoRoot, $repo->encoding, 'git', $gitlabAccountPairs); } else { @@ -190,7 +199,6 @@ class gitModel extends model if(strpos($log->msg, $comment) !== false) $this->loadModel('compile')->createByJob($job->id); } } - $version = $this->repo->saveOneCommit($repo->id, $log, $version, $branch); $commits += count($logs); } } diff --git a/module/gitea/control.php b/module/gitea/control.php index 413f2c2e52..cd18b89de5 100644 --- a/module/gitea/control.php +++ b/module/gitea/control.php @@ -43,6 +43,12 @@ class gitea extends control /* Admin user don't need bind. */ $giteaList = $this->gitea->getList($orderBy, $pager); + $myGiteas = $this->gitea->getGiteaListByAccount(); + foreach($giteaList as $gitea) + { + $gitea->isBindUser = true; + if(!$this->app->user->admin and !isset($myGiteas[$gitea->id])) $gitea->isBindUser = false; + } $this->view->title = $this->lang->gitea->common . $this->lang->colon . $this->lang->gitea->browse; $this->view->giteaList = $giteaList; @@ -164,4 +170,53 @@ class gitea extends control return true; } + + /** + * Bind gitea user to zentao users. + * + * @param int $giteaID + * @access public + * @return void + */ + public function bindUser($giteaID) + { + $zentaoUsers = $this->dao->select('account,email,realname')->from(TABLE_USER)->fetchAll('account'); + $userPairs = $this->loadModel('user')->getPairs('noclosed|noletter'); + + if($_POST) + { + $this->gitea->bindUser($giteaID); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer)); + } + + $this->view->title = $this->lang->gitea->bindUser; + $this->view->userPairs = $userPairs; + $this->view->giteaUsers = $this->gitea->apiGetUsers($giteaID); + $this->view->bindedUsers = $this->gitea->getUserAccountIdPairs($giteaID); + $this->view->matchedResult = $this->gitea->getMatchedUsers($giteaID, $this->view->giteaUsers, $zentaoUsers); + $this->display(); + } + + /** + * Ajax getProjectBranches + * + * @param int $giteaID + * @param string $project + * @access public + * @return void + */ + public function ajaxGetProjectBranches($giteaID, $project) + { + if(!$giteaID or !$project) return $this->send(array('message' => array())); + + $project = urldecode(base64_decode($project)); + $branches = $this->gitea->apiGetBranches($giteaID, $project); + $options = ""; + foreach($branches as $branch) + { + $options .= ""; + } + $this->send($options); + } } diff --git a/module/gitea/lang/de.php b/module/gitea/lang/de.php index 5d0779ba55..5eb0f97d89 100644 --- a/module/gitea/lang/de.php +++ b/module/gitea/lang/de.php @@ -8,6 +8,15 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAvatar = 'Avatar'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->giteaEmail = 'Email'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; @@ -17,8 +26,9 @@ $lang->gitea->name = "Server Name"; $lang->gitea->url = 'Server URL'; $lang->gitea->token = 'Token'; -$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; -$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; +$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->bindUserError = "Can not bind users repeatedly %s"; $lang->gitea->server = "Server List"; $lang->gitea->lblCreate = 'Create Gitea Server'; diff --git a/module/gitea/lang/en.php b/module/gitea/lang/en.php index 5d0779ba55..5eb0f97d89 100644 --- a/module/gitea/lang/en.php +++ b/module/gitea/lang/en.php @@ -8,6 +8,15 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAvatar = 'Avatar'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->giteaEmail = 'Email'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; @@ -17,8 +26,9 @@ $lang->gitea->name = "Server Name"; $lang->gitea->url = 'Server URL'; $lang->gitea->token = 'Token'; -$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; -$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; +$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->bindUserError = "Can not bind users repeatedly %s"; $lang->gitea->server = "Server List"; $lang->gitea->lblCreate = 'Create Gitea Server'; diff --git a/module/gitea/lang/fr.php b/module/gitea/lang/fr.php index 5d0779ba55..5eb0f97d89 100644 --- a/module/gitea/lang/fr.php +++ b/module/gitea/lang/fr.php @@ -8,6 +8,15 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaAvatar = 'Avatar'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->giteaEmail = 'Email'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; @@ -17,8 +26,9 @@ $lang->gitea->name = "Server Name"; $lang->gitea->url = 'Server URL'; $lang->gitea->token = 'Token'; -$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; -$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; +$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->bindUserError = "Can not bind users repeatedly %s"; $lang->gitea->server = "Server List"; $lang->gitea->lblCreate = 'Create Gitea Server'; diff --git a/module/gitea/lang/vi.php b/module/gitea/lang/vi.php index 5d0779ba55..ad89c301d3 100644 --- a/module/gitea/lang/vi.php +++ b/module/gitea/lang/vi.php @@ -8,6 +8,15 @@ $lang->gitea->edit = 'Edit Gitea'; $lang->gitea->view = 'View Gitea'; $lang->gitea->delete = 'Delete Gitea'; $lang->gitea->confirmDelete = 'Do you want to delete this Gitea server?'; +$lang->gitea->giteaAvatar = 'Avatar'; +$lang->gitea->bindUser = 'Bind User'; +$lang->gitea->giteaEmail = 'Email'; +$lang->gitea->giteaAccount = 'Gitea Account'; +$lang->gitea->zentaoAccount = 'Zentao Account'; +$lang->gitea->bindingStatus = 'Binding Status'; +$lang->gitea->notBind = 'Not bind'; +$lang->gitea->binded = 'Binded'; +$lang->gitea->bindDynamic = '%s and Zentao user %s'; $lang->gitea->browseAction = 'Gitea List'; $lang->gitea->deleteAction = 'Delete Gitea'; @@ -17,8 +26,9 @@ $lang->gitea->name = "Server Name"; $lang->gitea->url = 'Server URL'; $lang->gitea->token = 'Token'; -$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; -$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->tokenLimit = "The current token has no admin privilege. Please regenerate one with root user in Gitea."; +$lang->gitea->hostError = "So the current Gitea server address is invalid, please confirm that the current server can be accessed and try again."; +$lang->gitea->bindUserError = "Can not bind users repeatedly %s"; $lang->gitea->server = "Server List"; $lang->gitea->lblCreate = 'Create Gitea Server'; diff --git a/module/gitea/lang/zh-cn.php b/module/gitea/lang/zh-cn.php index dd8da67d29..13e4c187a5 100644 --- a/module/gitea/lang/zh-cn.php +++ b/module/gitea/lang/zh-cn.php @@ -8,6 +8,15 @@ $lang->gitea->edit = '编辑Gitea'; $lang->gitea->view = '查看Gitea'; $lang->gitea->delete = '删除Gitea'; $lang->gitea->confirmDelete = '确认删除该Gitea吗?'; +$lang->gitea->bindUser = '绑定用户'; +$lang->gitea->giteaAvatar = '头像'; +$lang->gitea->giteaAccount = 'Gitea用户'; +$lang->gitea->giteaEmail = '邮箱'; +$lang->gitea->zentaoAccount = '禅道用户'; +$lang->gitea->bindingStatus = '绑定状态'; +$lang->gitea->notBind = '未绑定'; +$lang->gitea->binded = '已绑定'; +$lang->gitea->bindDynamic = '%s与禅道用户%s'; $lang->gitea->browseAction = 'Gitea列表'; $lang->gitea->deleteAction = '删除Gitea'; @@ -17,8 +26,9 @@ $lang->gitea->name = "服务器名称"; $lang->gitea->url = '服务器地址'; $lang->gitea->token = 'Token'; -$lang->gitea->tokenLimit = "Gitea Token权限不足。"; -$lang->gitea->hostError = "当前Gitea服务器地址无效,请确认当前服务器可被访问"; +$lang->gitea->tokenLimit = "Gitea Token权限不足。"; +$lang->gitea->hostError = "当前Gitea服务器地址无效,请确认当前服务器可被访问"; +$lang->gitea->bindUserError = "不能重复绑定用户 %s"; $lang->gitea->server = "服务器列表"; $lang->gitea->lblCreate = '添加Gitea服务器'; diff --git a/module/gitea/lang/zh-tw.php b/module/gitea/lang/zh-tw.php index dd8da67d29..7e273df350 100644 --- a/module/gitea/lang/zh-tw.php +++ b/module/gitea/lang/zh-tw.php @@ -8,6 +8,13 @@ $lang->gitea->edit = '编辑Gitea'; $lang->gitea->view = '查看Gitea'; $lang->gitea->delete = '删除Gitea'; $lang->gitea->confirmDelete = '确认删除该Gitea吗?'; +$lang->gitea->bindUser = '绑定用户'; +$lang->gitea->giteaAccount = 'Gitea用户'; +$lang->gitea->zentaoAccount = '禅道用户'; +$lang->gitea->bindingStatus = '绑定状态'; +$lang->gitea->notBind = '未绑定'; +$lang->gitea->binded = '已绑定'; +$lang->gitea->bindDynamic = '%s与禅道用户%s'; $lang->gitea->browseAction = 'Gitea列表'; $lang->gitea->deleteAction = '删除Gitea'; diff --git a/module/gitea/model.php b/module/gitea/model.php index 2f72de8403..14c2fa89ef 100644 --- a/module/gitea/model.php +++ b/module/gitea/model.php @@ -104,6 +104,63 @@ class giteaModel extends model return $this->loadModel('pipeline')->update($id); } + /** + * Bind users. + * + * @param int $giteaID + * @access public + * @return array + */ + public function bindUser($giteaID) + { + $userPairs = $this->loadModel('user')->getPairs('noclosed|noletter'); + $users = $this->post->zentaoUsers; + $giteaNames = $this->post->giteaUserNames; + $accountList = array(); + $repeatUsers = array(); + foreach($users as $openID => $user) + { + if(empty($user)) continue; + if(isset($accountList[$user])) $repeatUsers[] = zget($userPairs, $user); + $accountList[$user] = $openID; + } + + if(count($repeatUsers)) + { + dao::$errors[] = sprintf($this->lang->gitea->bindUserError, join(',', $repeatUsers)); + return false; + } + + $user = new stdclass; + $user->providerID = $giteaID; + $user->providerType = 'gitea'; + + $oldUsers = $this->dao->select('*')->from(TABLE_OAUTH)->where('providerType')->eq($user->providerType)->andWhere('providerID')->eq($user->providerID)->fetchAll('openID'); + foreach($users as $openID => $account) + { + $existAccount = isset($oldUsers[$openID]) ? $oldUsers[$openID] : ''; + + if($existAccount and $existAccount->account != $account) + { + $this->dao->delete() + ->from(TABLE_OAUTH) + ->where('openID')->eq($openID) + ->andWhere('providerType')->eq($user->providerType) + ->andWhere('providerID')->eq($user->providerID) + ->exec(); + $this->loadModel('action')->create('giteauser', $giteaID, 'unbind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$existAccount->account]->realname)); + } + if(!$existAccount or $existAccount->account != $account) + { + if(!$account) continue; + $user->account = $account; + $user->openID = $openID; + $this->dao->insert(TABLE_OAUTH)->data($user)->exec(); + $this->loadModel('action')->create('giteauser', $giteaID, 'bind', '', sprintf($this->lang->gitea->bindDynamic, $giteaNames[$openID], $zentaoUsers[$account]->realname)); + } + } + } + /** * Api error handling. * @@ -224,4 +281,327 @@ class giteaModel extends model ->andWhere('account')->eq($account) ->fetchPairs('providerID'); } + + /** + * Get zentao account gitea user id pairs of one gitea. + * + * @param int $giteaID + * @access public + * @return array + */ + public function getUserAccountIdPairs($giteaID, $fields = 'account,openID') + { + return $this->dao->select($fields)->from(TABLE_OAUTH) + ->where('providerType')->eq('gitea') + ->andWhere('providerID')->eq($giteaID) + ->fetchPairs(); + } + + /** + * Get gitea user id by zentao account. + * + * @param int $giteaID + * @param string $zentaoAccount + * @access public + * @return array + */ + public function getUserIDByZentaoAccount($giteaID, $zentaoAccount) + { + return $this->dao->select('openID')->from(TABLE_OAUTH) + ->where('providerType')->eq('gitea') + ->andWhere('providerID')->eq($giteaID) + ->andWhere('account')->eq($zentaoAccount) + ->fetch('openID'); + } + + /** + * Get matched gitea users. + * + * @param int $giteaID + * @param array $giteaUsers + * @param array $zentaoUsers + * @access public + * @return array + */ + public function getMatchedUsers($giteaID, $giteaUsers, $zentaoUsers) + { + $matches = new stdclass; + foreach($giteaUsers as $giteaUser) + { + foreach($zentaoUsers as $zentaoUser) + { + if($giteaUser->account == $zentaoUser->account) $matches->accounts[$giteaUser->account][] = $zentaoUser->account; + if($giteaUser->realname == $zentaoUser->realname) $matches->names[$giteaUser->realname][] = $zentaoUser->account; + if($giteaUser->email == $zentaoUser->email) $matches->emails[$giteaUser->email][] = $zentaoUser->account; + } + } + + $bindedUsers = $this->getUserAccountIdPairs($giteaID, 'openID,account'); + $matchedUsers = array(); + foreach($giteaUsers as $giteaUser) + { + if(isset($bindedUsers[$giteaUser->account])) + { + $giteaUser->zentaoAccount = $bindedUsers[$giteaUser->account]; + $matchedUsers[] = $giteaUser; + continue; + } + + $matchedZentaoUsers = array(); + if(isset($matches->accounts[$giteaUser->account])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->accounts[$giteaUser->account]); + if(isset($matches->emails[$giteaUser->email])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->emails[$giteaUser->email]); + if(isset($matches->names[$giteaUser->realname])) $matchedZentaoUsers = array_merge($matchedZentaoUsers, $matches->names[$giteaUser->realname]); + + $matchedZentaoUsers = array_unique($matchedZentaoUsers); + if(count($matchedZentaoUsers) == 1) + { + $giteaUser->zentaoAccount = current($matchedZentaoUsers); + $matchedUsers[] = $giteaUser; + } + } + + return $matchedUsers; + } + + /** + * Get project by api. + * + * @param int $giteaID + * @param int $projectID + * @access public + * @return void + */ + public function apiGetSingleProject($giteaID, $projectID) + { + $apiRoot = $this->getApiRoot($giteaID); + if(!$apiRoot) return array(); + + $url = sprintf($apiRoot, "/repos/$projectID"); + $project = json_decode(commonModel::http($url)); + if(isset($project->name)) + { + $project->name_with_namespace = $project->full_name; + $project->path_with_namespace = $project->full_name; + $project->http_url_to_repo = $project->html_url; + $project->name_with_namespace = $project->full_name; + + $gitea = $this->getByID($giteaID); + $oauth = "oauth2:{$gitea->token}@"; + $project->tokenCloneUrl = preg_replace('/(http(s)?:\/\/)/', "\$1$oauth", $project->html_url); + } + + return $project; + } + + /** + * Get projects by api. + * + * @param int $giteaID + * @param bool $sudo + * @access public + * @return array + */ + public function apiGetProjects($giteaID, $sudo = true) + { + $apiRoot = $this->getApiRoot($giteaID, $sudo); + if(!$apiRoot) return array(); + + $url = sprintf($apiRoot, "/repos/search"); + $allResults = array(); + for($page = 1; true; $page++) + { + $results = json_decode(commonModel::http($url . "&page={$page}&limit=50")); + if(!is_array($results->data)) break; + if(!empty($results->data)) $allResults = array_merge($allResults, $results->data); + if(count($results->data) < 50) break; + } + + return $allResults; + } + + /** + * Get gitea user list. + * + * @param int $giteaID + * @param bool $onlyLinked + * @access public + * @return array + */ + public function apiGetUsers($giteaID, $onlyLinked = false) + { + $response = array(); + $apiRoot = $this->getApiRoot($giteaID); + + for($page = 1; true; $page++) + { + $url = sprintf($apiRoot, "/users/search") . "&page={$page}&limit=50"; + $result = json_decode(commonModel::http($url)); + if(empty($result->data)) break; + + $response = array_merge($response, $result->data); + $page += 1; + } + + if(empty($response)) return array(); + + /* Get linked users. */ + $linkedUsers = array(); + if($onlyLinked) $linkedUsers = $this->getUserAccountIdPairs($giteaID, 'openID,account'); + + $users = array(); + foreach($response as $giteaUser) + { + if($onlyLinked and !isset($linkedUsers[$giteaUser->id])) continue; + + $user = new stdclass; + $user->id = $giteaUser->id; + $user->realname = $giteaUser->full_name ? $giteaUser->full_name : $giteaUser->username; + $user->account = $giteaUser->username; + $user->email = zget($giteaUser, 'email', ''); + $user->avatar = $giteaUser->avatar_url; + $user->createdAt = zget($giteaUser, 'created', ''); + $user->lastActivityOn = zget($giteaUser, 'last_login', ''); + + $users[] = $user; + } + + return $users; + } + + /** + * Get project repository branches by api. + * + * @param int $giteaID + * @param string $project + * @access public + * @return object + */ + public function apiGetBranches($giteaID, $project, $pager = null) + { + $url = sprintf($this->getApiRoot($giteaID), "/repos/{$project}/branches"); + $allResults = array(); + for($page = 1; true; $page++) + { + $results = json_decode(commonModel::http($url . "&page={$page}&limit=50")); + if(!is_array($results)) break; + if(!empty($results)) $allResults = array_merge($allResults, $results); + if(count($results) < 100) break; + } + + return $allResults; + } + + /** + * Get Forks of a project by API. + * + * @param int $giteaID + * @param string $projectID + * @access public + * @return object + */ + public function apiGetForks($giteaID, $projectID) + { + $url = sprintf($this->getApiRoot($giteaID), "/repos/$projectID/forks"); + return json_decode(commonModel::http($url)); + } + + /** + * Get upstream project by API. + * + * @param int $giteaID + * @param string $projectID + * @access public + * @return void + */ + public function apiGetUpstream($giteaID, $projectID) + { + $currentProject = $this->apiGetSingleProject($giteaID, $projectID); + if(isset($currentProject->parent->full_name)) return $currentProject->parent->full_name; + return array(); + } + + /** + * Get branches. + * + * @param int $giteaID + * @param string $project + * @access public + * @return array + */ + public function getBranches($giteaID, $project) + { + $rawBranches = $this->apiGetBranches($giteaID, $project); + + $branches = array(); + foreach($rawBranches as $branch) $branches[] = $branch->name; + + return $branches; + } + + /** + * Get gitea user id and realname pairs of one gitea. + * + * @param int $giteaID + * @access public + * @return array + */ + public function getUserIdRealnamePairs($giteaID) + { + return $this->dao->select('oauth.openID as openID,user.realname as realname') + ->from(TABLE_OAUTH)->alias('oauth') + ->leftJoin(TABLE_USER)->alias('user') + ->on("oauth.account = user.account") + ->where('providerType')->eq('gitea') + ->andWhere('providerID')->eq($giteaID) + ->fetchPairs(); + } + + /** + * Get single branch by API. + * + * @param int $giteaID + * @param string $project + * @param string $branchName + * @access public + * @return object + */ + public function apiGetSingleBranch($giteaID, $project, $branchName) + { + $url = sprintf($this->getApiRoot($giteaID), "/repos/$project/branches/$branchName"); + $branch = json_decode(commonModel::http($url)); + if($branch) + { + $gitea = $this->getByID($giteaID); + $branch->web_url = "{$gitea->url}/$project/src/branch/$branchName"; + } + + return $branch; + } + + /** + * Get protect branches of one project. + * + * @param int $giteaID + * @param string $project + * @param string $keyword + * @access public + * @return array + */ + public function apiGetBranchPrivs($giteaID, $project, $keyword = '') + { + $keyword = urlencode($keyword); + $url = sprintf($this->getApiRoot($giteaID), "/repos/$project/branch_protections"); + $branches = json_decode(commonModel::http($url)); + + if(!is_array($branches)) return $branches; + + $newBranches = array(); + foreach($branches as $branch) + { + $branch->name = $branch->branch_name; + if(empty($keyword) || stristr($branch->name, $keyword)) $newBranches[] = $branch; + } + + return $newBranches; + } } diff --git a/module/gitea/view/binduser.html.php b/module/gitea/view/binduser.html.php new file mode 100644 index 0000000000..7a4a9f3897 --- /dev/null +++ b/module/gitea/view/binduser.html.php @@ -0,0 +1,85 @@ + + * @package gitea + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
    +
    +

    gitea->bindUser;?>

    +
    +
    +
    + + + + + + + + + + + + + zentaoAccount)) continue;?> + account]", $giteaUser->realname);?> + + + + + + + + + + zentaoAccount)) continue;?> + account]", $giteaUser->realname);?> + + + + + + + + + + + + + + +
    gitea->giteaAvatar;?>gitea->giteaAccount;?>gitea->giteaEmail;?>gitea->zentaoAccount;?>gitea->bindingStatus;?>
    avatar, "height=40");?> + realname;?> +
    + account;?> +
    email;?>account]", $userPairs, '', "class='form-control select chosen'" );?>gitea->notBind;?>
    avatar, "height=40");?> + realname;?> +
    + account;?> +
    email;?>account]", $userPairs, $giteaUser->zentaoAccount, "class='form-control select chosen'" );?> + zentaoAccount])):?> + zentaoAccount, '');?> + + gitea->binded;?> + + ' . $lang->gitea->bindedError . '';?> + + + gitea->notBind;?> + +
    + + goback, '', 'class="btn btn-wide"');?> +
    +
    +
    +
    + diff --git a/module/gitea/view/browse.html.php b/module/gitea/view/browse.html.php index d8a23425ac..b1d22bc76a 100644 --- a/module/gitea/view/browse.html.php +++ b/module/gitea/view/browse.html.php @@ -35,16 +35,16 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - gitea->id);?> - gitea->name);?> - gitea->url);?> - actions;?> + gitea->id);?> + gitea->name);?> + gitea->url);?> + actions;?> $gitea): ?> - + ">name;?> @@ -53,9 +53,10 @@ url, $gitea->url, '_target');?> - + isBindUser); common::printIcon('gitea', 'delete', "giteaID=$id", '', 'list', 'trash', 'hiddenwin'); ?> diff --git a/module/gitea/view/create.html.php b/module/gitea/view/create.html.php index bab219de0a..5b2200f66e 100644 --- a/module/gitea/view/create.html.php +++ b/module/gitea/view/create.html.php @@ -33,8 +33,7 @@ - - + diff --git a/module/gitea/view/edit.html.php b/module/gitea/view/edit.html.php index 439206e9bf..048c824a80 100644 --- a/module/gitea/view/edit.html.php +++ b/module/gitea/view/edit.html.php @@ -33,8 +33,7 @@ token) ? $gitea->token : '', "class='form-control'");?> - - + diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 5c8074064a..6cd8195de4 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -47,9 +47,7 @@ class gitlab extends control foreach($gitlabList as $gitlab) { - $token = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token); - $gitlab->isAdminToken = (isset($token->is_admin) and $token->is_admin); - $gitlab->isBindUser = true; + $gitlab->isBindUser = true; if(!$this->app->user->admin and !isset($myGitLabs[$gitlab->id])) $gitlab->isBindUser = false; } @@ -722,7 +720,7 @@ class gitlab extends control } $gitlab = $this->gitlab->getByID($gitlabID); - $repos = $this->loadModel('repo')->getGitLabRepoList($gitlabID); + $repos = $this->loadModel('repo')->getRepoListByClient($gitlabID); $repoPairs = array(); foreach($repos as $repo) $repoPairs[$repo->path] = $repo->id; @@ -911,176 +909,6 @@ class gitlab extends control $this->display(); } - /** - * Browse gitlab protect branch. - * - * @param int $gitlabID - * @param int $projectID - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID - * @access public - * @return void - */ - public function browseBranchPriv($gitlabID, $projectID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) - { - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - $keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword'); - $branches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, $keyword, $orderBy); - - /* Pager. */ - $this->app->loadClass('pager', $static = true); - $recTotal = count($branches); - $pager = new pager($recTotal, $recPerPage, $pageID); - $branchList = array_chunk($branches, $pager->recPerPage); - - $this->view->keyword = $keyword; - $this->view->pager = $pager; - $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseBranchPriv; - $this->view->levelLang = $this->lang->gitlab->branch->branchCreationLevelList; - $this->view->gitlabID = $gitlabID; - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->orderBy = $orderBy; - $this->view->branchList = empty($branchList) ? $branchList: $branchList[$pageID - 1]; - $this->display(); - } - - /** - * Set a gitlab protect branch. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @access public - * @return void - */ - public function createBranchPriv($gitlabID, $projectID, $branch = '') - { - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - /* Fix error when request type is PATH_INFO and the branch name contains '-'.*/ - if($branch) $branch = urldecode(helper::safe64Decode($branch)); - - if($_POST) - { - $this->gitlab->createBranchPriv($gitlabID, $projectID, $branch); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseBranchPriv', "gitlabID=$gitlabID&projectID=$projectID"))); - } - - $branchPriv = new stdClass(); - $branchPriv->name = ''; - $branchPriv->mergeAccessLevel = 40; // Initialize data, and the operation authority is the maintainers by default. - $branchPriv->pushAccessLevel = 40; // Initialize data, and the operation authority is the maintainers by default. - - $title = $this->lang->gitlab->createBranchPriv; - - if($branch) - { - $title = $this->lang->gitlab->editBranchPriv; - $branchPriv = $this->gitlab->apiGetSingleBranchPriv($gitlabID, $projectID, $branch); - $branchPriv->name = helper::safe64Encode(urlencode($branchPriv->name)); - $branchPriv->mergeAccessLevel = $this->gitlab->checkAccessLevel($branchPriv->merge_access_levels); - $branchPriv->pushAccessLevel = $this->gitlab->checkAccessLevel($branchPriv->push_access_levels); - } - - $gitlabBranches = $this->gitlab->apiGetBranches($gitlabID, $projectID); - $protectBranches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, '', 'name_asc'); - $protectNames = array_keys($protectBranches); - - $branches = array(); - foreach($gitlabBranches as $oneBranch) - { - if(!in_array($oneBranch->name, $protectNames) || $oneBranch->name == $branch) - { - $branchName = helper::safe64Encode(urlencode($oneBranch->name)); - $branches[$branchName] = $oneBranch->name; - } - } - - $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $title; - $this->view->pageTitle = $title; - $this->view->gitlabID = $gitlabID; - $this->view->branch = $branch; - $this->view->projectID = $projectID; - $this->view->branches = $branches; - $this->view->branchPriv = $branchPriv; - $this->display(); - } - - /** - * Edit a gitlab branch protect. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @access public - * @return void - */ - public function editBranchPriv($gitlabID, $projectID, $branch) - { - echo $this->fetch('gitlab', 'createBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branch"); - } - - /** - * Delete a gitlab protect branch. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @param string $confirm - * @access public - * @return void - */ - public function deleteBranchPriv($gitlabID, $projectID, $branch, $confirm = 'no') - { - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - if($confirm != 'yes') - { - $branch = urlencode($branch); - return print(js::confirm($this->lang->gitlab->branch->confirmDelete , inlink('deleteBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branch&confirm=yes"))); - } - - /* Fix error when request type is PATH_INFO and the branch name contains '-'.*/ - $branch = urldecode(helper::safe64Decode($branch)); - $reponse = $this->gitlab->apiDeleteBranchPriv($gitlabID, $projectID, $branch); - - /* If the status code beginning with 20 is returned or empty is returned, it is successful. */ - if(!$reponse or substr($reponse->message, 0, 2) == '20') - { - $this->loadModel('action')->create('gitlabbranchPriv', $branch, 'deleted', '', $branch); - return print(js::reload('parent')); - } - - echo js::alert($reponse->message); - } - /** * Browse gitlab tag. * @@ -1135,206 +963,6 @@ class gitlab extends control $this->display(); } - /** - * Browse gitlab protect tag. - * - * @param int $gitlabID - * @param int $projectID - * @param string $orderBy - * @param int $recTotal - * @param int $recPerPage - * @param int $pageID - * @access public - * @return void - */ - public function browseTagPriv($gitlabID, $projectID, $orderBy = 'name_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) - { - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - $this->session->set('gitlabTagPrivList', $this->app->getURI(true)); - $keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword'); - - $gitlabTags = array(); - $allTags = $this->gitlab->apiGetTags($gitlabID, $projectID); - foreach($allTags as $tag) - { - $gitlabTags[$tag->name] = $tag; - } - - $tagList = array(); - $gitlabProtectTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID); - foreach($gitlabProtectTags as $gitlabProtectTag) - { - $tag = new stdClass(); - $tag->name = $gitlabProtectTag->name; - $tag->lastCommitter = isset($gitlabTags[$tag->name]) ? $gitlabTags[$tag->name]->commit->committer_name : ''; - $tag->accessLevels = $gitlabProtectTag->create_access_levels; - - $tagList[] = $tag; - } - - /* Data search. */ - if($keyword) - { - foreach($tagList as $key => $tag) - { - if(strpos($tag->name, $keyword) === false) unset($tagList[$key]); - } - $tagList = array_values($tagList); - } - - /* Data sort. */ - list($order, $sort) = explode('_', $orderBy); - $orderList = array(); - foreach($tagList as $tag) $orderList[] = $tag->$order; - array_multisort($orderList, $sort == 'desc' ? SORT_DESC : SORT_ASC, $tagList); - - /* Pager. */ - $this->app->loadClass('pager', $static = true); - $recTotal = count($tagList); - $pager = new pager($recTotal, $recPerPage, $pageID); - $tagList = array_chunk($tagList, $pager->recPerPage); - - $this->view->gitlab = $this->gitlab->getByID($gitlabID); - $this->view->pager = $pager; - $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv; - $this->view->gitlabID = $gitlabID; - $this->view->projectID = $projectID; - $this->view->keyword = $keyword; - $this->view->project = $project; - $this->view->gitlabTagList = empty($tagList) ? $tagList: $tagList[$pageID - 1]; - $this->view->orderBy = $orderBy; - $this->display(); - } - - /** - * Set a gitlab protect tag. - * - * @param int $gitlabID - * @param int $projectID - * @access public - * @return void - */ - public function createTagPriv($gitlabID, $projectID) - { - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - if($_POST) - { - $this->gitlab->createTagPriv($gitlabID, $projectID); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID"))); - } - - $gitlabTags = $this->gitlab->apiGetTags($gitlabID, $projectID); - $protectTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID, '', 'name_asc'); - $protectNames = array_keys($protectTags); - - $tags = array(); - foreach($gitlabTags as $tag) - { - if(!in_array($tag->name, $protectNames)) $tags[$tag->name] = $tag->name; - } - - $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->createTagPriv; - $this->view->gitlabID = $gitlabID; - $this->view->projectID = $projectID; - $this->view->tags = $tags; - $this->display(); - } - - /** - * Edit a gitlab protect tag. - * - * @param int $gitlabID - * @param int $projectID - * @param string $tag - * @access public - * @return void - */ - public function editTagPriv($gitlabID, $projectID, $tag = '') - { - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - /* Fix error when request type is PATH_INFO and the tag name contains '-'.*/ - $tag = urldecode(helper::safe64Decode($tag)); - - if($_POST) - { - $this->gitlab->createTagPriv($gitlabID, $projectID, $tag); - - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID"))); - } - - $tagPriv = $this->gitlab->apiGetSingleTagPriv($gitlabID, $projectID, $tag); - $tagPriv->createAccessLevel = $this->gitlab->checkAccessLevel($tagPriv->create_access_levels); - - $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->editTagPriv; - $this->view->gitlabID = $gitlabID; - $this->view->projectID = $projectID; - $this->view->tagPriv = $tagPriv; - $this->view->tag = $tag; - $this->display(); - } - - /** - * Delete a gitlab protect tag. - * - * @param int $gitlabID - * @param int $projectID - * @param string $tag - * @access public - * @return void - */ - public function deleteTagPriv($gitlabID, $projectID, $tag) - { - if(!$this->app->user->admin) - { - $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); - if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); - - $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); - if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); - } - - /* Fix error when request type is PATH_INFO and the tag name contains '-'.*/ - $tag = urldecode(helper::safe64Decode($tag)); - $reponse = $this->gitlab->apiDeleteTagPriv($gitlabID, $projectID, $tag); - - /* If the status code beginning with 20 is returned or empty is returned, it is successful. */ - if(!$reponse or substr($reponse->message, 0, 2) == '20') - { - $this->loadModel('action')->create('gitlabtagpriv', 0, 'deleted', '', $tag); - return print(js::reload('parent')); - } - - echo js::alert($reponse->message); - } - /** * Import gitlab issue to zentaopms. * @@ -1346,7 +974,7 @@ class gitlab extends control { $repo = $this->loadModel('repo')->getRepoByID($repoID); $productIDList = explode(',', $repo->product); - $gitlabID = $repo->gitlab; + $gitlabID = $repo->gitService; $projectID = $repo->project; $gitlab = $this->gitlab->getByID($gitlabID); @@ -1491,7 +1119,7 @@ class gitlab extends control $bindedUsers = $this->dao->select('account,openID') ->from(TABLE_OAUTH) ->where('providerType')->eq('gitlab') - ->andWhere('providerID')->eq($repo->gitlab) + ->andWhere('providerID')->eq($repo->gitService) ->fetchPairs(); if(empty($repo->acl)) @@ -1511,7 +1139,7 @@ class gitlab extends control } } - $gitlabCurrentMembers = $this->gitlab->apiGetProjectMembers($repo->gitlab, $repo->project); + $gitlabCurrentMembers = $this->gitlab->apiGetProjectMembers($repo->gitService, $repo->project); $addedMembers = $updatedMembers = $deletedMembers = array(); /* Get the updated data. */ @@ -1570,17 +1198,17 @@ class gitlab extends control foreach($addedMembers as $addedMember) { - $this->gitlab->apiCreateProjectMember($repo->gitlab, $repo->project, $addedMember); + $this->gitlab->apiCreateProjectMember($repo->gitService, $repo->project, $addedMember); } foreach($updatedMembers as $updatedMember) { - $this->gitlab->apiUpdateProjectMember($repo->gitlab, $repo->project, $updatedMember); + $this->gitlab->apiUpdateProjectMember($repo->gitService, $repo->project, $updatedMember); } foreach($deletedMembers as $deletedMemberID) { - $this->gitlab->apiDeleteProjectMember($repo->gitlab, $repo->project, $deletedMemberID); + $this->gitlab->apiDeleteProjectMember($repo->gitService, $repo->project, $deletedMemberID); } $repo->acl->users = array_values($accounts); @@ -1590,7 +1218,7 @@ class gitlab extends control $repo = $this->loadModel('repo')->getRepoByID($repoID); $users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted|noclosed'); - $projectMembers = $this->gitlab->apiGetProjectMembers($repo->gitlab, $repo->project); + $projectMembers = $this->gitlab->apiGetProjectMembers($repo->gitService, $repo->project); if(!is_array($projectMembers)) $projectMembers = array(); /* Get users accesslevel. */ @@ -1598,7 +1226,7 @@ class gitlab extends control $bindedUsers = $this->dao->select('openID,account') ->from(TABLE_OAUTH) ->where('providerType')->eq('gitlab') - ->andWhere('providerID')->eq($repo->gitlab) + ->andWhere('providerID')->eq($repo->gitService) ->fetchPairs(); foreach($projectMembers as $projectMember) @@ -1746,4 +1374,99 @@ class gitlab extends control echo js::alert($reponse->message); } + + /** + * Manage a gitlab branch protected. + * + * @param int $repoID + * @param int $projectID + * @access public + * @return void + */ + public function manageBranchPriv($gitlabID, $projectID) + { + if(!$this->app->user->admin) + { + $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); + if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); + + $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); + if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); + } + + $hasAccessBranches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, '', 'name_asc'); + foreach($hasAccessBranches as $branch) + { + $branch->pushAccess = $this->gitlab->checkAccessLevel($branch->push_access_levels); + $branch->mergeAccess = $this->gitlab->checkAccessLevel($branch->merge_access_levels); + } + + if(!empty($_POST)) + { + $result = $this->gitlab->manageBranchPrivs($gitlabID, $projectID, $hasAccessBranches); + if(!empty($result)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->gitlab->svaeFailed, implode(', ', $result)))); + + return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => inlink('browseProject', "gitlabID=$gitlabID"))); + } + $allBranches = $this->gitlab->apiGetBranches($gitlabID, $projectID); + $noAccessBranches = array(); + foreach($allBranches as $branch) + { + if(!isset($hasAccessBranches[$branch->name])) $noAccessBranches[$branch->name] = $branch->name; + } + + $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseBranchPriv; + $this->view->gitlabID = $gitlabID; + $this->view->projectID = $projectID; + $this->view->hasAccessBranches = $hasAccessBranches; + $this->view->noAccessBranches = $noAccessBranches; + $this->display(); + } + + /** + * Manage a gitlab tag protected. + * + * @param int $repoID + * @param int $projectID + * @access public + * @return void + */ + public function manageTagPriv($gitlabID, $projectID) + { + if(!$this->app->user->admin) + { + $openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account); + if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse'))); + + $project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID); + if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse'))); + } + + $hasAccessTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID, '', 'name_asc'); + foreach($hasAccessTags as $tag) + { + $tag->createAccess = $this->gitlab->checkAccessLevel($tag->create_access_levels); + } + + if(!empty($_POST)) + { + $result = $this->gitlab->manageTagPrivs($gitlabID, $projectID, $hasAccessTags); + if(!empty($result)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->gitlab->svaeFailed, implode(', ', $result)))); + + return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => inlink('browseProject', "gitlabID=$gitlabID"))); + } + $allTags = $this->gitlab->apiGetTags($gitlabID, $projectID); + $noAccessTags = array(); + foreach($allTags as $tag) + { + if(!isset($hasAccessTags[$tag->name])) $noAccessTags[$tag->name] = $tag->name; + } + + $this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv; + $this->view->gitlabID = $gitlabID; + $this->view->projectID = $projectID; + $this->view->hasAccessTags = $hasAccessTags; + $this->view->noAccessTags = $noAccessTags; + $this->display(); + } } diff --git a/module/gitlab/js/managebranchpriv.js b/module/gitlab/js/managebranchpriv.js new file mode 100644 index 0000000000..5a7931c5e8 --- /dev/null +++ b/module/gitlab/js/managebranchpriv.js @@ -0,0 +1,74 @@ +/* Update other picker on change */ +$.zui.Picker.DEFAULTS.onChange = function(event) +{ + var picker = event.picker; + if(!picker.$formItem.is('[name^=branches]')) return; + + var select = picker.$formItem[0]; + var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false}); + + $('.user-picker[name^=branches]').each(function() + { + if(this === select) return; + + var $select = $(this); + var selectPicker = $select.data('zui.picker'); + + if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]); + }); +} + +/** + * Save branch priv. + * + * @access public + * @return void + */ +function savePriv() +{ + $('#saveBtn').addClass('hidden'); + $('#submit').removeClass('hidden'); + $('#submit').click(); +} + +/** + * Add item. + * + * @param object $obj + * @access public + * @return void + */ +function addItem(obj) +{ + var item = $('#addItem').html().replace(/%i%/g, itemIndex); + var $tr = $('' + item + '').insertAfter($(obj).closest('tr')); + var $branches = $tr.find('select').addClass('user-picker').trigger('list:updated').picker({type: 'user'}); + itemIndex++; + + var disabledItems = []; + $('.user-picker[name^=branches]').each(function() + { + if(this === $branches[0]) return; + var $select = $(this); + var picker = $select.data('zui.picker'); + if(!picker) return; + var selectItem = picker.getListItem(picker.getValue()); + if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true})); + }); + if(disabledItems.length) $branches.data('zui.picker').updateOptionList(disabledItems); +} + +/** + * Delete item. + * + * @param object $obj + * @access public + * @return void + */ +function deleteItem(obj) +{ + if($('#privForm .table tbody').children().length < 2) return false; + + $(obj).closest('tr').find('.picker .picker-selection-remove').click(); + $(obj).closest('tr').remove(); +} diff --git a/module/gitlab/js/managetagpriv.js b/module/gitlab/js/managetagpriv.js new file mode 100644 index 0000000000..c431f79906 --- /dev/null +++ b/module/gitlab/js/managetagpriv.js @@ -0,0 +1,74 @@ +/* Update other picker on change */ +$.zui.Picker.DEFAULTS.onChange = function(event) +{ + var picker = event.picker; + if(!picker.$formItem.is('[name^=tags]')) return; + + var select = picker.$formItem[0]; + var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false}); + + $('.user-picker[name^=tags]').each(function() + { + if(this === select) return; + + var $select = $(this); + var selectPicker = $select.data('zui.picker'); + + if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]); + }); +} + +/** + * Save tag priv. + * + * @access public + * @return void + */ +function savePriv() +{ + $('#saveBtn').addClass('hidden'); + $('#submit').removeClass('hidden'); + $('#submit').click(); +} + +/** + * Add item. + * + * @param object $obj + * @access public + * @return void + */ +function addItem(obj) +{ + var item = $('#addItem').html().replace(/%i%/g, itemIndex); + var $tr = $('' + item + '').insertAfter($(obj).closest('tr')); + var $tags = $tr.find('select').addClass('user-picker').trigger('list:updated').picker({type: 'user'}); + itemIndex++; + + var disabledItems = []; + $('.user-picker[name^=tags]').each(function() + { + if(this === $tags[0]) return; + var $select = $(this); + var picker = $select.data('zui.picker'); + if(!picker) return; + var selectItem = picker.getListItem(picker.getValue()); + if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true})); + }); + if(disabledItems.length) $tags.data('zui.picker').updateOptionList(disabledItems); +} + +/** + * Delete item. + * + * @param object $obj + * @access public + * @return void + */ +function deleteItem(obj) +{ + if($('#privForm .table tbody').children().length < 2) return false; + + $(obj).closest('tr').find('.picker .picker-selection-remove').click(); + $(obj).closest('tr').remove(); +} diff --git a/module/gitlab/lang/de.php b/module/gitlab/lang/de.php index 169875c665..ef5d63cc87 100644 --- a/module/gitlab/lang/de.php +++ b/module/gitlab/lang/de.php @@ -12,7 +12,9 @@ $lang->gitlab->bindProduct = 'Import Product'; $lang->gitlab->importIssue = 'Import Issue'; $lang->gitlab->delete = 'Delete GitLab'; $lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; +$lang->gitlab->gitlabAvatar = 'Avatar'; $lang->gitlab->gitlabAccount = 'GitLab Account'; +$lang->gitlab->gitlabEmail = 'Email'; $lang->gitlab->zentaoAccount = 'Zentao Account'; $lang->gitlab->bindingStatus = 'Binding Status'; $lang->gitlab->notBind = 'Not bind'; @@ -34,7 +36,7 @@ $lang->gitlab->browseUser = "User"; $lang->gitlab->browseGroup = "Group"; $lang->gitlab->browseBranch = "GitLab Branch List"; $lang->gitlab->browseTag = "GitLab Tag List"; -$lang->gitlab->browseTagPriv = "GitLab Tag protected List"; +$lang->gitlab->browseTagPriv = "Protected tag"; $lang->gitlab->gitlabIssue = "GitLab Issue"; $lang->gitlab->zentaoProduct = 'Zentao Product'; $lang->gitlab->objectType = 'Type'; // task, bug, story @@ -52,14 +54,9 @@ $lang->gitlab->createBranch = 'Add branch'; $lang->gitlab->manageGroupMembers = 'Manage group member'; $lang->gitlab->createWebhook = 'Create Webhook'; $lang->gitlab->browseBranchPriv = 'Protect branch'; -$lang->gitlab->createBranchPriv = 'Cerate branch protected'; -$lang->gitlab->editBranchPriv = 'Edit branch protected'; -$lang->gitlab->deleteBranchPriv = 'Delete branch protected'; $lang->gitlab->createTag = 'Create Tag'; $lang->gitlab->deleteTag = 'Delete tag'; -$lang->gitlab->createTagPriv = 'Create tag protected'; -$lang->gitlab->editTagPriv = 'Edit tag protected'; -$lang->gitlab->deleteTagPriv = 'Delete tag protected'; +$lang->gitlab->svaeFailed = '『%s』save failed'; $lang->gitlab->id = 'ID'; $lang->gitlab->name = "Server Name"; diff --git a/module/gitlab/lang/en.php b/module/gitlab/lang/en.php index 169875c665..ef5d63cc87 100644 --- a/module/gitlab/lang/en.php +++ b/module/gitlab/lang/en.php @@ -12,7 +12,9 @@ $lang->gitlab->bindProduct = 'Import Product'; $lang->gitlab->importIssue = 'Import Issue'; $lang->gitlab->delete = 'Delete GitLab'; $lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; +$lang->gitlab->gitlabAvatar = 'Avatar'; $lang->gitlab->gitlabAccount = 'GitLab Account'; +$lang->gitlab->gitlabEmail = 'Email'; $lang->gitlab->zentaoAccount = 'Zentao Account'; $lang->gitlab->bindingStatus = 'Binding Status'; $lang->gitlab->notBind = 'Not bind'; @@ -34,7 +36,7 @@ $lang->gitlab->browseUser = "User"; $lang->gitlab->browseGroup = "Group"; $lang->gitlab->browseBranch = "GitLab Branch List"; $lang->gitlab->browseTag = "GitLab Tag List"; -$lang->gitlab->browseTagPriv = "GitLab Tag protected List"; +$lang->gitlab->browseTagPriv = "Protected tag"; $lang->gitlab->gitlabIssue = "GitLab Issue"; $lang->gitlab->zentaoProduct = 'Zentao Product'; $lang->gitlab->objectType = 'Type'; // task, bug, story @@ -52,14 +54,9 @@ $lang->gitlab->createBranch = 'Add branch'; $lang->gitlab->manageGroupMembers = 'Manage group member'; $lang->gitlab->createWebhook = 'Create Webhook'; $lang->gitlab->browseBranchPriv = 'Protect branch'; -$lang->gitlab->createBranchPriv = 'Cerate branch protected'; -$lang->gitlab->editBranchPriv = 'Edit branch protected'; -$lang->gitlab->deleteBranchPriv = 'Delete branch protected'; $lang->gitlab->createTag = 'Create Tag'; $lang->gitlab->deleteTag = 'Delete tag'; -$lang->gitlab->createTagPriv = 'Create tag protected'; -$lang->gitlab->editTagPriv = 'Edit tag protected'; -$lang->gitlab->deleteTagPriv = 'Delete tag protected'; +$lang->gitlab->svaeFailed = '『%s』save failed'; $lang->gitlab->id = 'ID'; $lang->gitlab->name = "Server Name"; diff --git a/module/gitlab/lang/fr.php b/module/gitlab/lang/fr.php index 169875c665..ef5d63cc87 100644 --- a/module/gitlab/lang/fr.php +++ b/module/gitlab/lang/fr.php @@ -12,7 +12,9 @@ $lang->gitlab->bindProduct = 'Import Product'; $lang->gitlab->importIssue = 'Import Issue'; $lang->gitlab->delete = 'Delete GitLab'; $lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; +$lang->gitlab->gitlabAvatar = 'Avatar'; $lang->gitlab->gitlabAccount = 'GitLab Account'; +$lang->gitlab->gitlabEmail = 'Email'; $lang->gitlab->zentaoAccount = 'Zentao Account'; $lang->gitlab->bindingStatus = 'Binding Status'; $lang->gitlab->notBind = 'Not bind'; @@ -34,7 +36,7 @@ $lang->gitlab->browseUser = "User"; $lang->gitlab->browseGroup = "Group"; $lang->gitlab->browseBranch = "GitLab Branch List"; $lang->gitlab->browseTag = "GitLab Tag List"; -$lang->gitlab->browseTagPriv = "GitLab Tag protected List"; +$lang->gitlab->browseTagPriv = "Protected tag"; $lang->gitlab->gitlabIssue = "GitLab Issue"; $lang->gitlab->zentaoProduct = 'Zentao Product'; $lang->gitlab->objectType = 'Type'; // task, bug, story @@ -52,14 +54,9 @@ $lang->gitlab->createBranch = 'Add branch'; $lang->gitlab->manageGroupMembers = 'Manage group member'; $lang->gitlab->createWebhook = 'Create Webhook'; $lang->gitlab->browseBranchPriv = 'Protect branch'; -$lang->gitlab->createBranchPriv = 'Cerate branch protected'; -$lang->gitlab->editBranchPriv = 'Edit branch protected'; -$lang->gitlab->deleteBranchPriv = 'Delete branch protected'; $lang->gitlab->createTag = 'Create Tag'; $lang->gitlab->deleteTag = 'Delete tag'; -$lang->gitlab->createTagPriv = 'Create tag protected'; -$lang->gitlab->editTagPriv = 'Edit tag protected'; -$lang->gitlab->deleteTagPriv = 'Delete tag protected'; +$lang->gitlab->svaeFailed = '『%s』save failed'; $lang->gitlab->id = 'ID'; $lang->gitlab->name = "Server Name"; diff --git a/module/gitlab/lang/vi.php b/module/gitlab/lang/vi.php index 169875c665..ef5d63cc87 100644 --- a/module/gitlab/lang/vi.php +++ b/module/gitlab/lang/vi.php @@ -12,7 +12,9 @@ $lang->gitlab->bindProduct = 'Import Product'; $lang->gitlab->importIssue = 'Import Issue'; $lang->gitlab->delete = 'Delete GitLab'; $lang->gitlab->confirmDelete = 'Do you want to delete this GitLab server?'; +$lang->gitlab->gitlabAvatar = 'Avatar'; $lang->gitlab->gitlabAccount = 'GitLab Account'; +$lang->gitlab->gitlabEmail = 'Email'; $lang->gitlab->zentaoAccount = 'Zentao Account'; $lang->gitlab->bindingStatus = 'Binding Status'; $lang->gitlab->notBind = 'Not bind'; @@ -34,7 +36,7 @@ $lang->gitlab->browseUser = "User"; $lang->gitlab->browseGroup = "Group"; $lang->gitlab->browseBranch = "GitLab Branch List"; $lang->gitlab->browseTag = "GitLab Tag List"; -$lang->gitlab->browseTagPriv = "GitLab Tag protected List"; +$lang->gitlab->browseTagPriv = "Protected tag"; $lang->gitlab->gitlabIssue = "GitLab Issue"; $lang->gitlab->zentaoProduct = 'Zentao Product'; $lang->gitlab->objectType = 'Type'; // task, bug, story @@ -52,14 +54,9 @@ $lang->gitlab->createBranch = 'Add branch'; $lang->gitlab->manageGroupMembers = 'Manage group member'; $lang->gitlab->createWebhook = 'Create Webhook'; $lang->gitlab->browseBranchPriv = 'Protect branch'; -$lang->gitlab->createBranchPriv = 'Cerate branch protected'; -$lang->gitlab->editBranchPriv = 'Edit branch protected'; -$lang->gitlab->deleteBranchPriv = 'Delete branch protected'; $lang->gitlab->createTag = 'Create Tag'; $lang->gitlab->deleteTag = 'Delete tag'; -$lang->gitlab->createTagPriv = 'Create tag protected'; -$lang->gitlab->editTagPriv = 'Edit tag protected'; -$lang->gitlab->deleteTagPriv = 'Delete tag protected'; +$lang->gitlab->svaeFailed = '『%s』save failed'; $lang->gitlab->id = 'ID'; $lang->gitlab->name = "Server Name"; diff --git a/module/gitlab/lang/zh-cn.php b/module/gitlab/lang/zh-cn.php index d9ac66d15f..ef8637489c 100644 --- a/module/gitlab/lang/zh-cn.php +++ b/module/gitlab/lang/zh-cn.php @@ -12,7 +12,9 @@ $lang->gitlab->bindProduct = '关联产品'; $lang->gitlab->importIssue = '关联issue'; $lang->gitlab->delete = '删除GitLab'; $lang->gitlab->confirmDelete = '确认删除该GitLab吗?'; +$lang->gitlab->gitlabAvatar = '头像'; $lang->gitlab->gitlabAccount = 'GitLab用户'; +$lang->gitlab->gitlabEmail = '邮箱'; $lang->gitlab->zentaoAccount = '禅道用户'; $lang->gitlab->bindingStatus = '绑定状态'; $lang->gitlab->notBind = '未绑定'; @@ -34,7 +36,7 @@ $lang->gitlab->browseUser = "用户"; $lang->gitlab->browseGroup = "群组"; $lang->gitlab->browseBranch = "GitLab分支列表"; $lang->gitlab->browseTag = "GitLab标签列表"; -$lang->gitlab->browseTagPriv = "GitLab标签保护列表"; +$lang->gitlab->browseTagPriv = "标签保护管理"; $lang->gitlab->gitlabIssue = "{$lang->gitlab->common} issue"; $lang->gitlab->zentaoProduct = '禅道产品'; $lang->gitlab->objectType = '类型'; // task, bug, story @@ -52,14 +54,9 @@ $lang->gitlab->createBranch = '添加分支'; $lang->gitlab->manageGroupMembers = '群组成员管理'; $lang->gitlab->createWebhook = '创建Webhook'; $lang->gitlab->browseBranchPriv = '分支保护管理'; -$lang->gitlab->createBranchPriv = '创建分支保护'; -$lang->gitlab->editBranchPriv = '编辑分支保护'; -$lang->gitlab->deleteBranchPriv = '删除分支保护'; $lang->gitlab->createTag = '创建标签'; $lang->gitlab->deleteTag = '删除标签'; -$lang->gitlab->createTagPriv = '创建标签保护'; -$lang->gitlab->editTagPriv = '编辑标签保护'; -$lang->gitlab->deleteTagPriv = '删除标签保护'; +$lang->gitlab->svaeFailed = '『%s』保存失败'; $lang->gitlab->id = 'ID'; $lang->gitlab->name = "服务器名称"; diff --git a/module/gitlab/model.php b/module/gitlab/model.php index aa7d73dca6..00c4e51721 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -1203,7 +1203,7 @@ class gitlabModel extends model /* Return an empty array if where is one existing webhook. */ if($this->isWebhookExists($repo, $hook->url)) return array(); - $result = $this->apiCreateHook($repo->gitlab, $repo->project, $hook); + $result = $this->apiCreateHook($repo->gitService, $repo->project, $hook); if(!empty($result->id)) return true; return false; @@ -1218,7 +1218,7 @@ class gitlabModel extends model */ public function isWebhookExists($repo, $url = '') { - $hookList = $this->apiGetHooks($repo->gitlab, $repo->project); + $hookList = $this->apiGetHooks($repo->gitService, $repo->project); foreach($hookList as $hook) { if($hook->url == $url) return true; @@ -2549,59 +2549,49 @@ class gitlabModel extends model } /** - * Get single protct branch by API. + * Manage branch privs. * * @param int $gitlabID * @param int $projectID - * @param string $branch + * @param array $protected * @access public - * @return object + * @return array */ - public function apiGetSingleBranchPriv($gitlabID, $projectID, $branch) + public function manageBranchPrivs($gitlabID, $projectID, $protected = array()) { - if(empty($gitlabID)) return false; - $branch = urlencode($branch); - $url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/protected_branches/$branch"); - return json_decode(commonModel::http($url)); - } + $data = (array)fixer::input('post')->get(); + extract($data); + $failure = array(); - /** - * Create gitlab potect branch. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @access public - * @return bool - */ - public function createBranchPriv($gitlabID, $projectID, $branch = '') - { - $priv = fixer::input('post')->get(); - if(empty($priv->name)) + /* Remove privs. */ + foreach($protected as $name => $branch) { - dao::$errors['name'][] = $this->lang->gitlab->branch->emptyPrivNameError; - return false; + if(!in_array($name, $branches)) + { + $result = $this->apiDeleteBranchPriv($gitlabID, $projectID, $name); + if($result and substr($result->message, 0, 2) != '20') $failure[] = $name; + } } - $priv->name = urldecode(helper::safe64Decode($priv->name)); - $singleBranch = $this->apiGetSingleBranchPriv($gitlabID, $projectID, $priv->name); - if(empty($branch) && !empty($singleBranch->id)) + $priv = new stdClass(); + foreach($branches as $key => $name) { - dao::$errors['name'][] = $this->lang->gitlab->branch->issetPrivNameError; - return false; + /* Process exists data. */ + if(isset($protected[$name])) + { + if($protected[$name]->pushAccess == $pushLevels[$key] and $protected[$name]->mergeAccess == $mergeLevels[$key]) continue; + + $result = $this->apiDeleteBranchPriv($gitlabID, $projectID, $name); + if(isset($result->message) and substr($result->message, 0, 2) != '20') $failure[] = $name; + } + + $priv->name = $name; + $priv->push_access_level = $pushLevels[$key]; + $priv->merge_access_level = $mergeLevels[$key]; + $response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv); + if(isset($response->message) and substr($response->message, 0, 2) != '20') $failure[] = $name; } - - if(!empty($branch) && !empty($singleBranch->id)) $this->apiDeleteBranchPriv($gitlabID, $projectID, $branch); - $response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv); - - if(!empty($response->id)) - { - $action = empty($branch) ? 'created' : 'edited'; - $this->loadModel('action')->create('gitlabbranchpriv', $response->id, $action, '', $response->name); - return true; - } - - return $this->apiErrorHandling($response); + return array_unique($failure); } /** @@ -2630,7 +2620,7 @@ class gitlabModel extends model * @param int $projectID * @param string $branch * @access public - * @return object + * @return array */ public function apiDeleteBranchPriv($gitlabID, $projectID, $branch) { @@ -2642,58 +2632,51 @@ class gitlabModel extends model } /** - * Create gitlab protect tag. + * Manage tag privs. * * @param int $gitlabID * @param int $projectID - * @param string $tag + * @param array $protected * @access public - * @return bool + * @return array */ - public function createTagPriv($gitlabID, $projectID, $tag = '') + public function manageTagPrivs($gitlabID, $projectID, $protected = array()) { - $priv = fixer::input('post')->get(); - if(empty($priv->name)) + $data = (array)fixer::input('post')->get(); + extract($data); + $failure = array(); + + /* Remove privs. */ + foreach($protected as $name => $tag) { - dao::$errors['name'][] = $this->lang->gitlab->tag->emptyPrivNameError; - return false; + if(!in_array($name, $tags)) + { + $result = $this->apiDeleteTagPriv($gitlabID, $projectID, $name); + if($result and substr($result->message, 0, 2) != '20') $failure[] = $name; + } } - $singleTag = $this->apiGetSingleTagPriv($gitlabID, $projectID, $priv->name); - if(empty($tag) && !empty($singleTag->id)) + $priv = new stdClass(); + foreach($tags as $key => $name) { - dao::$errors['name'][] = $this->lang->gitlab->tag->issetPrivNameError; - return false; + /* Process exists data. */ + if(isset($protected[$name])) + { + if($protected[$name]->createAccess == $createLevels[$key]) continue; + + $result = $this->apiDeleteTagPriv($gitlabID, $projectID, $name); + if(isset($result->message) and substr($result->message, 0, 2) != '20') $failure[] = $name; + } + + $priv->name = $name; + $priv->create_access_level = $createLevels[$key]; + $response = $this->apiCreateTagPriv($gitlabID, $projectID, $priv); + if(isset($response->message)) + { + if(is_array($response->message) or (is_string($response->message) and substr($response->message, 0, 2) != '20')) $failure[] = $name; + } } - - if(!empty($tag) && !empty($singleTag->name)) $this->apiDeleteTagPriv($gitlabID, $projectID, $tag); - $response = $this->apiCreateTagPriv($gitlabID, $projectID, $priv); - - if(!empty($response->id)) - { - $action = empty($tag) ? 'created' : 'edited'; - $this->loadModel('action')->create('gitlabtagpriv', $response->id, $action, '', $response->name); - return true; - } - - return $this->apiErrorHandling($response); - } - - /** - * Get single protct tag by API. - * - * @param int $gitlabID - * @param int $projectID - * @param string $tag - * @access public - * @return object - */ - public function apiGetSingleTagPriv($gitlabID, $projectID, $tag) - { - if(empty($gitlabID)) return false; - $tag = urlencode($tag); - $url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/protected_tags/$tag"); - return json_decode(commonModel::http($url)); + return array_unique($failure); } /** @@ -2896,23 +2879,4 @@ class gitlabModel extends model $html .= '
    '; return $html; } - - /** - * Download zip code. - * - * @param int $gitlabID - * @param int $projectID - * @param string $branch - * @param string $ext tar.gz|tar.bz2|tbz|tbz2|tb2|bz2|tar|zip - * @access public - * @return string - */ - public function downloadCode($gitlabID = 0, $projectID = 0, $branch = '', $ext = 'zip') - { - if(empty($gitlabID) or empty($projectID)) return false; - - $url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/repository/archive." . $ext); - if($branch) $url .= '&sha=' . $branch; - return $url; - } } diff --git a/module/gitlab/view/binduser.html.php b/module/gitlab/view/binduser.html.php index 8827890737..714b43a683 100644 --- a/module/gitlab/view/binduser.html.php +++ b/module/gitlab/view/binduser.html.php @@ -17,12 +17,14 @@
    - +
    - + + + - + @@ -30,13 +32,13 @@ zentaoAccount)) continue;?> id]", $gitlabUser->realname);?> - + + @@ -45,13 +47,13 @@ zentaoAccount)) continue;?> id]", $gitlabUser->realname);?> - + + - diff --git a/module/gitlab/view/browse.html.php b/module/gitlab/view/browse.html.php index af931fd6d9..f0b0640b83 100644 --- a/module/gitlab/view/browse.html.php +++ b/module/gitlab/view/browse.html.php @@ -35,16 +35,16 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - - + + - + $gitlab): ?> - - + + - - + diff --git a/module/gitlab/view/browsebranchpriv.html.php b/module/gitlab/view/browsebranchpriv.html.php deleted file mode 100644 index 181c913742..0000000000 --- a/module/gitlab/view/browsebranchpriv.html.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @package gitlab - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - - -
    -

    - noData;?> - - createLink('gitlab', 'createBranchPriv', "gitlabID=$gitlabID&projectID=$projectID"), " " . $lang->gitlab->createBranchPriv, '', "class='btn btn-info'");?> - -

    -
    - -
    -
    -
    gitlab->gitlabAccount;?>gitlab->gitlabAvatar;?>gitlab->gitlabAccount;?>gitlab->gitlabEmail;?> gitlab->zentaoAccount;?>gitlab->bindingStatus;?>gitlab->bindingStatus;?>
    avatar, "height=40");?>avatar, "height=40");?> realname;?>
    account;?> - email) echo " <" . $gitlabUser->email . ">";?>
    email;?> id]", $userPairs, '', "class='form-control select chosen'" );?> gitlab->notBind;?>
    avatar, "height=40");?>avatar, "height=40");?> realname;?>
    account;?> - email) echo " <" . $gitlabUser->email . ">";?>
    email;?> id]", $userPairs, $gitlabUser->zentaoAccount, "class='form-control select chosen'" );?> zentaoAccount])):?> @@ -70,7 +72,7 @@
    + goback, '', 'class="btn btn-wide"');?>
    gitlab->id);?>gitlab->name);?>gitlab->id);?>gitlab->name);?> gitlab->url);?>actions;?>actions;?>
    ">name;?> @@ -53,9 +53,9 @@ url, $gitlab->url, '_target');?> + isAdminToken) or !$gitlab->isBindUser) ? false : true; + $disabled = $gitlab->isBindUser ? true : false; common::printIcon('gitlab', 'edit', "gitlabID=$id", '', 'list', 'edit'); echo common::buildIconButton('gitlab', 'bindUser', "gitlabID=$id", '', 'list', 'link', '', '', false, '', '', 0, $disabled); common::printIcon('gitlab', 'delete', "gitlabID=$id", '', 'list', 'trash', 'hiddenwin'); diff --git a/module/gitlab/view/browsebranch.html.php b/module/gitlab/view/browsebranch.html.php index bd29860a2b..6aae1486a9 100644 --- a/module/gitlab/view/browsebranch.html.php +++ b/module/gitlab/view/browsebranch.html.php @@ -37,7 +37,7 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
    gitlab->branch->name);?>gitlab->branch->name);?> gitlab->branch->lastCommitter;?> gitlab->branch->lastCommittedDate);?>
    - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - - - - - - - - - - $branch): ?> - merge_access_level = $this->gitlab->checkAccessLevel($branch->merge_access_levels); ?> - push_access_level = $this->gitlab->checkAccessLevel($branch->push_access_levels); ?> - - - - - - - - -
    gitlab->branch->name);?>gitlab->branch->mergeAllowed;?>gitlab->branch->pushAllowed;?>actions;?>
    name;?>merge_access_level];?>push_access_level];?> - name)); - if(common::hasPriv('gitlab', 'editBranchPriv')) common::printLink('gitlab', 'editBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branchName", " ", '', "title={$lang->gitlab->editBranchPriv} class='btn btn-primary'"); - if(common::hasPriv('gitlab', 'deleteBranchPriv')) echo html::a($this->createLink('gitlab', 'deleteBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branchName"), '', 'hiddenwin', "title='{$lang->gitlab->deleteBranchPriv}' class='btn'"); - ?> -
    - - - - -
    - - diff --git a/module/gitlab/view/browsegroup.html.php b/module/gitlab/view/browsegroup.html.php index fb4315ff18..9e96b96187 100644 --- a/module/gitlab/view/browsegroup.html.php +++ b/module/gitlab/view/browsegroup.html.php @@ -43,13 +43,13 @@ gitlab->group->name);?> gitlab->group->path);?> gitlab->group->createOn;?> - actions;?> + actions;?> $gitlabGroup): ?> - id;?> + id;?> name))); ?> $gitlabGroup->avatar_url, 'account' => $groupName), 20); ?> diff --git a/module/gitlab/view/browseproject.html.php b/module/gitlab/view/browseproject.html.php index 93fddbd2f7..5dd1948d3f 100644 --- a/module/gitlab/view/browseproject.html.php +++ b/module/gitlab/view/browseproject.html.php @@ -42,26 +42,28 @@ gitlab->id);?> - gitlab->project->name);?> - - gitlab->lastUpdate;?> - actions;?> + gitlab->project->name);?> + + gitlab->lastUpdate;?> + actions;?> $gitlabProject): ?> - id;?> + id;?> name_with_namespace;?> star_count;?> forks_count;?> last_activity_at, 0, 10);?> - + id", '', 'list', 'branch-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); - echo common::buildIconButton('gitlab', 'browseTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); + echo common::buildIconButton('gitlab', 'browseBranch', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'treemap', '', '', false, '', $this->lang->gitlab->browseBranch, 0, $gitlabProject->default_branch); + echo common::buildIconButton('gitlab', 'browseTag', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag', '', '', false, '', $this->lang->gitlab->browseTag, 0, $gitlabProject->default_branch); + echo common::buildIconButton('gitlab', 'manageBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'branch-lock', '', '', false, '', $this->lang->gitlab->browseBranchPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); + echo common::buildIconButton('gitlab', 'manageTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', $this->lang->gitlab->browseTagPriv, 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch)); echo common::buildIconButton('gitlab', 'manageProjectMembers', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'team', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); echo common::buildIconButton('gitlab', 'createWebhook', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'change', 'hiddenwin', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); echo common::buildIconButton('gitlab', 'importIssue', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'link', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id])); diff --git a/module/gitlab/view/browsetag.html.php b/module/gitlab/view/browsetag.html.php index 02cc38074c..804da8784d 100644 --- a/module/gitlab/view/browsetag.html.php +++ b/module/gitlab/view/browsetag.html.php @@ -51,7 +51,7 @@ gitlab->tag->name);?> gitlab->tag->lastCommitter;?> gitlab->tag->lastCommittedDate);?> - actions;?> + actions;?> diff --git a/module/gitlab/view/browsetagpriv.html.php b/module/gitlab/view/browsetagpriv.html.php deleted file mode 100644 index 792e05531e..0000000000 --- a/module/gitlab/view/browsetagpriv.html.php +++ /dev/null @@ -1,82 +0,0 @@ - - * @package gitlab - * @version $Id$ - * @link http://www.zentao.net - */ -?> - -recTotal}&recPerPage={$pager->recPerPage}&pageID=1")?> - - - -
    -

    - noData;?> - - createLink('gitlab', 'createTagPriv', "gitlabID=$gitlabID&projectID=$projectID"), " " . $lang->gitlab->createTagPriv, '', "class='btn btn-info'");?> - -

    -
    - -
    -
    - - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - - - - - - - - - - $gitlabTag): ?> - accessLevel = $this->gitlab->checkAccessLevel($gitlabTag->accessLevels); ?> - - - - - - - - -
    gitlab->tag->name);?>gitlab->tag->lastCommitter;?>gitlab->tag->accessLevel);?>actions;?>
    name;?>lastCommitter;?>gitlab->branch->branchCreationLevelList, $gitlabTag->accessLevel);?> - name)); - common::printLink('gitlab', 'editTagPriv', "gitlabID=$gitlabID&projectID=$projectID&tag_name=$tagName", " ", '', "title={$lang->gitlab->editTagPriv} class='btn btn-primary'"); - common::printLink('gitlab', 'deleteTagPriv', "gitlabID=$gitlabID&projectID={$projectID}&tag_name=$tagName", " ", '', "title='{$lang->gitlab->deleteTagPriv}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->gitlab->tag->protectConfirmDel}\")==false) return false;'"); - ?> -
    - - - -
    -
    - - diff --git a/module/gitlab/view/browseuser.html.php b/module/gitlab/view/browseuser.html.php index 66da47013d..2a75b2032f 100644 --- a/module/gitlab/view/browseuser.html.php +++ b/module/gitlab/view/browseuser.html.php @@ -38,17 +38,17 @@ gitlab->user->id);?> - gitlab->user->name);?> - - gitlab->user->createOn;?> - gitlab->user->lastActivity;?> - actions;?> + gitlab->user->name);?> + + gitlab->user->createOn;?> + gitlab->user->lastActivity;?> + actions;?> $gitlabUser): ?> - id;?> + id;?> avatar, "height=40");?> realname;?> diff --git a/module/gitlab/view/create.html.php b/module/gitlab/view/create.html.php index 224aaaded3..1a00c2222f 100644 --- a/module/gitlab/view/create.html.php +++ b/module/gitlab/view/create.html.php @@ -34,8 +34,7 @@ gitlab->placeholder->token}'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/createbranchpriv.html.php b/module/gitlab/view/createbranchpriv.html.php deleted file mode 100644 index 52c3e691f2..0000000000 --- a/module/gitlab/view/createbranchpriv.html.php +++ /dev/null @@ -1,47 +0,0 @@ - - * @package gitlab - * @version $Id$ - * @link http://www.zentao.net - */ -?> - -
    -
    -
    -
    -

    -
    -
    - name) echo html::hidden('name', $branchPriv->name);?> - - - - - - - - - - - - - - - - - -
    gitlab->branch->name;?>name, "class='form-control chosen' " . ($branch ? 'disabled' : ''));?>
    gitlab->branch->mergeAllowed;?>gitlab->branch->branchCreationLevelList, $branchPriv->mergeAccessLevel, "class='form-control'");?>
    gitlab->branch->pushAllowed;?>gitlab->branch->branchCreationLevelList, $branchPriv->pushAccessLevel, "class='form-control'");?>
    - - goback, '', 'class="btn btn-wide"');?> -
    -
    -
    -
    -
    - diff --git a/module/gitlab/view/creategroup.html.php b/module/gitlab/view/creategroup.html.php index e8f913c8fa..877c533160 100644 --- a/module/gitlab/view/creategroup.html.php +++ b/module/gitlab/view/creategroup.html.php @@ -69,8 +69,7 @@ gitlab->group->subgroupCreationLevelList, 'maintainer', "class='form-control'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/createproject.html.php b/module/gitlab/view/createproject.html.php index 99450d6e31..3f1ab9f9cb 100644 --- a/module/gitlab/view/createproject.html.php +++ b/module/gitlab/view/createproject.html.php @@ -52,8 +52,7 @@ gitlab->project->visibilityList, 'private', "", 'block'));?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/createtagpriv.html.php b/module/gitlab/view/createtagpriv.html.php deleted file mode 100644 index cf45b66372..0000000000 --- a/module/gitlab/view/createtagpriv.html.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @package gitlab - * @version $Id$ - * @link https://www.zentao.net - */ -?> - -
    -
    -
    -
    -

    gitlab->createTagPriv;?>

    -
    -
    - - - - - - - - - - - - - - -
    gitlab->tag->name;?>
    gitlab->tag->accessLevel;?>gitlab->branch->branchCreationLevelList, '40', "class='form-control chosen'");?>
    - - goback, '', 'class="btn btn-wide"');?> -
    -
    -
    -
    -
    - diff --git a/module/gitlab/view/createuser.html.php b/module/gitlab/view/createuser.html.php index 5adf9ff875..04aca3bba9 100644 --- a/module/gitlab/view/createuser.html.php +++ b/module/gitlab/view/createuser.html.php @@ -81,8 +81,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/edit.html.php b/module/gitlab/view/edit.html.php index 689ce8243a..6739d9a982 100644 --- a/module/gitlab/view/edit.html.php +++ b/module/gitlab/view/edit.html.php @@ -33,8 +33,7 @@ token) ? $gitlab->token : '', "class='form-control' placeholder='{$lang->gitlab->placeholder->token}'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/editgroup.html.php b/module/gitlab/view/editgroup.html.php index 10a602bb2e..b33d9ea25d 100644 --- a/module/gitlab/view/editgroup.html.php +++ b/module/gitlab/view/editgroup.html.php @@ -72,8 +72,7 @@ gitlab->group->subgroupCreationLevelList, $group->subgroup_creation_level, "class='form-control'");?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/editproject.html.php b/module/gitlab/view/editproject.html.php index 24e97a639c..376197c168 100644 --- a/module/gitlab/view/editproject.html.php +++ b/module/gitlab/view/editproject.html.php @@ -40,8 +40,7 @@ gitlab->project->visibilityList, $project->visibility, "", 'block'));?> - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/edittagpriv.html.php b/module/gitlab/view/edittagpriv.html.php deleted file mode 100644 index aec4bbcbf2..0000000000 --- a/module/gitlab/view/edittagpriv.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @package gitlab - * @version $Id$ - * @link https://www.zentao.net - */ -?> - -
    -
    -
    -
    -

    gitlab->editTagPriv;?>

    -
    -
    - - - - - - - - - - - - - - - -
    gitlab->tag->name;?>
    gitlab->tag->accessLevel;?>gitlab->branch->branchCreationLevelList, $tagPriv->createAccessLevel, "class='form-control chosen'");?>
    - - goback, '', 'class="btn btn-wide"');?> -
    -
    -
    -
    -
    - diff --git a/module/gitlab/view/edituser.html.php b/module/gitlab/view/edituser.html.php index d5ef0b6863..9ff06611dc 100644 --- a/module/gitlab/view/edituser.html.php +++ b/module/gitlab/view/edituser.html.php @@ -81,8 +81,7 @@ - - + goback, '', 'class="btn btn-wide"');?> diff --git a/module/gitlab/view/managebranchpriv.html.php b/module/gitlab/view/managebranchpriv.html.php new file mode 100644 index 0000000000..52ea2da2e4 --- /dev/null +++ b/module/gitlab/view/managebranchpriv.html.php @@ -0,0 +1,82 @@ + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gitlab->branch->name;?>gitlab->branch->mergeAllowed;?>gitlab->branch->pushAllowed;?>actions;?>
    name, "class='form-control' readonly");?>gitlab->branch->branchCreationLevelList, $branch->mergeAccess, "class='form-control user-picker'");?> + gitlab->branch->branchCreationLevelList, $branch->pushAccess, "class='form-control user-picker'");?> + name);?> + + ", '', "onclick='addItem(this)' class='btn btn-link'");?> + ", '', "onclick='deleteItem(this)' class='btn btn-link'");?> +
    '') + $noAccessBranches, '', "class='form-control user-picker'");?>gitlab->branch->branchCreationLevelList, 40, "class='form-control user-picker'");?>gitlab->branch->branchCreationLevelList, 40, "class='form-control user-picker'");?> + ", '', "onclick='addItem(this)' class='btn btn-link'");?> + ", '', "onclick='deleteItem(this)' class='btn btn-link'");?> +
    + save, 'onclick="savePriv()" id="saveBtn"', 'btn btn-wide btn-primary'); + echo html::backButton(); + ?> +
    + +
    +
    +
    + + + + + + + + + +
    + diff --git a/module/gitlab/view/managetagpriv.html.php b/module/gitlab/view/managetagpriv.html.php new file mode 100644 index 0000000000..58a3c63c96 --- /dev/null +++ b/module/gitlab/view/managetagpriv.html.php @@ -0,0 +1,76 @@ + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    gitlab->tag->name;?>gitlab->tag->accessLevel;?>actions;?>
    name, "class='form-control' readonly");?>gitlab->branch->branchCreationLevelList, $tag->createAccess, "class='form-control user-picker'");?> + name);?> + ", '', "onclick='addItem(this)' class='btn btn-link'");?> + ", '', "onclick='deleteItem(this)' class='btn btn-link'");?> +
    '') + $noAccessTags, '', "class='form-control user-picker'");?>gitlab->branch->branchCreationLevelList, 40, "class='form-control user-picker'");?> + ", '', "onclick='addItem(this)' class='btn btn-link'");?> + ", '', "onclick='deleteItem(this)' class='btn btn-link'");?> +
    + save, 'onclick="savePriv()" id="saveBtn"', 'btn btn-wide btn-primary'); + echo html::backButton(); + ?> +
    + +
    +
    +
    + + + + + + + + +
    + diff --git a/module/group/control.php b/module/group/control.php index d399f84c26..e3a4ea2e33 100644 --- a/module/group/control.php +++ b/module/group/control.php @@ -91,6 +91,7 @@ class group extends control if(!empty($_POST)) { $this->group->update($groupID); + if(dao::isError()) return print(js::error(dao::getError())); if(isonlybody()) return print(js::closeModal('parent.parent', 'this')); return print(js::locate($this->createLink('group', 'browse'), 'parent')); } @@ -191,8 +192,8 @@ class group extends control if($type == 'byModule') $result = $this->group->updatePrivByModule(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - if($type == 'byGroup') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); - if($type == 'byModule') return print(js::alert($this->lang->saveSuccess) . js::execute('window.parent.location.reload()')); + if($type == 'byGroup') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); + if($type == 'byModule') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'window.parent.location.reload()')); } if($type == 'byGroup') diff --git a/module/group/css/managemember.css b/module/group/css/managemember.css index 229653a1a4..c77de018bd 100644 --- a/module/group/css/managemember.css +++ b/module/group/css/managemember.css @@ -1,3 +1,4 @@ -.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} +.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;} +.group-item .checkbox-primary>input {cursor: pointer;} .table th {vertical-align: top;} .main-table tbody>tr>td {border-bottom: 0px;} diff --git a/module/group/js/managemember.js b/module/group/js/managemember.js index c9ec68a731..256d67edf1 100644 --- a/module/group/js/managemember.js +++ b/module/group/js/managemember.js @@ -5,4 +5,30 @@ $(function() var checked = $(this).prop('checked'); $(this).parents('tr').find('input[type=checkbox]').prop('checked', checked); }); + + $('.table-members table tr').selectable( + { + selector: 'input', + listenClick: false, + select: function(e) + { + $('[data-id=' + e.id + ']').prop('checked', true); + + var checked = true; + var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length; + var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length; + if(memberNum > checkedMemberNum) checked = false; + $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked); + }, + unselect: function(e) + { + $('[data-id=' + e.id + ']').prop('checked', false); + + var checked = true; + var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length; + var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length; + if(memberNum > checkedMemberNum) checked = false; + $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked); + } + }); }); diff --git a/module/group/lang/changelog.php b/module/group/lang/changelog.php index 1578651e93..17c8eb6b6b 100644 --- a/module/group/lang/changelog.php +++ b/module/group/lang/changelog.php @@ -137,7 +137,7 @@ $lang->changelog['4.3.beta'][] = 'productplan-linkBug'; $lang->changelog['4.3.beta'][] = 'productplan-unlinkBug'; $lang->changelog['4.3.beta'][] = 'productplan-batchUnlinkBug'; $lang->changelog['4.3.beta'][] = 'bug-batchCreate'; -$lang->changelog['4.3.beta'][] = 'testcase-exportTemplet'; +$lang->changelog['4.3.beta'][] = 'testcase-exportTemplate'; $lang->changelog['4.3.beta'][] = 'testcase-import'; $lang->changelog['4.3.beta'][] = 'testcase-showImport'; $lang->changelog['4.3.beta'][] = 'testcase-confirmChange'; @@ -289,7 +289,7 @@ $lang->changelog['9.2'][] = 'custom-working'; $lang->changelog['9.2'][] = 'doc-sort'; $lang->changelog['9.2'][] = 'product-build'; $lang->changelog['9.2'][] = 'testsuite-batchCreateCase'; -$lang->changelog['9.2'][] = 'testsuite-exportTemplet'; +$lang->changelog['9.2'][] = 'testsuite-exportTemplate'; $lang->changelog['9.2'][] = 'testsuite-import'; $lang->changelog['9.2'][] = 'testsuite-showImport'; $lang->changelog['9.5'][] = 'bug-batchActivate'; diff --git a/module/group/lang/de.php b/module/group/lang/de.php index 9deaa69598..4c5500747c 100644 --- a/module/group/lang/de.php +++ b/module/group/lang/de.php @@ -46,6 +46,7 @@ $lang->group->group = 'Group'; $lang->group->more = 'More'; $lang->group->allCheck = 'All'; $lang->group->noGroup = 'No group'; +$lang->group->repeat = "『%s』『%s』exists.Please adjust it and try again."; global $config; if($config->systemMode == 'new') $lang->group->noneProject = 'No Project'; diff --git a/module/group/lang/en.php b/module/group/lang/en.php index 86ffacb8fa..70e4659fb5 100644 --- a/module/group/lang/en.php +++ b/module/group/lang/en.php @@ -46,6 +46,7 @@ $lang->group->group = 'Group'; $lang->group->more = 'More'; $lang->group->allCheck = 'All'; $lang->group->noGroup = 'No group'; +$lang->group->repeat = "『%s』『%s』exists.Please adjust it and try again."; global $config; if($config->systemMode == 'new') $lang->group->noneProject = 'No Project'; diff --git a/module/group/lang/fr.php b/module/group/lang/fr.php index 4dcbd75943..f4cdf89881 100644 --- a/module/group/lang/fr.php +++ b/module/group/lang/fr.php @@ -46,6 +46,7 @@ $lang->group->group = 'Group'; $lang->group->more = 'More'; $lang->group->allCheck = 'All'; $lang->group->noGroup = 'Aucun groupe'; +$lang->group->repeat = "『%s』『%s』exists.Please adjust it and try again."; global $config; if($config->systemMode == 'new') $lang->group->noneProject = 'No Project'; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 9893779893..333ecfee8e 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -264,7 +264,6 @@ if($config->systemMode == 'new') $lang->resource->project->testreport = 'testreport'; $lang->resource->project->execution = 'execution'; $lang->resource->project->export = 'export'; - $lang->resource->project->createGuide = 'createGuide'; $lang->resource->project->updateOrder = 'updateOrder'; $lang->resource->project->team = 'teamAction'; $lang->resource->project->unlinkMember = 'unlinkMember'; @@ -304,10 +303,9 @@ if($config->systemMode == 'new') $lang->project->methodOrder[160] = 'testreport'; $lang->project->methodOrder[165] = 'execution'; $lang->project->methodOrder[170] = 'export'; - $lang->project->methodOrder[175] = 'createGuide'; - $lang->project->methodOrder[180] = 'updateOrder'; - $lang->project->methodOrder[185] = 'team'; - $lang->project->methodOrder[190] = 'unlinkMember'; + $lang->project->methodOrder[175] = 'updateOrder'; + $lang->project->methodOrder[180] = 'team'; + $lang->project->methodOrder[185] = 'unlinkMember'; $lang->resource->projectbuild = new stdclass(); $lang->resource->projectbuild->browse = 'browse'; @@ -513,6 +511,9 @@ $lang->resource->story->batchChangeModule = 'batchChangeModule'; $lang->resource->story->batchToTask = 'batchToTask'; $lang->resource->story->track = 'trackAB'; $lang->resource->story->processStoryChange = 'processStoryChange'; +$lang->resource->story->linkStories = 'linkStoriesAB'; + +if($config->URAndSR) $lang->resource->story->linkRequirements = 'linkRequirementsAB'; $lang->story->methodOrder[5] = 'create'; $lang->story->methodOrder[10] = 'batchCreate'; @@ -542,6 +543,9 @@ $lang->story->methodOrder[125] = 'batchChangeModule'; $lang->story->methodOrder[130] = 'batchToTask'; $lang->story->methodOrder[135] = 'track'; $lang->story->methodOrder[140] = 'processStoryChange'; +$lang->story->methodOrder[145] = 'linkStories'; + +if($config->URAndSR) $lang->story->methodOrder[150] = 'linkRequirements'; /* Product plan. */ $lang->resource->productplan = new stdclass(); @@ -624,6 +628,7 @@ $lang->resource->kanban->activateSpace = 'activateSpace'; $lang->resource->kanban->sortSpace = 'sortSpace'; $lang->resource->kanban->create = 'create'; $lang->resource->kanban->edit = 'edit'; +$lang->resource->kanban->setting = 'setting'; $lang->resource->kanban->view = 'view'; $lang->resource->kanban->activate = 'activate'; $lang->resource->kanban->close = 'close'; @@ -767,6 +772,7 @@ $lang->resource->execution->storyEstimate = 'storyEstimate'; $lang->resource->execution->storyView = 'storyView'; if($config->systemMode == 'new') $lang->resource->execution->executionkanban = 'kanbanAction'; $lang->resource->execution->kanban = 'RDKanban'; +$lang->resource->execution->setKanban = 'setKanban'; //if($config->systemMode == 'classic') $lang->resource->project->list = 'list'; //$lang->execution->methodOrder[0] = 'index'; @@ -825,6 +831,7 @@ $lang->execution->methodOrder[255] = 'unbindWhitelist'; $lang->execution->methodOrder[260] = 'storyEstimate'; $lang->execution->methodOrder[265] = 'executionkanban'; $lang->execution->methodOrder[270] = 'kanban'; +$lang->execution->methodOrder[275] = 'setKanban'; /* Task. */ $lang->resource->task = new stdclass(); @@ -974,7 +981,7 @@ $lang->resource->testcase->batchEdit = 'batchEdit'; $lang->resource->testcase->delete = 'deleteAction'; $lang->resource->testcase->batchDelete = 'batchDelete'; $lang->resource->testcase->export = 'exportAction'; -$lang->resource->testcase->exportTemplet = 'exportTemplet'; +$lang->resource->testcase->exportTemplate = 'exportTemplate'; $lang->resource->testcase->import = 'importAction'; $lang->resource->testcase->showImport = 'showImport'; $lang->resource->testcase->confirmChange = 'confirmChange'; @@ -1111,7 +1118,7 @@ $lang->resource->caselib->delete = 'deleteAction'; $lang->resource->caselib->view = 'view'; $lang->resource->caselib->createCase = 'createCase'; $lang->resource->caselib->batchCreateCase = 'batchCreateCase'; -$lang->resource->caselib->exportTemplet = 'exportTemplet'; +$lang->resource->caselib->exportTemplate = 'exportTemplate'; $lang->resource->caselib->import = 'importAction'; $lang->resource->caselib->showImport = 'showImport'; @@ -1123,7 +1130,7 @@ $lang->caselib->methodOrder[20] = 'delete'; $lang->caselib->methodOrder[25] = 'view'; $lang->caselib->methodOrder[30] = 'createCase'; $lang->caselib->methodOrder[35] = 'batchCreateCase'; -$lang->caselib->methodOrder[40] = 'exportTemplet'; +$lang->caselib->methodOrder[40] = 'exportTemplate'; $lang->caselib->methodOrder[45] = 'import'; $lang->caselib->methodOrder[50] = 'showImport'; @@ -1284,6 +1291,7 @@ $lang->resource->custom->browseStoryConcept = 'browseStoryConcept'; $lang->resource->custom->setDefaultConcept = 'setDefaultConcept'; $lang->resource->custom->deleteStoryConcept = 'deleteStoryConcept'; $lang->resource->custom->kanban = 'kanban'; +$lang->resource->custom->code = 'code'; $lang->custom->methodOrder[5] = 'index'; $lang->custom->methodOrder[10] = 'set'; @@ -1300,6 +1308,8 @@ $lang->custom->methodOrder[60] = 'editStoryConcept'; $lang->custom->methodOrder[65] = 'browseStoryConcept'; $lang->custom->methodOrder[70] = 'setDefaultConcept'; $lang->custom->methodOrder[75] = 'deleteStoryConcept'; +$lang->custom->methodOrder[80] = 'kanban'; +$lang->custom->methodOrder[85] = 'code'; $lang->resource->datatable = new stdclass(); $lang->resource->datatable->setGlobal = 'setGlobal'; @@ -1344,17 +1354,11 @@ $lang->resource->gitlab->browseBranch = 'browseBranch'; $lang->resource->gitlab->webhook = 'webhook'; $lang->resource->gitlab->createWebhook = 'createWebhook'; $lang->resource->gitlab->manageProjectMembers = 'manageProjectMembers'; -$lang->resource->gitlab->browseBranchPriv = 'browseBranchPriv'; -$lang->resource->gitlab->createBranchPriv = 'createBranchPriv'; -$lang->resource->gitlab->editBranchPriv = 'editBranchPriv'; -$lang->resource->gitlab->deleteBranchPriv = 'deleteBranchPriv'; +$lang->resource->gitlab->manageBranchPriv = 'browseBranchPriv'; +$lang->resource->gitlab->manageTagPriv = 'browseTagPriv'; $lang->resource->gitlab->browseTag = 'browseTag'; $lang->resource->gitlab->createTag = 'createTag'; $lang->resource->gitlab->deleteTag = 'deleteTag'; -$lang->resource->gitlab->browseTagPriv = 'browseTagPriv'; -$lang->resource->gitlab->createTagPriv = 'createTagPriv'; -$lang->resource->gitlab->editTagPriv = 'editTagPriv'; -$lang->resource->gitlab->deleteTagPriv = 'deleteTagPriv'; $lang->gitlab->methodOrder[5] = 'browse'; $lang->gitlab->methodOrder[10] = 'create'; @@ -1381,23 +1385,27 @@ $lang->gitlab->methodOrder[115] = 'browseBranch'; $lang->gitlab->methodOrder[120] = 'webhook'; $lang->gitlab->methodOrder[125] = 'createWebhook'; $lang->gitlab->methodOrder[130] = 'manageProjectMembers'; -$lang->gitlab->methodOrder[135] = 'browseTag'; -$lang->gitlab->methodOrder[140] = 'browseTagPriv'; -$lang->gitlab->methodOrder[145] = 'deleteTagPriv'; +$lang->gitlab->methodOrder[135] = 'manageBranchPriv'; +$lang->gitlab->methodOrder[140] = 'manageTagPriv'; +$lang->gitlab->methodOrder[145] = 'browseTag'; +$lang->gitlab->methodOrder[150] = 'createTag'; +$lang->gitlab->methodOrder[155] = 'deleteTag'; /* Gitea. */ $lang->resource->gitea = new stdclass(); -$lang->resource->gitea->browse = 'browse'; -$lang->resource->gitea->create = 'create'; -$lang->resource->gitea->edit = 'edit'; -$lang->resource->gitea->view = 'view'; -$lang->resource->gitea->delete = 'delete'; +$lang->resource->gitea->browse = 'browse'; +$lang->resource->gitea->create = 'create'; +$lang->resource->gitea->edit = 'edit'; +$lang->resource->gitea->view = 'view'; +$lang->resource->gitea->delete = 'delete'; +$lang->resource->gitea->bindUser = 'bindUser'; $lang->gitea->methodOrder[5] = 'browse'; $lang->gitea->methodOrder[10] = 'create'; $lang->gitea->methodOrder[15] = 'edit'; $lang->gitea->methodOrder[20] = 'view'; $lang->gitea->methodOrder[25] = 'delete'; +$lang->gitea->methodOrder[30] = 'bindUser'; /* SonarQube. */ $lang->resource->sonarqube = new stdclass(); diff --git a/module/group/lang/zh-cn.php b/module/group/lang/zh-cn.php index 7f1da7924f..9559c806b7 100644 --- a/module/group/lang/zh-cn.php +++ b/module/group/lang/zh-cn.php @@ -46,6 +46,7 @@ $lang->group->group = '分组'; $lang->group->more = '更多'; $lang->group->allCheck = '全部'; $lang->group->noGroup = '暂时没有分组。'; +$lang->group->repeat = "『%s』已经有『%s』这条记录了,请调整后再试。"; global $config; if($config->systemMode == 'new') $lang->group->noneProject = '暂时没有项目'; diff --git a/module/group/model.php b/module/group/model.php index ca6fcd8ae4..b9cfd0ba1c 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -27,7 +27,8 @@ class groupModel extends model unset($group->limited); $group->role = 'limited'; } - $this->dao->insert(TABLE_GROUP)->data($group)->batchCheck($this->config->group->create->requiredFields, 'notempty')->exec(); + $this->lang->error->unique = $this->lang->group->repeat; + $this->dao->insert(TABLE_GROUP)->data($group)->batchCheck($this->config->group->create->requiredFields, 'notempty')->check('name', 'unique')->exec(); return $this->dao->lastInsertId(); } @@ -41,7 +42,8 @@ class groupModel extends model public function update($groupID) { $group = fixer::input('post')->get(); - return $this->dao->update(TABLE_GROUP)->data($group)->batchCheck($this->config->group->edit->requiredFields, 'notempty')->where('id')->eq($groupID)->exec(); + $this->lang->error->unique = $this->lang->group->repeat; + return $this->dao->update(TABLE_GROUP)->data($group)->batchCheck($this->config->group->edit->requiredFields, 'notempty')->check('name', 'unique', "id != {$groupID}")->where('id')->eq($groupID)->exec(); } /** @@ -54,6 +56,7 @@ class groupModel extends model public function copy($groupID) { $group = fixer::input('post')->remove('options')->get(); + $this->lang->error->unique = $this->lang->group->repeat; $this->dao->insert(TABLE_GROUP)->data($group)->check('name', 'unique')->check('name', 'notempty')->exec(); if($this->post->options == false) return; if(!dao::isError()) @@ -315,9 +318,9 @@ class groupModel extends model /** * Get admins by object id list. - * - * @param int $idList - * @param string $field + * + * @param int $idList + * @param string $field * @access public * @return void */ diff --git a/module/group/view/privbygroup.html.php b/module/group/view/privbygroup.html.php index 4de3b87550..c6007257d3 100644 --- a/module/group/view/privbygroup.html.php +++ b/module/group/view/privbygroup.html.php @@ -17,7 +17,7 @@
    -
    + diff --git a/module/holiday/css/browse.css b/module/holiday/css/browse.css index 50d38310c3..9fb6ee448c 100644 --- a/module/holiday/css/browse.css +++ b/module/holiday/css/browse.css @@ -1,3 +1,5 @@ .tree .active{font-weight: bold;} .with-side .side {position: absolute; width: 130px;} .with-side .main {padding-left: 145px; float: left;} +.side-col {width: 160px;} +.panel-sm .panel-body {padding: 10px;} diff --git a/module/index/css/index.css b/module/index/css/index.css index 1ae12da38f..bdd0ebe853 100644 --- a/module/index/css/index.css +++ b/module/index/css/index.css @@ -120,3 +120,5 @@ body.menu-hide {padding-left: 0;} { #upgradeContent{width: 85%;} } +#searchbox .dropdown-menu > li.search-type-all{max-width: 250px} +#searchbox .dropdown-menu > li.search-type-all a{width: 100%; overflow: hidden; text-overflow: ellipsis;} diff --git a/module/index/js/index.js b/module/index/js/index.js index d8dfe59d94..5ffb7866d8 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -187,7 +187,7 @@ * @param {string} [appCode] The code of target app to open * @return {void} */ - function openTab(url, appCode) + function openTab(url, appCode, forceReload) { /* Check params */ if(!appCode) @@ -264,7 +264,9 @@ } /* Show page app and update iframe source */ - if (url) + var iframe = app.$iframe[0]; + var isSameUrl = iframe && url && iframe.contentWindow.location.href.endsWith(url); + if (url && (!isSameUrl || forceReload !== false)) { app.$app.toggleClass('open-from-hidden', app.$app.is(':hidden')) reloadApp(appCode, url, true); @@ -441,7 +443,8 @@ if(url === true) url = app.url; else if($.tabSession) url = $.tabSession.convertUrlWithTid(url); - var iframe = app.$iframe[0]; + var iframe = app.$iframe[0]; + var isSameUrl = iframe && url && iframe.contentWindow.location.href.endsWith(url); /* Add hook to page before reload it */ if (iframe && iframe.contentWindow.beforeAppReload) @@ -451,7 +454,7 @@ try { - if(url) iframe.contentWindow.location.assign(url); + if(url && !isSameUrl) iframe.contentWindow.location.assign(url); else iframe.contentWindow.location.reload(true); } catch(_) @@ -462,7 +465,7 @@ if(!notTriggerEvent) app.$app.trigger('reloadapp', app); if(url) $(iframe.contentWindow.document.body).hide(); // Code for task #59703. - app.$app.addClass('loading'); + if(!isSameUrl) app.$app.addClass('loading'); if(app._loadTimer) clearTimeout(app._loadTimer); app._loadTimer = setTimeout(function() { @@ -751,8 +754,8 @@ $.extend( var searchModule = types[0]; var searchMethod = typeof(types[1]) == 'undefined' ? 'view' : types[1]; var searchLink = createLink(searchModule, searchMethod, "id=" + objectValue); - var assetType = 'story,issue,risk,opportunity,doc'; - if(assetType.indexOf(searchModule) > -1) + var assetType = ',story,issue,risk,opportunity,doc,'; + if(assetType.indexOf(',' + searchModule + ',') > -1) { var link = createLink('index', 'ajaxGetViewMethod' , 'objectID=' + objectValue + '&objectType=' + searchModule); $.get(link, function(data) diff --git a/module/jenkins/view/browse.html.php b/module/jenkins/view/browse.html.php index dfa38962a3..bc4d4819b8 100644 --- a/module/jenkins/view/browse.html.php +++ b/module/jenkins/view/browse.html.php @@ -36,18 +36,18 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?> - - + + $jenkins): ?> - + - - - diff --git a/module/jenkins/view/edit.html.php b/module/jenkins/view/edit.html.php index 303ff9d57f..9eed8ff5d9 100644 --- a/module/jenkins/view/edit.html.php +++ b/module/jenkins/view/edit.html.php @@ -44,8 +44,7 @@ - - diff --git a/module/job/control.php b/module/job/control.php index d25c6a0fe9..f6440f3af3 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -40,6 +40,7 @@ class job extends control { $repos = $this->loadModel('repo')->getRepoPairs('devops'); if(empty($repos)) $this->locate($this->repo->createLink('create')); + $repoID = $this->repo->saveState($repoID); /* Set session. */ $this->loadModel('ci')->setMenu($repoID); @@ -114,7 +115,7 @@ class job extends control $repoTypes[$repo->id] = $repo->SCM; if(strtolower($repo->SCM) == 'gitlab') { - if(isset($repo->gitlab)) $gitlab = $this->loadModel('gitlab')->getByID($repo->gitlab); + if(isset($repo->gitService)) $gitlab = $this->loadModel('gitlab')->getByID($repo->gitService); if(!empty($gitlab)) $tokenUser = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token); if(!isset($tokenUser->is_admin) or !$tokenUser->is_admin) continue; $gitlabRepos[$repo->id] = $repo->name; @@ -138,16 +139,16 @@ class job extends control /** * Edit a job. * - * @param int $id + * @param int $jobID * @access public * @return void */ - public function edit($id) + public function edit($jobID) { - $job = $this->job->getByID($id); + $job = $this->job->getByID($jobID); if($_POST) { - $this->job->update($id); + $this->job->update($jobID); if(dao::isError()) { $errors = dao::getError(); @@ -173,14 +174,14 @@ class job extends control return $this->send(array('result' => 'fail', 'message' => $errors)); } - $this->loadModel('action')->create('job', $id, 'edited'); + $this->loadModel('action')->create('job', $jobID, 'edited'); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse', "repoID={$job->repo}"))); } $repo = $this->loadModel('repo')->getRepoByID($job->repo); $this->view->repo = $this->loadModel('repo')->getRepoByID($job->repo); - if($repo->SCM == 'Gitlab') $this->view->refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitlab, $repo->project); + if($repo->SCM == 'Gitlab') $this->view->refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitService, $repo->project); $repoList = $this->repo->getList($this->projectID); $repoPairs = array(0 => '', $repo->id => $repo->name); @@ -189,7 +190,7 @@ class job extends control foreach($repoList as $repo) { if(empty($repo->synced)) continue; - $repoPairs[$repo->id] = $repo->name; + $repoPairs[$repo->id] = "[{$repo->SCM}] {$repo->name}"; $repoTypes[$repo->id] = $repo->SCM; if(strtolower($repo->SCM) == 'gitlab') $gitlabRepos[$repo->id] = $repo->name; } @@ -220,15 +221,15 @@ class job extends control /** * Delete a job. * - * @param int $id + * @param int $jobID * @access public * @return void */ - public function delete($id, $confirm = 'no') + public function delete($jobID, $confirm = 'no') { - if($confirm != 'yes') return print(js::confirm($this->lang->job->confirmDelete, inlink('delete', "jobID=$id&confirm=yes"))); + if($confirm != 'yes') return print(js::confirm($this->lang->job->confirmDelete, inlink('delete', "jobID=$jobID&confirm=yes"))); - $this->job->delete(TABLE_JOB, $id); + $this->job->delete(TABLE_JOB, $jobID); echo js::reload('parent'); } @@ -316,27 +317,27 @@ class job extends control /** * Exec a job. * - * @param int $id + * @param int $jobID * @param string $showForm * @access public * @return void */ - public function exec($id) + public function exec($jobID) { - $job = $this->job->getByID($id); + $job = $this->job->getByID($jobID); if(strtolower($job->engine) == 'gitlab') { if(!isset($job->reference) or !$job->reference) { - return $this->send(array('result' => 'fail', 'message' => $this->lang->job->setReferenceTips, 'locate' => inlink('edit', "id=$id"))); + return $this->send(array('result' => 'fail', 'message' => $this->lang->job->setReferenceTips, 'locate' => inlink('edit', "id=$jobID"))); } } - $compile = $this->job->exec($id); + $compile = $this->job->exec($jobID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->app->loadLang('compile'); - $this->loadModel('action')->create('job', $id, 'executed'); + $this->loadModel('action')->create('job', $jobID, 'executed'); return $this->send(array('result' => 'success', 'message' => sprintf($this->lang->job->sendExec, zget($this->lang->compile->statusList, $compile->status)))); } @@ -383,7 +384,7 @@ class job extends control public function ajaxGetRefList($repoID) { $repo = $this->loadModel('repo')->getRepoByID($repoID); - if($repo->SCM == 'Gitlab') $refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitlab, $repo->project); + if($repo->SCM == 'Gitlab') $refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitService, $repo->project); if($repo->SCM != 'Gitlab') $refList = $this->repo->getBranches($repo, true); $this->send(array('result' => 'success', 'refList' => $refList)); } @@ -408,7 +409,7 @@ class job extends control } else { - $repoPairs[$repo->id] = $repo->name; + $repoPairs[$repo->id] = "[{$repo->SCM}] {$repo->name}"; } } echo html::select('repo', $repoPairs, '', "class='form-control chosen'"); diff --git a/module/job/model.php b/module/job/model.php index b8b0933748..c3d53774e7 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -46,7 +46,7 @@ class jobModel extends model */ public function getList($repoID = 0, $orderBy = 'id_desc', $pager = null, $engine = '', $pipeline = '') { - return $this->dao->select('t1.*, t2.name as repoName, t3.name as jenkinsName')->from(TABLE_JOB)->alias('t1') + return $this->dao->select('t1.*, DATE_FORMAT(t1.lastExec, "%m-%d %H:%i") AS lastExec, t2.name as repoName, t3.name as jenkinsName')->from(TABLE_JOB)->alias('t1') ->leftJoin(TABLE_REPO)->alias('t2')->on('t1.repo=t2.id') ->leftJoin(TABLE_PIPELINE)->alias('t3')->on('t1.server=t3.id') ->where('t1.deleted')->eq('0') @@ -182,7 +182,7 @@ class jobModel extends model $repo = $this->loadModel('repo')->getRepoByID($job->repo); $project = zget($repo, 'project'); - $job->server = (int)zget($repo, 'gitlab', 0); + $job->server = (int)zget($repo, 'serviceHost', 0); $job->pipeline = json_encode(array('project' => $project, 'reference' => $this->post->reference)); } @@ -300,7 +300,7 @@ class jobModel extends model $project = zget($repo, 'project'); $job->repo = $job->gitlabRepo; - $job->server = (int)zget($repo, 'gitlab', 0); + $job->server = (int)zget($repo, 'serviceHost', 0); $job->pipeline = json_encode(array('project' => $project, 'reference' => $this->post->reference)); } diff --git a/module/job/view/browse.html.php b/module/job/view/browse.html.php index ec44c6dd42..0a1e92e209 100644 --- a/module/job/view/browse.html.php +++ b/module/job/view/browse.html.php @@ -35,7 +35,7 @@
    jenkins->id); ?>jenkins->name); ?>jenkins->url); ?>jenkins->name); ?>jenkins->url); ?> actions; ?>
    name; ?> url, $jenkins->url, '_blank'); ?> + createLink('jenkins', 'delete', "jenkinsID=$id"), '', 'hiddenwin', "title='{$lang->jenkins->delete}' class='btn'"); diff --git a/module/jenkins/view/create.html.php b/module/jenkins/view/create.html.php index 34c988c862..4d52cb332b 100644 --- a/module/jenkins/view/create.html.php +++ b/module/jenkins/view/create.html.php @@ -44,8 +44,7 @@ jenkins->tips;?>
    + goback, '', 'class="btn btn-wide"');?> jenkins->tips;?>
    + goback, '', 'class="btn btn-wide"');?>
    - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> @@ -45,7 +45,7 @@ - + @@ -72,7 +72,7 @@ - - - + @@ -187,8 +187,7 @@ - - - + - + @@ -72,11 +78,11 @@ - + - + @@ -91,7 +97,12 @@ - + diff --git a/module/kanban/view/createspace.html.php b/module/kanban/view/createspace.html.php index 3f83d4260f..94ab7f9769 100644 --- a/module/kanban/view/createspace.html.php +++ b/module/kanban/view/createspace.html.php @@ -36,7 +36,7 @@ diff --git a/module/kanban/view/edit.html.php b/module/kanban/view/edit.html.php index def34303d4..823ec82911 100644 --- a/module/kanban/view/edit.html.php +++ b/module/kanban/view/edit.html.php @@ -12,7 +12,6 @@ ?> -config->vision);?>
    @@ -22,12 +21,7 @@
    job->id);?> job->name);?> job->repo);?>job->triggerType;?> job->lastStatus);?> job->lastExec);?>actions;?>actions;?>
    lastStatus) echo $job->lastExec;?> repo}&jobID=$id", '', 'list', 'history'); common::printIcon('job', 'edit', "jobID=$id", '', 'list', 'edit'); common::printIcon('job', 'exec', "jobID=$id", '', 'list', 'play'); if(common::hasPriv('job', 'delete')) echo html::a($this->createLink('job', 'delete', "jobID=$id"), '', 'hiddenwin', "title='{$lang->job->delete}' class='btn'"); diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index af31444465..fddeb4505b 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -139,8 +139,7 @@
    + goback, '', 'class="btn btn-wide"');?> diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 4809a12cfb..15bd823043 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -41,7 +41,7 @@
    job->repo; ?>repo, "class='form-control'"); ?>repo, "class='form-control chosen'"); ?>
    job->repo; ?>
    + repo}"), $lang->goback, '', 'class="btn btn-wide"');?> repo, 'Git'));?> diff --git a/module/kanban/config.php b/module/kanban/config.php index 27373d5b3f..a7aa8de832 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -36,6 +36,10 @@ $config->kanban->splitcolumn->requiredFields = 'name,limit'; $config->kanban->editor = new stdclass(); $config->kanban->editor->closespace = array('id' => 'comment', 'tools' => 'simpleTools'); $config->kanban->editor->activatespace = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->kanban->editor->createspace = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->kanban->editor->editspace = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->kanban->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->kanban->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); $config->kanban->editor->createcard = array('id' => 'desc', 'tools' => 'simpleTools'); $config->kanban->editor->activate = array('id' => 'comment', 'tools' => 'simpleTools'); $config->kanban->editor->close = array('id' => 'comment', 'tools' => 'simpleTools'); diff --git a/module/kanban/control.php b/module/kanban/control.php index 8e584869a0..3f3b9f82b0 100644 --- a/module/kanban/control.php +++ b/module/kanban/control.php @@ -90,7 +90,6 @@ class kanban extends control } $space = $this->kanban->getSpaceById($spaceID); - $space->desc = strip_tags(htmlspecialchars_decode($space->desc)); $typeList = $this->lang->kanbanspace->typeList; if($space->type == 'cooperation' or $space->type == 'public') unset($typeList['private']); @@ -221,8 +220,8 @@ class kanban extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } - $enableImport = 'off'; - $importObjects = array(); + $enableImport = 'on'; + $importObjects = array_keys($this->lang->kanban->importObjectList); if($copyKanbanID) { $copyKanban = $this->kanban->getByID($copyKanbanID); @@ -236,11 +235,11 @@ class kanban extends control $space = $this->kanban->getSpaceById($spaceID); $spaceUsers = $spaceID == 0 ? ',' : trim($space->owner) . ',' . trim($space->team); $spacePairs = array(0 => '') + $this->kanban->getSpacePairs($type); - $users = isset($spacePairs[$spaceID]) ? $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers) : array(); - $whitelist = (isset($space->whitelist) and !empty($space->whitelist)) ? $space->whitelist : ','; + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $ownerPairs = (isset($spacePairs[$spaceID])) ? $this->user->getPairs('noclosed|nodeleted', '', 0, $spaceUsers) : $users; $this->view->users = $users; - $this->view->whitelist = isset($spacePairs[$spaceID]) ? $this->user->getPairs('noclosed|nodeleted', '', 0, $whitelist) : array(); + $this->view->ownerPairs = $ownerPairs; $this->view->spaceID = $spaceID; $this->view->spacePairs = $spacePairs; $this->view->type = $type; @@ -277,20 +276,46 @@ class kanban extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); } - $kanban = $this->kanban->getByID($kanbanID); - $kanban->desc = strip_tags(htmlspecialchars_decode($kanban->desc)); + $kanban = $this->kanban->getByID($kanbanID); $space = $this->kanban->getSpaceById($kanban->space); $spaceUsers = trim($space->owner) . ',' . trim($space->team); - $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); - $whitelist = (isset($space->whitelist) and !empty($space->whitelist)) ? $space->whitelist : ','; + $users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $ownerPairs = $this->user->getPairs('noclosed|nodeleted', '', 0, $spaceUsers); $this->view->users = $users; - $this->view->whitelist = $this->user->getPairs('noclosed|nodeleted', '', 0, $whitelist); + $this->view->ownerPairs = $ownerPairs; $this->view->spacePairs = array(0 => '') + array($kanban->space => $space->name) + $this->kanban->getSpacePairs($space->type); $this->view->kanban = $kanban; $this->view->type = $space->type; + $this->display(); + } + + /** + * Setting kanban. + * + * @param int $kanbanID + * @access public + * @return void + */ + public function setting($kanbanID = 0) + { + if(!empty($_POST)) + { + $changes = $this->kanban->setting($kanbanID); + + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $actionID = $this->loadModel('action')->create('kanban', $kanbanID, 'edited'); + $this->action->logHistory($actionID, $changes); + + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); + } + + $kanban = $this->kanban->getByID($kanbanID); + + $this->view->kanban = $kanban; $this->view->laneCount = $this->kanban->getLaneCount($kanbanID); $this->view->heightType = $kanban->displayCards > 2 ? 'custom' : 'auto'; $this->view->displayCards = $kanban->displayCards ? $kanban->displayCards : ''; @@ -1512,7 +1537,7 @@ class kanban extends control $this->loadModel($objectType)->delete(constant($table), $objectID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $kanbanID = $regionID ? $this->kanban->getKanbanIDByregion($regionID) : $this->session->execution; + $kanbanID = $regionID ? $this->kanban->getKanbanIDByRegion($regionID) : $this->session->execution; $browseType = $this->config->vision == 'lite' ? 'task' : $this->session->execLaneType; $groupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; $kanbanGroup = $this->kanban->getRDKanban($kanbanID, $browseType, 'id_desc', 0, $groupBy); @@ -1844,20 +1869,20 @@ class kanban extends control /** * Ajax get contact users. * + * @param string $field * @param int $contactListID * @access public * @return string */ - public function ajaxGetContactUsers($contactListID) + public function ajaxGetContactUsers($field, $contactListID) { $this->loadModel('user'); - $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; + $list = $contactListID ? $this->user->getContactListByID($contactListID) : ''; + $users = $this->user->getPairs('nodeleted|noclosed', '', $this->config->maxCount); - $users = $this->user->getPairs('devfirst|nodeleted|noclosed', $list ? $list->userList : '', $this->config->maxCount); + if(!$contactListID or !isset($list->userList)) return print(html::select($field . '[]', $users, '', "class='form-control picker-select' multiple")); - if(!$contactListID) return print(html::select('team[]', $users, '', "class='form-control chosen' multiple")); - - return print(html::select('team[]', $users, $list->userList, "class='form-control chosen' multiple")); + return print(html::select($field . '[]', $users, $list->userList, "class='form-control picker-select' multiple")); } /** @@ -1913,18 +1938,16 @@ class kanban extends control * @param int $spaceID * @param string $field team|whitelist|owner * @param string $selectedUser + * @param string $space all|space * @access public * @return string */ - public function ajaxLoadSpaceUsers($spaceID, $field = '', $selectedUser = '') + public function ajaxLoadUsers($spaceID, $field = '', $selectedUser = '', $type = 'space') { $space = $this->kanban->getSpaceById($spaceID); $accounts = ''; - if(!empty($space)) - { - if($space->type == 'private' and !empty($space->whitelist)) $accounts = $space->whitelist; - if($space->type != 'private') $accounts = trim($space->owner) . ',' . trim($space->team); - } + + if(!empty($space) and $field == 'owner' and $type != 'all') $accounts = trim($space->owner) . ',' . trim($space->team); $users = $this->loadModel('user')->getPairs('noclosed|nodeleted', '', 0, $accounts); $multiple = in_array($field, array('team', 'whitelist')) ? 'multiple' : ''; diff --git a/module/kanban/css/create.css b/module/kanban/css/create.css index f9fbbc0ed8..8e64db6be5 100644 --- a/module/kanban/css/create.css +++ b/module/kanban/css/create.css @@ -23,3 +23,7 @@ #copyKanbanModal .copyContentBox > .checkbox-primary {display: inline-block; margin-left: 10px; margin-top: -1px;} #copyKanbanModal .copyContentBox > .checkbox-primary:first-child {margin-left: 20px;} #copyContentbasicInfo {cursor: not-allowed;} +#team ~ #contactListMenu_chosen {vertical-align: top;} +#whitelist ~ #contactListMenu_chosen {vertical-align: bottom;} +#team ~ #contactListMenu_chosen > .chosen-drop {top: 32px;} +#whitelist ~ #contactListMenu_chosen > .chosen-drop {bottom: 32px;} diff --git a/module/kanban/css/edit.css b/module/kanban/css/edit.css index b28c6e6e50..bef119443d 100644 --- a/module/kanban/css/edit.css +++ b/module/kanban/css/edit.css @@ -1,12 +1,9 @@ #mainContent .table-form>tbody>tr>th {width: 105px;} #mainContent {padding-left: 0px;} #mainContent .laneHeightBox .radio-inline+.radio-inline, #mainContent .importBox .radio-inline+.radio-inline {margin-left: 20px;} -#mainContent .objectBox {padding-top: 2px;} -#mainContent .objectBox .checkbox-primary {display: inline-block;} -#mainContent .objectBox .checkbox-primary:not(:first-child) {margin-left: 10px;} -#mainContent .objectBox .checkbox-primary>label:not(:first-child) {padding-left: 20px;} -#mainContent .laneHeightBox .tip {color: #999;} -#mainContent .objectBox .checkbox-primary>label:before {top: 2px; left: 0px;} -#mainContent .objectBox .checkbox-primary>label:after {width: 14px; height: 14px;} [lang^='en'] .columnWidth {width: 120px;} [lang^='zh-cn'] .columnWidth {width: 80px;} +#team ~ #contactListMenu_chosen {vertical-align: top;} +#whitelist ~ #contactListMenu_chosen {vertical-align: bottom;} +#team ~ #contactListMenu_chosen > .chosen-drop {top: 32px;} +#whitelist ~ #contactListMenu_chosen > .chosen-drop {bottom: 32px;} diff --git a/module/kanban/css/setting.css b/module/kanban/css/setting.css new file mode 100644 index 0000000000..bb3d26cfcf --- /dev/null +++ b/module/kanban/css/setting.css @@ -0,0 +1,7 @@ +#mainContent .objectBox {padding-top: 2px;} +#mainContent .objectBox .checkbox-primary {display: inline-block;} +#mainContent .objectBox .checkbox-primary:not(:first-child) {margin-left: 10px;} +#mainContent .objectBox .checkbox-primary>label:not(:first-child) {padding-left: 20px;} +#mainContent .laneHeightBox .tip {color: #999;} +#mainContent .objectBox .checkbox-primary>label:before {top: 2px; left: 0px;} +#mainContent .objectBox .checkbox-primary>label:after {width: 14px; height: 14px;} diff --git a/module/kanban/css/view.css b/module/kanban/css/view.css index c5f5935b86..d024f92111 100644 --- a/module/kanban/css/view.css +++ b/module/kanban/css/view.css @@ -155,3 +155,4 @@ .region .kanban-board .kanban-header-parent-col > .kanban-header-col > .title {max-width: 100% !important;} .region .kanban-board .kanban-header-sub-cols .kanban-header-col > .title > span {max-width: calc(100% - 165px) !important;} .region .kanban-board .kanban-header-sub-cols .kanban-header-col.left > .title > span {max-width: calc(100% - 120px) !important;} +.executionName .delayed {margin-right: 10px;} diff --git a/module/kanban/js/common.js b/module/kanban/js/common.js index 7537e5215e..3c124d5671 100644 --- a/module/kanban/js/common.js +++ b/module/kanban/js/common.js @@ -8,13 +8,13 @@ */ function setMailto(field, value) { - var link = createLink('kanban', 'ajaxGetContactUsers', "listID=" + value); + var link = createLink('kanban', 'ajaxGetContactUsers', 'field=' + field + '&listID=' + value); $.post(link, function(data) { - $('#team').replaceWith(data); - $('#team_chosen').remove(); - $('#team').chosen(); - $('.picker.picker-multi').remove(); + $('#' + field).replaceWith(data); + $('#' + field + '_chosen').remove(); + $('#' + field).siblings('.picker').remove(); + $('#' + field).picker(); }) } @@ -109,3 +109,42 @@ function changeType(type) $('#whitelistBox').addClass('hidden'); } } + +/** + * Load all users. + * + * @access public + * @return void + */ +function loadAllUsers() +{ + var link = createLink('kanban', 'ajaxLoadUsers', 'spaceID=0&field=owner&selectedUser=' + $('#owner').val() + "&type=all"); + + $.get(link, function(data) + { + $('#owner').replaceWith(data); + $('#owner' + "_chosen").remove(); + $('#owner').next('.picker').remove(); + $('#owner').chosen(); + }); +} + +/** + * The owners that loads kanban. + * + * @oaram int spaceID + * @access public + * @return void + */ +function loadOwners(spaceID) +{ + var link = createLink('kanban', 'ajaxLoadUsers', 'spaceID='+ spaceID + '&field=owner&selectedUser=' + $('#owner').val()); + + $.get(link, function(data) + { + $('#owner').replaceWith(data); + $('#owner' + "_chosen").remove(); + $('#owner').next('.picker').remove(); + $('#owner').chosen(); + }); +} diff --git a/module/kanban/js/create.js b/module/kanban/js/create.js index 4c7fc63489..8fdb06b4bd 100644 --- a/module/kanban/js/create.js +++ b/module/kanban/js/create.js @@ -1,6 +1,10 @@ $(function() { - if(enableImport == 'off') $("input[name^='importObjectList']").attr('disabled', 'disabled'); + if(enableImport == 'off') + { + $("input[name^='importObjectList']").attr('disabled', 'disabled'); + $('td.objectBox').hide(); + } $("input[id='copyContentbasicInfo']").click(function(){return false;}) copyRegion = $("input[id='copyContentregion']").prop('checked'); @@ -15,10 +19,12 @@ $(function() if($(this).val() == 'off') { $("input[name^='importObjectList']").attr('disabled', 'disabled'); + $('td.objectBox').hide(); } else { $("input[name^='importObjectList']").removeAttr('disabled'); + $('td.objectBox').show(); } }) @@ -82,7 +88,7 @@ function changeValue(spaceID, type) function loadUsers(spaceID) { var field = spaceType == 'private' ? 'whitelist' : 'team'; - var link = createLink('kanban', 'ajaxLoadSpaceUsers', 'spaceID='+ spaceID + '&field=' + field + '&selectedUser=' + $('#' + field).val()); + var link = createLink('kanban', 'ajaxLoadUsers', 'spaceID='+ spaceID + '&field=' + field + '&selectedUser=' + $('#' + field).val()); $.get(link, function(data) { $('#' + field).replaceWith(data); @@ -92,23 +98,3 @@ function loadUsers(spaceID) if(spaceType != 'private') loadOwners(spaceID); } - -/** - * The owners that loads kanban. - * - * @oaram int spaceID - * @access public - * @return void - */ -function loadOwners(spaceID) -{ - var link = createLink('kanban', 'ajaxLoadSpaceUsers', 'spaceID='+ spaceID + '&field=owner&selectedUser=' + $('#owner').val()); - - $.get(link, function(data) - { - $('#owner').replaceWith(data); - $('#owner' + "_chosen").remove(); - $('#owner').next('.picker').remove(); - $('#owner').chosen(); - }); -} diff --git a/module/kanban/js/edit.js b/module/kanban/js/setting.js similarity index 84% rename from module/kanban/js/edit.js rename to module/kanban/js/setting.js index 0d11945872..79edfa6b24 100644 --- a/module/kanban/js/edit.js +++ b/module/kanban/js/setting.js @@ -3,17 +3,23 @@ $(function() var heightType = $("[name='heightType']:checked").val(); setCardCount(heightType); - if(enableImport == 'off') $("input[name^='importObjectList']").attr('disabled', 'disabled'); + if(enableImport == 'off') + { + $("input[name^='importObjectList']").attr('disabled', 'disabled'); + $('td.objectBox').hide(); + } $("input[name='import']").change(function() { if($(this).val() == 'off') { $("input[name^='importObjectList']").attr('disabled', 'disabled'); + $('td.objectBox').hide(); } else { $("input[name^='importObjectList']").removeAttr('disabled'); + $('td.objectBox').show(); } }) diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 7e39e60137..5bec4a50a1 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -407,7 +407,7 @@ function renderKanbanItem(item, $item) $user.html(renderUsersAvatar(assignedTo, item.id)).attr('title', title); } - if(kanban.performable == 1) + if(kanban.performable == 1 && (item.fromType == '' || item.fromType == 'execution')) { var $progress = $item.children('.progress-box'); if(!$progress.length) $progress = $('
    ' + item.progress + '%
    ').appendTo($item); @@ -1189,7 +1189,7 @@ function createCardMenu(options) var items = []; if(privs.includes('editCard') && card.fromType == '') items.push({label: kanbanLang.editCard, icon: 'edit', url: createLink('kanban', 'editCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}}); if(privs.includes('deleteCard')) items.push({label: card.fromType == '' ? kanbanLang.deleteCard : kanbanLang.removeCard, icon: card.fromType == '' ? 'trash' : 'unlink', url: createLink('kanban', 'deleteCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}}); - if(kanban.performable == 1) + if(kanban.performable == 1 && card.fromType == '') { if(card.status == 'done') { diff --git a/module/kanban/lang/de.php b/module/kanban/lang/de.php index 3680f142e5..9547a2bfeb 100644 --- a/module/kanban/lang/de.php +++ b/module/kanban/lang/de.php @@ -48,6 +48,7 @@ $lang->kanban->removeCard = 'Remove Card'; $lang->kanban->assigntoCard = 'Assign'; $lang->kanban->setting = 'Setting'; $lang->kanban->settingSpace = 'Setting Space'; +$lang->kanban->settingKanban = 'Setting Kanban'; $lang->kanban->activateSpace = 'Activate Space'; $lang->kanban->closeSpace = 'Close Space'; $lang->kanban->deleteSpace = 'Delete Space'; @@ -87,6 +88,7 @@ $lang->kanban->allProjects = 'All ' . ($this->config->systemMode == 'cla $lang->kanban->allProducts = 'All Products'; $lang->kanban->mine = 'Mine'; $lang->kanban->alignment = 'Alignment'; +$lang->kanban->allUsers = 'Alle Benutzer laden'; /* Fields. */ $lang->kanban->space = 'Space'; @@ -199,7 +201,6 @@ $lang->kanban->moreAction = 'More Action'; $lang->kanban->noGroup = 'None'; $lang->kanban->limitExceeded = 'Limit Exceeded'; $lang->kanban->fullScreen = 'Full Screen'; -$lang->kanban->setting = 'Setting'; $lang->kanban->my = 'My'; $lang->kanban->other = 'Other'; $lang->kanban->showWIP = 'Show WIP'; @@ -215,8 +216,13 @@ $lang->kanban->error->childLimitNote = 'The sum of products in the child colu $lang->kanban->error->importObjNotEmpty = 'Please select at least one import object.'; $lang->kanban->error->childLimitEmpty = 'Please set the WIP quantity of the sub column before operation.'; -$lang->kanban->orderList['pri_asc'] = 'Story Priority Ascending'; -$lang->kanban->orderList['pri_desc'] = 'Story Priority Descending'; +$lang->kanban->orderList['id_asc'] = 'Story ID Ascending'; +$lang->kanban->orderList['id_desc'] = 'Story ID Descending'; +$lang->kanban->orderList['pri_asc'] = 'Story Priority Ascending'; +$lang->kanban->orderList['pri_desc'] = 'Story Priority Descending'; +$lang->kanban->orderList['stage_asc'] = 'Story Stage Ascending'; +$lang->kanban->orderList['stage_desc'] = 'Story Stage Descending'; +$lang->kanban->orderList['assignedTo_desc'] = 'Assigned To'; $lang->kanban->importList = array(); $lang->kanban->importList['off'] = 'Import is not enabled'; @@ -345,8 +351,8 @@ $lang->kanbanlane->modeList['independent'] = 'Independent Kanban column'; $lang->kanbanlane->heightTypeList['auto'] = "Adaptive (Adaptive to card height and lane name height)"; $lang->kanbanlane->heightTypeList['custom'] = "Custom (Customize lane height based on number of cards)"; -$lang->kanbancolumn->fluidBoardList['0'] = 'Fixed'; -$lang->kanbancolumn->fluidBoardList['1'] = 'Auto Width'; +$lang->kanbancolumn->fluidBoardList['0'] = "Fixed(Keep all columns the same width)"; +$lang->kanbancolumn->fluidBoardList['1'] = "Auto Width(Adapts to lane width)"; $lang->kanbanlane->error = new stdclass(); $lang->kanbanlane->error->mustBeInt = 'No. of cards must be a positive integer from 3 to 32767.'; diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index 1dc4b286e9..d140547fb2 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -48,6 +48,7 @@ $lang->kanban->removeCard = 'Remove Card'; $lang->kanban->assigntoCard = 'Assign'; $lang->kanban->setting = 'Setting'; $lang->kanban->settingSpace = 'Setting Space'; +$lang->kanban->settingKanban = 'Setting Kanban'; $lang->kanban->activateSpace = 'Activate Space'; $lang->kanban->closeSpace = 'Close Space'; $lang->kanban->deleteSpace = 'Delete Space'; @@ -87,6 +88,7 @@ $lang->kanban->allProjects = 'All ' . ($this->config->systemMode == 'cla $lang->kanban->allProducts = 'All Products'; $lang->kanban->mine = 'Mine'; $lang->kanban->alignment = 'Alignment'; +$lang->kanban->allUsers = 'Load All Users'; /* Fields. */ $lang->kanban->space = 'Space'; @@ -199,7 +201,6 @@ $lang->kanban->moreAction = 'More Action'; $lang->kanban->noGroup = 'None'; $lang->kanban->limitExceeded = 'Limit Exceeded'; $lang->kanban->fullScreen = 'Full Screen'; -$lang->kanban->setting = 'Setting'; $lang->kanban->my = 'My'; $lang->kanban->other = 'Other'; $lang->kanban->showWIP = 'Show WIP'; @@ -215,8 +216,13 @@ $lang->kanban->error->childLimitNote = 'The sum of products in the child colu $lang->kanban->error->importObjNotEmpty = 'Please select at least one import object.'; $lang->kanban->error->childLimitEmpty = 'Please set the WIP quantity of the sub column before operation.'; -$lang->kanban->orderList['pri_asc'] = 'Story Priority Ascending'; -$lang->kanban->orderList['pri_desc'] = 'Story Priority Descending'; +$lang->kanban->orderList['id_asc'] = 'Story ID Ascending'; +$lang->kanban->orderList['id_desc'] = 'Story ID Descending'; +$lang->kanban->orderList['pri_asc'] = 'Story Priority Ascending'; +$lang->kanban->orderList['pri_desc'] = 'Story Priority Descending'; +$lang->kanban->orderList['stage_asc'] = 'Story Stage Ascending'; +$lang->kanban->orderList['stage_desc'] = 'Story Stage Descending'; +$lang->kanban->orderList['assignedTo_desc'] = 'Assigned To'; $lang->kanban->importList = array(); $lang->kanban->importList['off'] = 'Import is not enabled'; @@ -345,8 +351,8 @@ $lang->kanbanlane->modeList['independent'] = 'Independent Kanban column'; $lang->kanbanlane->heightTypeList['auto'] = "Adaptive (Adaptive to card height and lane name height)"; $lang->kanbanlane->heightTypeList['custom'] = "Custom (Customize lane height based on number of cards)"; -$lang->kanbancolumn->fluidBoardList['0'] = 'Fixed'; -$lang->kanbancolumn->fluidBoardList['1'] = 'Auto Width'; +$lang->kanbancolumn->fluidBoardList['0'] = "Fixed(Keep all columns the same width)"; +$lang->kanbancolumn->fluidBoardList['1'] = "Auto Width(Adapts to lane width)"; $lang->kanbanlane->error = new stdclass(); $lang->kanbanlane->error->mustBeInt = 'No. of cards must be a positive integer from 3 to 32767.'; diff --git a/module/kanban/lang/fr.php b/module/kanban/lang/fr.php index dad9293d0f..c1ae460861 100644 --- a/module/kanban/lang/fr.php +++ b/module/kanban/lang/fr.php @@ -48,6 +48,7 @@ $lang->kanban->removeCard = 'Remove Card'; $lang->kanban->assigntoCard = 'Assign'; $lang->kanban->setting = 'Setting'; $lang->kanban->settingSpace = 'Setting Space'; +$lang->kanban->settingKanban = 'Setting Kanban'; $lang->kanban->activateSpace = 'Activate Space'; $lang->kanban->closeSpace = 'Close Space'; $lang->kanban->deleteSpace = 'Delete Space'; @@ -87,6 +88,7 @@ $lang->kanban->allProjects = 'All ' . ($this->config->systemMode == 'cla $lang->kanban->allProducts = 'All Products'; $lang->kanban->mine = 'Mine'; $lang->kanban->alignment = 'Alignment'; +$lang->kanban->allUsers = 'Charger Tous'; /* Fields. */ $lang->kanban->space = 'Space'; @@ -199,7 +201,6 @@ $lang->kanban->moreAction = 'More Action'; $lang->kanban->noGroup = 'None'; $lang->kanban->limitExceeded = 'Limit Exceeded'; $lang->kanban->fullScreen = 'Full Screen'; -$lang->kanban->setting = 'Setting'; $lang->kanban->my = 'My'; $lang->kanban->other = 'Other'; $lang->kanban->showWIP = 'Show WIP'; @@ -215,8 +216,13 @@ $lang->kanban->error->childLimitNote = 'The sum of products in the child colu $lang->kanban->error->importObjNotEmpty = 'Please select at least one import object.'; $lang->kanban->error->childLimitEmpty = 'Please set the WIP quantity of the sub column before operation.'; -$lang->kanban->orderList['pri_asc'] = 'Story Priorité Ascendante'; -$lang->kanban->orderList['pri_desc'] = 'Story Priorité Descendante'; +$lang->kanban->orderList['id_asc'] = 'Story ID Ascendante'; +$lang->kanban->orderList['id_desc'] = 'Story ID Descendante'; +$lang->kanban->orderList['pri_asc'] = 'Story Priorité Ascendante'; +$lang->kanban->orderList['pri_desc'] = 'Story Priorité Descendante'; +$lang->kanban->orderList['stage_asc'] = 'Story Phase Ascendante'; +$lang->kanban->orderList['stage_desc'] = 'Story Phase Descendante'; +$lang->kanban->orderList['assignedTo_desc'] = 'Assigné à'; $lang->kanban->importList = array(); $lang->kanban->importList['off'] = 'Import is not enabled'; @@ -345,8 +351,8 @@ $lang->kanbanlane->modeList['independent'] = 'Independent Kanban column'; $lang->kanbanlane->heightTypeList['auto'] = "Adaptive (Adaptive to card height and lane name height)"; $lang->kanbanlane->heightTypeList['custom'] = "Custom (Customize lane height based on number of cards)"; -$lang->kanbancolumn->fluidBoardList['0'] = 'Fixed'; -$lang->kanbancolumn->fluidBoardList['1'] = 'Auto Width'; +$lang->kanbancolumn->fluidBoardList['0'] = "Fixed(Largeur standard pour toutes les colonnes)"; +$lang->kanbancolumn->fluidBoardList['1'] = "Auto Width(Adapter selon la largeur de voie)"; $lang->kanbanlane->error = new stdclass(); $lang->kanbanlane->error->mustBeInt = 'Nb de cartes doit être un entier positif compris entre 3 et 32767.'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index cdee1f076d..d0a83afc89 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -48,6 +48,7 @@ $lang->kanban->removeCard = '移除卡片'; $lang->kanban->assigntoCard = '指派'; $lang->kanban->setting = '设置'; $lang->kanban->settingSpace = '设置空间'; +$lang->kanban->settingKanban = '设置看板'; $lang->kanban->activateSpace = '激活空间'; $lang->kanban->closeSpace = '关闭空间'; $lang->kanban->deleteSpace = '删除空间'; @@ -86,7 +87,8 @@ $lang->kanban->allKanban = '所有看板'; $lang->kanban->allProjects = '所有' . ($this->config->systemMode == 'classic' ? $lang->executionCommon : '项目'); $lang->kanban->allProducts = '所有产品'; $lang->kanban->mine = '我负责'; -$lang->kanban->alignment = '对齐方式'; +$lang->kanban->alignment = '列标题对齐方式'; +$lang->kanban->allUsers = '加载所有用户'; /* Fields. */ $lang->kanban->space = '所属空间'; @@ -132,11 +134,11 @@ $lang->kanban->aclGroup['extend'] = '继承空间'; $lang->kanban->aclList['extend'] = '继承空间访问权限(能访问当前空间,即可访问)'; $lang->kanban->aclList['private'] = '私有(看板团队成员、白名单、空间负责人可访问)'; -$lang->kanban->archiveList['0'] = '不启用'; $lang->kanban->archiveList['1'] = '启用'; +$lang->kanban->archiveList['0'] = '不启用'; -$lang->kanban->enableList['0'] = '不启用'; $lang->kanban->enableList['1'] = '启用'; +$lang->kanban->enableList['0'] = '不启用'; $lang->kanban->alignmentList['center'] = '居中'; $lang->kanban->alignmentList['left'] = '居左'; @@ -199,7 +201,6 @@ $lang->kanban->moreAction = '更多操作'; $lang->kanban->noGroup = '无'; $lang->kanban->limitExceeded = '超出在制品限制'; $lang->kanban->fullScreen = '全屏'; -$lang->kanban->setting = '设置'; $lang->kanban->my = '我的看板'; $lang->kanban->other = '其他'; $lang->kanban->showWIP = '显示在制品限制'; @@ -215,12 +216,17 @@ $lang->kanban->error->childLimitNote = '子列在制品数量之和不能大 $lang->kanban->error->importObjNotEmpty = '请至少选择一个导入对象'; $lang->kanban->error->childLimitEmpty = '请先设置子列的在制品数量后再操作'; -$lang->kanban->orderList['pri_asc'] = '需求优先级正序排序'; -$lang->kanban->orderList['pri_desc'] = '需求优先级倒序排序'; +$lang->kanban->orderList['id_asc'] = '需求ID正序'; +$lang->kanban->orderList['id_desc'] = '需求ID倒序'; +$lang->kanban->orderList['pri_asc'] = '需求优先级正序'; +$lang->kanban->orderList['pri_desc'] = '需求优先级倒序'; +$lang->kanban->orderList['stage_asc'] = '需求阶段正序'; +$lang->kanban->orderList['stage_desc'] = '需求阶段倒序'; +$lang->kanban->orderList['assignedTo_desc'] = '指派给'; $lang->kanban->importList = array(); -$lang->kanban->importList['off'] = '不启用导入功能'; $lang->kanban->importList['on'] = '启用导入功能(可以导入自己有权查看的内容作为卡片)'; +$lang->kanban->importList['off'] = '不启用导入功能'; $lang->kanban->importObjectList = array(); $lang->kanban->importObjectList['plans'] = '计划'; @@ -345,8 +351,8 @@ $lang->kanbanlane->modeList['independent'] = '采用独立的看板列'; $lang->kanbanlane->heightTypeList['auto'] = "自适应(根据卡片高度和泳道名称高度自适应)"; $lang->kanbanlane->heightTypeList['custom'] = "自定义(根据卡片数量自定义泳道高度)"; -$lang->kanbancolumn->fluidBoardList['0'] = '固定列宽'; -$lang->kanbancolumn->fluidBoardList['1'] = '自适应列宽'; +$lang->kanbancolumn->fluidBoardList['0'] = "固定列宽(所有列保持一致的宽度)"; +$lang->kanbancolumn->fluidBoardList['1'] = "自适应列宽(根据泳道宽度自适应)"; $lang->kanbanlane->error = new stdclass(); $lang->kanbanlane->error->mustBeInt = '卡片数量必须是 3~32767 的正整数。'; diff --git a/module/kanban/model.php b/module/kanban/model.php old mode 100644 new mode 100755 index 08ed5d539f..020e6ab7d9 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -1207,6 +1207,10 @@ class kanbanModel extends model ->andWhere('action')->eq('opened') ->fetchPairs(); } + elseif($fromType == 'execution') + { + $executionProgress = $this->loadModel('project')->computerProgress($objects); + } /* Data for constructing the card. */ foreach($objectCards as $objectID => $cardsInfo) @@ -1231,6 +1235,7 @@ class kanbanModel extends model if($delay > 0) $objectCard->delay = $delay; } $objectCard->execType = $object->type; + $objectCard->progress = isset($executionProgress[$objectID]->progress) ? $executionProgress[$objectID]->progress : 0; } $objectCard->desc = strip_tags(htmlspecialchars_decode($object->desc)); @@ -1393,7 +1398,7 @@ class kanbanModel extends model * @access public * @return array */ - public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default', $searchValue = '', $orderBy = 'pri_asc') + public function getExecutionKanban($executionID, $browseType = 'all', $groupBy = 'default', $searchValue = '', $orderBy = 'id_asc') { if($groupBy != 'default') return $this->getKanban4Group($executionID, $browseType, $groupBy, $searchValue, $orderBy); @@ -1521,13 +1526,13 @@ class kanbanModel extends model * @access public * @return array */ - public function getKanban4Group($executionID, $browseType, $groupBy, $searchValue = '', $orderBy = 'pri_asc') + public function getKanban4Group($executionID, $browseType, $groupBy, $searchValue = '', $orderBy = 'id_asc') { /* Get card data. */ $cardList = array(); if($browseType == 'story') $cardList = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, 't1.`order`_desc', 'allStory'); if($browseType == 'bug') $cardList = $this->loadModel('bug')->getExecutionBugs($executionID); - if($browseType == 'task') $cardList = $this->loadModel('execution')->getKanbanTasks($executionID, "id"); + if($browseType == 'task') $cardList = $this->loadModel('execution')->getKanbanTasks($executionID); if($browseType == 'task' and $groupBy == 'assignedTo') { @@ -1547,7 +1552,7 @@ class kanbanModel extends model if($browseType == 'bug') $bugCardMenu = $this->getKanbanCardMenu($executionID, $cardList, 'bug'); if($browseType == 'task') $taskCardMenu = $this->getKanbanCardMenu($executionID, $cardList, 'task'); - if($groupBy == 'story' and $browseType == 'task' and !isset($this->lang->kanban->orderList[$orderBy])) $orderBy = 'pri_asc'; + if($groupBy == 'story' and $browseType == 'task' and !isset($this->lang->kanban->orderList[$orderBy])) $orderBy = 'id_asc'; $lanes = $this->getLanes4Group($executionID, $browseType, $groupBy, $cardList, $orderBy); if(empty($lanes)) return array(); @@ -1600,7 +1605,7 @@ class kanbanModel extends model { $columnData[0]['id'] = 0; $columnData[0]['type'] = 'story'; - $columnData[0]['name'] = zget($this->lang->kanban->orderList, $orderBy, ''); + $columnData[0]['name'] = $this->lang->SRCommon; $columnData[0]['color'] = '#333'; $columnData[0]['limit'] = '-1'; $columnData[0]['laneType'] = $browseType; @@ -1720,7 +1725,7 @@ class kanbanModel extends model * * @return array */ - public function getLanes4Group($executionID, $browseType, $groupBy, $cardList, $orderBy = 'pri_asc') + public function getLanes4Group($executionID, $browseType, $groupBy, $cardList, $orderBy = 'id_asc') { $lanes = array(); $groupByList = array(); @@ -1938,6 +1943,7 @@ class kanbanModel extends model ->join('whitelist', ',') ->join('team', ',') ->trim('name') + ->stripTags($this->config->kanban->editor->createspace['id'], $this->config->allowedTags) ->remove('uid,contactListMenu') ->get(); @@ -1981,6 +1987,7 @@ class kanbanModel extends model ->join('whitelist', ',') ->join('team', ',') ->trim('name') + ->stripTags($this->config->kanban->editor->editspace['id'], $this->config->allowedTags) ->remove('uid,contactListMenu') ->get(); @@ -2193,7 +2200,8 @@ class kanbanModel extends model ->join('whitelist', ',') ->join('team', ',') ->trim('name') - ->remove('contactListMenu,type,import,importObjectList,copyKanbanID,copyRegion') + ->stripTags($this->config->kanban->editor->create['id'], $this->config->allowedTags) + ->remove('contactListMenu,type,import,importObjectList,uid,copyKanbanID,copyRegion') ->get(); if($this->post->import == 'on') $kanban->object = implode(',', $this->post->importObjectList); @@ -2235,6 +2243,13 @@ class kanbanModel extends model $this->loadModel('file')->saveUpload('kanban', $kanbanID); $this->file->updateObjectID($this->post->uid, $kanbanID, 'kanban'); + if(isset($_POST['team']) or isset($_POST['whitelist'])) + { + $type = isset($_POST['team']) ? 'team' : 'whitelist'; + $kanbanMembers = empty($kanban->{$type}) ? array() : explode(',', $kanban->{$type}); + $this->addSpaceMembers($kanban->space, $type, $kanbanMembers); + } + return $kanbanID; } } @@ -2254,15 +2269,56 @@ class kanbanModel extends model $kanban = fixer::input('post') ->setDefault('lastEditedBy', $account) ->setDefault('lastEditedDate', helper::now()) - ->setDefault('displayCards', 0) ->setDefault('whitelist', '') ->setDefault('team', '') - ->setIF($this->post->import == 'off', 'object', '') - ->setIF($this->post->heightType == 'auto', 'displayCards', 0) ->join('whitelist', ',') ->join('team', ',') ->trim('name') - ->remove('uid,contactListMenu,import,importObjectList,heightType') + ->stripTags($this->config->kanban->editor->edit['id'], $this->config->allowedTags) + ->remove('uid,contactListMenu') + ->get(); + + $this->dao->update(TABLE_KANBAN)->data($kanban) + ->autoCheck() + ->batchCheck($this->config->kanban->edit->requiredFields, 'notempty') + ->where('id')->eq($kanbanID) + ->exec(); + + if(!dao::isError()) + { + $this->loadModel('file')->saveUpload('kanban', $kanbanID); + $this->file->updateObjectID($this->post->uid, $kanbanID, 'kanban'); + + if(isset($_POST['team']) or isset($_POST['whitelist'])) + { + $type = isset($_POST['team']) ? 'team' : 'whitelist'; + $kanbanMembers = empty($kanban->{$type}) ? array() : explode(',', $kanban->{$type}); + $this->addSpaceMembers($kanban->space, $type, $kanbanMembers); + } + + return common::createChanges($oldKanban, $kanban); + } + } + + /** + * Setting kanban. + * + * @param int $kanbanID + * @access public + * @return void + */ + public function setting($kanbanID) + { + $kanbanID = (int)$kanbanID; + $account = $this->app->user->account; + $oldKanban = $this->getByID($kanbanID); + $kanban = fixer::input('post') + ->setDefault('lastEditedBy', $account) + ->setDefault('lastEditedDate', helper::now()) + ->setDefault('displayCards', 0) + ->setIF($this->post->import == 'off', 'object', '') + ->setIF($this->post->heightType == 'auto', 'displayCards', 0) + ->remove('import,importObjectList,heightType') ->get(); if($this->post->import == 'on') $kanban->object = implode(',', $this->post->importObjectList); @@ -2280,11 +2336,10 @@ class kanbanModel extends model if(!dao::isError()) { - $this->loadModel('file')->saveUpload('kanban', $kanbanID); - $this->file->updateObjectID($this->post->uid, $kanbanID, 'kanban'); - return common::createChanges($oldKanban, $kanban); } + + return false; } /** @@ -2559,6 +2614,32 @@ class kanbanModel extends model } } + /** + * Add space members. + * + * @param int $spaceID + * @param array $type team|whitelist + * @param array $kanbanMembers + * @access public + * @return void + */ + public function addSpaceMembers($spaceID, $type, $kanbanMembers = array()) + { + $space = $this->getSpaceById($spaceID); + if(empty($space)) return; + + $spaceMembers = empty($space->{$type}) ? array() : explode(',', $space->{$type}); + $members = $space->{$type}; + $addMembers = array_diff($kanbanMembers, $spaceMembers); + + if(!empty($addMembers)) + { + $addMembers = implode(',', $addMembers); + $members .= ',' . trim($addMembers, ','); + $this->dao->update(TABLE_KANBANSPACE)->set($type)->eq($members)->where('id')->eq($spaceID)->exec(); + } + } + /** * Remove kanban cell. * @@ -3157,20 +3238,18 @@ class kanbanModel extends model $actions .= " {$this->lang->kanban->fullScreen}"; $CRKanban = !(isset($this->config->CRKanban) and $this->config->CRKanban == '0' and $kanban->status == 'closed'); - $printRegionBtn = ($CRKanban and (common::hasPriv('kanban', 'createRegion'))); $printKanbanBtn = (common::hasPriv('kanban', 'edit') or ($kanban->status == 'active' and common::hasPriv('kanban', 'close')) or common::hasPriv('kanban', 'delete') or ($kanban->status == 'closed' and common::hasPriv('kanban', 'activate'))); - if($printRegionBtn or $printKanbanBtn) + if($printKanbanBtn) { - $actions .= "" . ' ' . $this->lang->kanban->setting . ''; + $actions .= "" . ' ' . $this->lang->edit . ''; $actions .= ""; } + if(common::hasPriv('kanban', 'setting')) $actions .= html::a(helper::createLink('kanban', 'setting', "kanbanID=$kanban->id", '', true), ' ' . $this->lang->kanban->setting, '', "class='iframe btn btn-link' data-width='60%'"); + $actions .= ""; $this->lang->headerActions = $actions; @@ -3263,7 +3344,7 @@ class kanbanModel extends model { $groupBy = ($this->session->execGroupBy and ($this->app->tab == 'execution' or $this->config->vision == 'lite')) ? $this->session->execGroupBy : ''; - $fromCell = $this->dao->select('cards, lane')->from(TABLE_KANBANCELL) + $fromCell = $this->dao->select('id,cards,lane')->from(TABLE_KANBANCELL) ->where('`column`')->eq($fromColID) ->beginIF(!$groupBy or $groupBy == 'default')->andWhere('lane')->eq($fromLaneID)->fi() ->beginIF($groupBy and $groupBy != 'default') @@ -3273,20 +3354,36 @@ class kanbanModel extends model ->fetch(); if($groupBy and $groupBy != 'default') $fromLaneID = $toLaneID = $fromCell->lane; + $fromCells[$fromCell->id] = $fromCell; - $fromCellCards = $fromCell->cards; - $toCell = $this->dao->select('*')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch(); - $toCellCards = $this->dao->select('cards')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch('cards'); + /* Remove all cells with cardID in fromCell. */ + $fromLane = $this->getLaneById($fromLaneID); + $fromCells += $this->dao->select('t1.id as id,t1.cards,t1.lane')->from(TABLE_KANBANCELL)->alias('t1') + ->leftJoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane=t2.id') + ->where('t1.type')->eq($fromLane->type) + ->andWhere('t1.id')->ne($fromCell->id) + ->andWhere('t2.region')->eq($fromLane->region) + ->andWhere('t1.cards')->like("%,$cardID,%") + ->fetchAll('id'); - $kanbanID = $kanbanID == 0 ? $toCell->kanban : $kanbanID; + foreach($fromCells as $fromCell) + { + $fromCellCards = explode(',', $fromCell->cards); + $fromCellCards = array_unique($fromCellCards); + $fromCellCards = array_filter($fromCellCards); + $fromCellCards = implode(',', $fromCellCards); + $fromCardList = str_replace(",$cardID,", ',', ",$fromCellCards,"); + if($fromCardList == ',') $fromCardList = ''; + $this->dao->update(TABLE_KANBANCELL)->set('cards')->eq($fromCardList)->where('id')->eq($fromCell->id)->exec(); + } + /* Add cardID to toCell. */ + $toCell = $this->dao->select('*')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch(); + $toCellCards = $this->dao->select('cards')->from(TABLE_KANBANCELL)->where('lane')->eq($toLaneID)->andWhere('`column`')->eq($toColID)->fetch('cards'); + $kanbanID = $kanbanID == 0 ? $toCell->kanban : $kanbanID; if(!$toCell) $this->addKanbanCell($kanbanID, $toLaneID, $toColID, 'common'); - $fromCardList = str_replace(",$cardID,", ',', $fromCellCards); - $toCardList = rtrim($toCellCards, ',') . ",$cardID,"; - - if($fromCardList == ',') $fromCardList = ''; - $this->dao->update(TABLE_KANBANCELL)->set('cards')->eq($fromCardList)->where('`column`')->eq($fromColID)->andWhere('lane')->eq($fromLaneID)->exec(); + $toCardList = rtrim($toCellCards, ',') . ",$cardID,"; $this->dao->update(TABLE_KANBANCELL)->set('cards')->eq($toCardList)->where('`column`')->eq($toColID)->andWhere('lane')->eq($toLaneID)->exec(); } diff --git a/module/kanban/view/create.html.php b/module/kanban/view/create.html.php index d9899d6dd1..d48bf1a673 100644 --- a/module/kanban/view/create.html.php +++ b/module/kanban/view/create.html.php @@ -47,20 +47,26 @@
    kanban->owner;?>owner) ? $copyKanban->owner : '', "class='form-control chosen' data-drop_direction='down'");?> +
    + owner) ? $copyKanban->owner : '', "class='form-control chosen' data-drop_direction='down'");?> + kanban->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?> +
    +
    kanban->team;?>
    team) ? $copyKanban->team : '', "class='form-control picker-select' multiple data-dropDirection='bottom'");?> + fetch('my', 'buildContactLists', "dropdownName=team");?>
    kanban->columnWidth;?>kanbancolumn->fluidBoardList, isset($copyKanban->fluidBoard) ? $copyKanban->fluidBoard : 0));?>kanbancolumn->fluidBoardList, isset($copyKanban->fluidBoard) ? $copyKanban->fluidBoard : 0));?>
    kanban->import?>
    kanban->archive;?>kanban->archiveList, isset($copyKanban->archived) ? $copyKanban->archived : '0'));?>kanban->archiveList, isset($copyKanban->archived) ? $copyKanban->archived : '1'));?>
    kanban->manageProgress;?>kanban->enableList, isset($copyKanban->performable) ? $copyKanban->performable : '0'));?>kanban->enableList, isset($copyKanban->performable) ? $copyKanban->performable : '1'));?>
    kanban->alignment;?>
    whitelist;?>whitelist) ? $copyKanban->whitelist : '', 'class="form-control picker-select" multiple');?> +
    + whitelist) ? $copyKanban->whitelist : '', 'class="form-control picker-select" multiple');?> + fetch('my', 'buildContactLists', "dropdownName=whitelist&attr=data-drop_direction='up'");?> +
    +
    - fetch('my', 'buildContactLists');?> + fetch('my', 'buildContactLists', "dropdownName=team");?>
    - - - - - - + @@ -36,51 +30,23 @@ - + - - - - - 1):?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/module/kanban/view/editspace.html.php b/module/kanban/view/editspace.html.php index 292e7f060c..f58d01e18e 100644 --- a/module/kanban/view/editspace.html.php +++ b/module/kanban/view/editspace.html.php @@ -37,7 +37,7 @@ diff --git a/module/kanban/view/setting.html.php b/module/kanban/view/setting.html.php new file mode 100644 index 0000000000..1cbe40a9f4 --- /dev/null +++ b/module/kanban/view/setting.html.php @@ -0,0 +1,70 @@ + + * @package kanban + * @version $Id: edit.html.php 935 2021-12-09 16:15:24Z $ + * @link https://www.zentao.net + */ +?> + + + +config->vision);?> +
    +
    +

    kanban->settingKanban;?>

    +
    + +
    kanban->space;?>space, "class='form-control chosen'");?>
    kanban->WIPCount;?>kanban->showWIPList, $kanban->showWIP);?>space, "class='form-control chosen' onchange='loadOwners(this.value)'");?>
    kanban->name;?>
    kanban->owner;?>owner, "class='form-control chosen' data-drop_direction='down'");?> +
    + owner, "class='form-control chosen' data-drop_direction='down'");?> + kanban->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?> +
    +
    kanban->team;?>
    team, "class='form-control picker-select' multiple data-dropDirection='bottom'");?> + fetch('my', 'buildContactLists', 'dropdownName=team');?>
    kanban->columnWidth;?>kanbancolumn->fluidBoardList, $kanban->fluidBoard));?>
    kanban->laneHeight;?>kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?>
    kanban->import?>kanban->importList, $enableImport));?>
    kanban->importObjectList, $importObjects);?>
    kanban->archive;?>kanban->archiveList, $kanban->archived));?>
    kanban->manageProgress;?>kanban->enableList, $kanban->performable));?>
    kanban->alignment;?>kanban->alignmentList, $kanban->alignment));?>
    kanban->desc;?> @@ -90,7 +56,12 @@
    whitelist;?>whitelist, 'class="form-control picker-select" multiple');?> +
    + whitelist, 'class="form-control picker-select" multiple');?> + fetch('my', 'buildContactLists', "dropdownName=whitelist&attr=data-drop_direction='up'");?> +
    +
    - fetch('my', 'buildContactLists');?> + fetch('my', 'buildContactLists', "dropdownName=team");?>
    + + + + + + + + + + 1):?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    kanban->WIPCount;?>kanban->showWIPList, $kanban->showWIP);?>
    kanban->columnWidth;?>kanbancolumn->fluidBoardList, $kanban->fluidBoard));?>
    kanban->laneHeight;?>kanbanlane->heightTypeList, $heightType, "onclick='setCardCount(this.value);'"));?>
    kanban->import?>kanban->importList, $enableImport));?>
    kanban->importObjectList, $importObjects);?>
    kanban->archive;?>kanban->archiveList, $kanban->archived));?>
    kanban->manageProgress;?>kanban->enableList, $kanban->performable));?>
    kanban->alignment;?>kanban->alignmentList, $kanban->alignment));?>
    + +
    +
    +
    + diff --git a/module/kanban/view/space.html.php b/module/kanban/view/space.html.php index 5ff85b27bf..715a472351 100644 --- a/module/kanban/view/space.html.php +++ b/module/kanban/view/space.html.php @@ -47,8 +47,10 @@ name;?>

    - desc = empty($space->desc) ? $lang->kanban->emptyDesc : strip_tags(htmlspecialchars_decode($space->desc));?> -

    desc;?>

    + desc) ? $lang->kanban->emptyDesc : str_replace("\n", '', strip_tags($space->desc));?> + ]*>|]*>/';?> + desc) ? $lang->kanban->emptyDesc : preg_replace($pattern, '', $space->desc);?> +

    status == 'closed' ? 'disabled' : '';?> @@ -126,7 +128,9 @@
    -
    desc));?>
    + desc));?> + desc));?> +
' id='stories'> - +
id}, \"story\")", ' ' . $lang->release->linkStory, '', "class='btn btn-primary'");?>
@@ -148,7 +148,7 @@
' id='bugs'> - +
id}, \"bug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
@@ -238,7 +238,7 @@
' id='leftBugs'> - +
id}, \"leftBug\")", ' ' . $lang->release->linkBug, '', "class='btn btn-primary'");?>
diff --git a/module/repo/config.php b/module/repo/config.php index 3c258706c1..13855f8028 100644 --- a/module/repo/config.php +++ b/module/repo/config.php @@ -37,10 +37,10 @@ $config->repo->switcherModuleList = array('repo', 'job', 'compile', 'mr'); $config->repo->switcherMethodList = array('browse', 'review', 'view', 'diff', 'log', 'revision', 'blame'); $config->repo->create = new stdclass(); -$config->repo->create->requiredFields = 'product,SCM,name,path,encoding,client'; +$config->repo->create->requiredFields = 'product,SCM,name,encoding'; $config->repo->edit = new stdclass(); -$config->repo->edit->requiredFields = 'product,SCM,name,path,encoding,client'; +$config->repo->edit->requiredFields = 'product,SCM,name,encoding'; $config->repo->svn = new stdclass(); $config->repo->svn->requiredFields = 'account,password'; @@ -49,6 +49,11 @@ $config->repo->gitlab = new stdclass; $config->repo->gitlab->perPage = 300; $config->repo->gitlab->apiPath = "%s/api/v4/projects/%s/repository/"; +$config->repo->gitea = new stdclass; +$config->repo->gitea->apiPath = "%s/api/v1/repos/%s/"; + +$config->repo->gitServiceList = array('gitlab', 'gitea'); + $config->repo->rules['module']['task'] = 'Task'; $config->repo->rules['module']['bug'] = 'Bug'; $config->repo->rules['module']['story'] = 'Story'; diff --git a/module/repo/control.php b/module/repo/control.php index 3d40711f1d..e699afa723 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -142,14 +142,14 @@ class repo extends control $products = $this->loadModel('product')->getProductPairsByProject($objectID); $productID = count($products) > 0 ? key($products) : ''; - $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->create; - $this->view->position[] = $this->lang->repo->create; - $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted'); - $this->view->products = $products; - $this->view->productID = $productID; - $this->view->gitlabHosts = $this->loadModel('gitlab')->getPairs(); - $this->view->objectID = $objectID; + $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->create; + $this->view->position[] = $this->lang->repo->create; + $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted|noclosed'); + $this->view->products = $products; + $this->view->productID = $productID; + $this->view->serviceHosts = $this->loadModel('gitlab')->getPairs(); + $this->view->objectID = $objectID; $this->display(); } @@ -182,25 +182,29 @@ class repo extends control $this->app->loadLang('action'); - if(strtolower($repo->SCM) == 'gitlab') + $scm = strtolower($repo->SCM); + if(in_array($scm, $this->config->repo->gitServiceList)) { - $gitlabID = isset($repo->gitlab) ? $repo->gitlab : 0; - $projects = $this->loadModel('gitlab')->apiGetProjects($gitlabID); - $options = array(); - foreach($projects as $project) $options[$project->id] = $project->name_with_namespace; + $serviceID = isset($repo->gitService) ? $repo->gitService : 0; + $projects = $this->loadModel($scm)->apiGetProjects($serviceID); + $options = array(); + foreach($projects as $project) + { + if($scm == 'gitlab') $options[$project->id] = $project->name_with_namespace; + if($scm == 'gitea') $options[$project->full_name] = $project->full_name; + } $this->view->projects = $options; } - $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit; - $repo->repoType = $repo->id . '-' . $repo->SCM; - $this->view->repo = $repo; - $this->view->repoID = $repoID; - $this->view->objectID = $objectID; - $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted'); - $this->view->products = $objectID ? $this->loadModel('product')->getProductPairsByProject($objectID) : $this->loadModel('product')->getPairs(); - $this->view->gitlabHosts = array('' => '') + $this->loadModel('gitlab')->getPairs(); + $this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit; + $this->view->repo = $repo; + $this->view->repoID = $repoID; + $this->view->objectID = $objectID; + $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted|noclosed'); + $this->view->products = $objectID ? $this->loadModel('product')->getProductPairsByProject($objectID) : $this->loadModel('product')->getPairs(); + $this->view->serviceHosts = array('' => '') + $this->loadModel('pipeline')->getPairs($repo->SCM); $this->view->position[] = html::a(inlink('maintain'), $this->lang->repo->common); $this->view->position[] = $this->lang->repo->edit; @@ -233,11 +237,7 @@ class repo extends control if($error) return print(js::alert($error)); - $this->dao->delete()->from(TABLE_REPO)->where('id')->eq($repoID)->exec(); - $this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($repoID)->exec(); - $this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($repoID)->exec(); - $this->dao->delete()->from(TABLE_REPOBRANCH)->where('repo')->eq($repoID)->exec(); - + $this->repo->delete(TABLE_REPO, $repoID); if(dao::isError()) return print(js::error(dao::getError())); echo js::reload('parent'); } @@ -1155,7 +1155,7 @@ class repo extends control { foreach($repoGroup as $type => $group) { - if(strtolower($type) != 'gitlab') unset($repoGroup[$type]); + if(!in_array(strtolower($type), $this->config->repo->gitServiceList)) unset($repoGroup[$type]); } } @@ -1166,6 +1166,54 @@ class repo extends control $this->display(); } + /** + * Ajax get hosts. + * + * @param int $scm + * @access public + * @return void + */ + public function ajaxGetHosts($scm) + { + $scm = strtolower($scm); + $hosts = $this->loadModel($scm)->getPairs(); + return print(html::select('pipelineHost', $hosts, '', "class='form-control chosen'")); + } + + /** + * Ajax get projects by server. + * + * @param int $serverID + * @access public + * @return void + */ + public function ajaxGetProjects($serverID) + { + $server = $this->loadModel('pipeline')->getByID($serverID); + $getProjectFunc = 'ajaxGet' . $server->type . 'Projects'; + + $this->$getProjectFunc($serverID); + } + + /** + * Ajax get gitea projects. + * + * @param string $gitlabID + * @param string $projectIdList + * @access public + * @return void + */ + public function ajaxGetGiteaProjects($giteaID) + { + $projects = $this->loadModel('gitea')->apiGetProjects($giteaID); + if(!$projects) $this->send(array('message' => array())); + + $options = ""; + foreach($projects as $project) $options .= ""; + + return print($options); + } + /** * Ajax get gitlab projects. * @@ -1318,7 +1366,14 @@ class repo extends control $repo = $this->repo->getRepoByID($repoID); if($repo->SCM == 'Gitlab') { - $url = $this->loadModel('gitlab')->downloadCode($repo->gitlab, $repo->project, $branch); + $this->scm = $this->app->loadClass('scm'); + $this->scm->setEngine($repo); + $url = $this->scm->getDownloadUrl($branch); + } + elseif($repo->SCM == 'Gitea') + { + $api = $this->loadModel('gitea')->getApiRoot($repo->serviceHost); + $url = sprintf($api, "/repos/{$repo->serviceProject}/archive/{$branch}.zip"); } elseif($repo->SCM == 'Git') { diff --git a/module/repo/css/blame.css b/module/repo/css/blame.css index 77e1eacc1f..d5e6bc17c5 100644 --- a/module/repo/css/blame.css +++ b/module/repo/css/blame.css @@ -7,5 +7,5 @@ .topLine {border-top: 1px solid #ccc;} .topLine td.info {padding: 8px 4px;} pre {margin-bottom: 0px; display: block; white-space: pre-wrap; padding: 0px 3px; border: 0px; background: none;} -.line {font-weight: bold; border: 1px solid #E4E4E4; background-color: #ECECEC; text-align: right;} +.line {font-weight: bold; border: 1px solid #E4E4E4; background-color: #fafafa; color: #999; text-align: center;} .panel-actions.pull-right {margin-top: -5px;} diff --git a/module/repo/css/browse.css b/module/repo/css/browse.css index 9ecc8cca58..fd9c9002de 100644 --- a/module/repo/css/browse.css +++ b/module/repo/css/browse.css @@ -31,3 +31,4 @@ .popover-content {padding: 0;} .download-popover .table {margin-bottom: 0;} .download-popover .table td {padding-right: 0;} +.download-popover .popover-title {padding: 8px;} diff --git a/module/repo/css/common.css b/module/repo/css/common.css index 7d19921566..a717e4e8b4 100644 --- a/module/repo/css/common.css +++ b/module/repo/css/common.css @@ -4,10 +4,9 @@ a:hover, a:active {text-decoration:underline; color: #C61A1A;} #swapper .col-footer a:hover {color: #0c64eb;} h2,h3 {font-size: 20px; margin: 0; clear: both;} h3 {font-size: 16px;} -.revision {font-size: 12px; line-height: 20px; text-align: right; padding-right: 8px;} +.revision {line-height: 20px; text-align: right; padding-right: 8px;} .directory {background-image:url('theme/default/images/repo/dir.png');} .file {background-image:url('theme/default/images/repo/txt.png');} -//.icon {width: 17px; padding-left: 10px; padding-right: 2px;} .mini-icon {display: inline-block; height: 16px; width: 16px; background-color: transparent; background-position: 0 0; background-repeat: no-repeat; vertical-align: text-bottom;} .action {float: left;} .input-group select#encrypt {border-left: 0px;} @@ -70,7 +69,7 @@ h3 {font-size: 16px;} /* Comment-btn */ .comment-btn {position: relative; margin: 0; padding: 0; display: none;} .repoCode tr.over .comment-btn {display: block;} -.comment-btn .icon-wrapper {display: block; position: absolute; background: #4183C4; border-radius: 2px; width: 24px; height: 20px; left: -6px; top: 0; line-height: 20px; text-align: center; color: #fff; cursor: pointer; transition: transform 0.2s;} +.comment-btn .icon-wrapper {display: block; position: absolute; background: #4183C4; border-radius: 2px; width: 24px; height: 20px; left: -6px; top: -2; line-height: 20px; text-align: center; color: #fff; cursor: pointer; transition: transform 0.2s;} .comment-btn .icon-wrapper:before {display: block; content: ' '; right: -4px; top: 6px; position: absolute; border-left: 4px solid #4183C4; border-right: 0 solid transparent; border-bottom: 4px solid transparent; border-top: 4px solid transparent; width: 0; height: 0;} .comment-btn .icon-wrapper:hover {background: #169; transform: scale(1.1);} .comment-btn .icon-wrapper:hover:before {border-left-color: #169;} @@ -84,8 +83,7 @@ h3 {font-size: 16px;} .repoCode tr.commented .comment-btn .icon-wrapper:before {display: none;} .repoCode tr.over.commented .comment-btn {margin-left: -20px; width: 25px; height:18px;} -.repoCode tr.over.commented .comment-btn .icon-wrapper, .repoCode tr.selected.commented .comment-btn .icon-wrapper {line-height: 20px; height: 20px; background: #4183C4; color: #fff; left: -6px;} -.repoCode tr.over.commented .comment-btn .icon-wrapper {left: 13px;} +.repoCode tr.over.commented .comment-btn .icon-wrapper, .repoCode tr.selected.commented .comment-btn .icon-wrapper {line-height: 20px; height: 20px; background: #4183C4; color: #fff; left: -8px;} .repoCode tr.over.commented .comment-btn .icon-wrapper > i:before {font-size: 14px;} .repoCode tr.selected.commented .comment-btn .icon-wrapper > i:before {font-size: 14px;} .repoCode tr.over.commented .comment-btn .icon-wrapper:before, .repoCode tr.selected.commented .comment-btn .icon-wrapper:before {display: block;} @@ -190,4 +188,7 @@ h3 {font-size: 16px;} .header-btn .btn > .text {text-overflow: unset !important;} -#repoPageSize {right: 90px;} +#repoPageSize {right: 90px; padding: 8px 5px 6px 10px;} +.dropdown-menu li > a.selected {color: #3123ae !important; background: #f2eafc !important; line-height: 20px; border-radius: 5px;} + +.tips-git a {padding-bottom: 1px;} diff --git a/module/repo/css/diff.css b/module/repo/css/diff.css index c35af3a9d7..7124f55959 100644 --- a/module/repo/css/diff.css +++ b/module/repo/css/diff.css @@ -9,9 +9,9 @@ table.diff {margin-bottom: 0px;} .diff .line-new, .diff .line-new {background: #CFC;} .diff .line-old, .diff .line-old {background: #FCC;} .diff .line-all, .diff .line-all {background: #FFF;} -.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; color: #999; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal;} +.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; background: #fafafa; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal;} -.repoCode .diff tr .comment-btn .icon-wrapper {left: -23px;} +.repoCode .diff tr .comment-btn .icon-wrapper {left: -30px;} .repoCode .diff tr.over td.line-all, .repoCode .diff tr.over td.line-all {background: #f8eec7;} .repoCode .diff tr.over td.line-new, .repoCode .diff tr.over td.line-new {background: #8eff8e;} .repoCode .diff tr.over td.line-old, .repoCode .diff tr.over td.line-old {background: #f6b2b2;} @@ -22,3 +22,5 @@ table.diff {margin-bottom: 0px;} .btn-download {border-right: none;} .body-modal .repo-diff {display: none;} .body-modal #mainMenu {padding-bottom: 40px;} + +.repoCode td.code {white-space: inherit;} diff --git a/module/repo/css/log.css b/module/repo/css/log.css index e69de29bb2..841e94940e 100644 --- a/module/repo/css/log.css +++ b/module/repo/css/log.css @@ -0,0 +1 @@ +.m-repo-log .btn-back {margin-right: 0; padding-top: 8px;} diff --git a/module/repo/css/revision.css b/module/repo/css/revision.css index d6154798fc..a4ea875752 100644 --- a/module/repo/css/revision.css +++ b/module/repo/css/revision.css @@ -1,3 +1,5 @@ .change ul {margin: 8px; margin-left: 1.5em;} .change li {list-style: none;} .panel-heading {border-bottom: 1px solid #ddd;} +.back-btn {margin-right: 5px !important;} +.compare-all {top: 0 !important;} diff --git a/module/repo/css/view.css b/module/repo/css/view.css index c82dcbb9b2..fff9103dcd 100644 --- a/module/repo/css/view.css +++ b/module/repo/css/view.css @@ -2,7 +2,7 @@ .code .content {border: 1px solid #CCC; padding: 0;} .repoCode pre {margin: 0; padding: 0; background: white; border: none;} tr,th,td {border-bottom: none;} -.repoCode pre > table > tbody > tr > th {border: none; background-color: #ECECEC; width: 40px; text-align: right; vertical-align: top;} +.repoCode pre > table > tbody > tr > th {border-right: 1px solid #E4E4E4; background: #fafafa; color: #999; width: 40px; text-align: right; vertical-align: top;} .repoCode pre > table > tbody > tr > th, .repoCode pre > table > tbody > tr > td {padding: 1px 3px;} .repoCode pre .commentContent {line-height: 1.4;} .repoCode pre > table {border: 0px; width: 100%;} @@ -14,4 +14,4 @@ tr,th,td {border-bottom: none;} .body-modal .panel-actions {right: 30px;} .icon-angle-left {transform: rotateY(180deg);} #main {padding: 20px 0;} -#sidebar > .side-body {width: 560px;} +.m-repo-view .btn-toolbar .btn-link {margin-right: 0; padding-top: 8px;} diff --git a/module/repo/js/browse.js b/module/repo/js/browse.js index 0dcfbce1f0..48089f654d 100644 --- a/module/repo/js/browse.js +++ b/module/repo/js/browse.js @@ -36,7 +36,7 @@ function getCloneHtml(cloneLang, url) { var content = ''; content += ""; - content += "" + cloneLang + ""; + content += "" + cloneLang + ""; content += ""; content += ""; content += ""; @@ -47,13 +47,21 @@ function getCloneHtml(cloneLang, url) $(function() { + /* Hide popover tip. */ + $(document).on('mousedown', function(e) + { + var $target = $(e.target); + var $toggle = $target.closest('.popover, #downloadCode'); + if(!$toggle.length) $('#downloadCode').popover('hide'); + }); + /* Init popover. */ var options = { container: 'body', content: getDownload(), html: true, placement: 'bottom', - template: '

repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; $lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = 'Git'; $lang->repo->scmList['Subversion'] = 'SVN'; @@ -149,6 +150,9 @@ $lang->repo->gitlabHost = 'GitLab Host'; $lang->repo->gitlabToken = 'GitLab Token'; $lang->repo->gitlabProject = 'Project'; +$lang->repo->serviceHost = 'Host'; +$lang->repo->serviceProject = 'Project'; + $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; @@ -195,6 +199,7 @@ $lang->repo->error->linkedJob = "Deletion of the repository failed. The curr $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; $lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.'; +$lang->repo->error->noCloneAddr = 'The repository clone address was not found'; $lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; $lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8."; diff --git a/module/repo/lang/en.php b/module/repo/lang/en.php index 62ab96d159..5d9b5bbd87 100644 --- a/module/repo/lang/en.php +++ b/module/repo/lang/en.php @@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; $lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = 'Git'; $lang->repo->scmList['Subversion'] = 'SVN'; @@ -149,6 +150,9 @@ $lang->repo->gitlabHost = 'GitLab Host'; $lang->repo->gitlabToken = 'GitLab Token'; $lang->repo->gitlabProject = 'Project'; +$lang->repo->serviceHost = 'Host'; +$lang->repo->serviceProject = 'Project'; + $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; @@ -195,6 +199,7 @@ $lang->repo->error->linkedJob = "Deletion of the repository failed. The curr $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; $lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.'; +$lang->repo->error->noCloneAddr = 'The repository clone address was not found'; $lang->repo->syncTips = 'You may find the reference about how to set Git sync from here.'; $lang->repo->encodingsTips = "The encodings of comments can be comma separated values, e.g. utf-8."; diff --git a/module/repo/lang/fr.php b/module/repo/lang/fr.php index 160d388e3f..ff2f8c8246 100644 --- a/module/repo/lang/fr.php +++ b/module/repo/lang/fr.php @@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; $lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = 'Git'; $lang->repo->scmList['Subversion'] = 'Subversion'; @@ -149,6 +150,9 @@ $lang->repo->gitlabHost = 'GitLab Host'; $lang->repo->gitlabToken = 'GitLab Token'; $lang->repo->gitlabProject = 'Project'; +$lang->repo->serviceHost = 'Host'; +$lang->repo->serviceProject = 'Project'; + $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; @@ -195,6 +199,7 @@ $lang->repo->error->linkedJob = "Deletion of the repository failed. The curr $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; $lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.'; +$lang->repo->error->noCloneAddr = 'The repository clone address was not found'; $lang->repo->syncTips = 'Vous pouvez trouver la référence sur la façon de définir la synchronisation Git à partir de la page se trouvant ici.'; $lang->repo->encodingsTips = "Les encodages des commentaires de validation peuvent être des valeurs séparées par des virgules,ex: utf-8"; diff --git a/module/repo/lang/vi.php b/module/repo/lang/vi.php index 01a694336e..16eb83b534 100644 --- a/module/repo/lang/vi.php +++ b/module/repo/lang/vi.php @@ -57,48 +57,52 @@ $lang->repo->line = 'Dòng'; $lang->repo->expand = 'Mở ra'; $lang->repo->collapse = 'Gấp lại'; -$lang->repo->id = 'ID'; -$lang->repo->SCM = 'Loại'; -$lang->repo->name = 'Tên'; -$lang->repo->path = 'Đường dẫn'; -$lang->repo->prefix = 'Prefix'; -$lang->repo->config = 'Cấu hình'; -$lang->repo->desc = 'Mô tả'; -$lang->repo->account = 'Người dùng'; -$lang->repo->password = 'Mật khẩu'; -$lang->repo->encoding = 'Encoding'; -$lang->repo->client = 'Client Path'; -$lang->repo->size = 'Size'; -$lang->repo->revision = 'Revision'; -$lang->repo->revisionA = 'Revision'; -$lang->repo->revisions = 'Revision'; -$lang->repo->time = 'Ngày'; -$lang->repo->committer = 'Committer'; -$lang->repo->commits = 'Commits'; -$lang->repo->synced = 'Khởi tạo đồng bộ'; -$lang->repo->lastSync = 'Last Sync'; -$lang->repo->deleted = 'Đã xóa'; -$lang->repo->commit = 'Giao phó'; -$lang->repo->comment = 'Nhận xét'; -$lang->repo->view = 'Xem File'; -$lang->repo->viewA = 'Xem'; -$lang->repo->log = 'Revision nhật ký'; -$lang->repo->blame = 'Blame'; -$lang->repo->date = 'Ngày'; -$lang->repo->diff = 'Diff'; -$lang->repo->diffAB = 'Diff'; -$lang->repo->diffAll = 'Diff tất cả'; -$lang->repo->viewDiff = 'Xem diff'; -$lang->repo->allLog = 'Tất cả Revisions'; -$lang->repo->location = 'Vị trí'; -$lang->repo->file = 'File'; -$lang->repo->action = 'Hành động'; -$lang->repo->code = 'Mã'; -$lang->repo->review = 'Repo duyệt'; -$lang->repo->acl = 'Phân quyền'; -$lang->repo->group = 'Nhóm'; -$lang->repo->user = 'Người dùng'; -$lang->repo->info = 'Thông tin phiên bản'; +$lang->repo->id = 'ID'; +$lang->repo->SCM = 'Loại'; +$lang->repo->name = 'Tên'; +$lang->repo->path = 'Đường dẫn'; +$lang->repo->prefix = 'Prefix'; +$lang->repo->config = 'Cấu hình'; +$lang->repo->desc = 'Mô tả'; +$lang->repo->account = 'Người dùng'; +$lang->repo->password = 'Mật khẩu'; +$lang->repo->encoding = 'Encoding'; +$lang->repo->client = 'Client Path'; +$lang->repo->size = 'Size'; +$lang->repo->revision = 'Revision'; +$lang->repo->revisionA = 'Revision'; +$lang->repo->revisions = 'Revision'; +$lang->repo->time = 'Ngày'; +$lang->repo->committer = 'Committer'; +$lang->repo->commits = 'Commits'; +$lang->repo->synced = 'Khởi tạo đồng bộ'; +$lang->repo->lastSync = 'Last Sync'; +$lang->repo->deleted = 'Đã xóa'; +$lang->repo->commit = 'Giao phó'; +$lang->repo->comment = 'Nhận xét'; +$lang->repo->view = 'Xem File'; +$lang->repo->viewA = 'Xem'; +$lang->repo->log = 'Revision nhật ký'; +$lang->repo->blame = 'Blame'; +$lang->repo->date = 'Ngày'; +$lang->repo->diff = 'Diff'; +$lang->repo->diffAB = 'Diff'; +$lang->repo->diffAll = 'Diff tất cả'; +$lang->repo->viewDiff = 'Xem diff'; +$lang->repo->allLog = 'Tất cả Revisions'; +$lang->repo->location = 'Vị trí'; +$lang->repo->file = 'File'; +$lang->repo->action = 'Hành động'; +$lang->repo->code = 'Mã'; +$lang->repo->review = 'Repo duyệt'; +$lang->repo->acl = 'Phân quyền'; +$lang->repo->group = 'Nhóm'; +$lang->repo->user = 'Người dùng'; +$lang->repo->info = 'Thông tin phiên bản'; +$lang->repo->job = 'Job'; +$lang->repo->fileServerUrl = 'File Server Url'; +$lang->repo->fileServerAccount = 'File Server Account'; +$lang->repo->fileServerPassword = 'File Server Password'; $lang->repo->title = 'Tiêu đề'; $lang->repo->status = 'Tình trạng'; @@ -137,9 +141,21 @@ $lang->repo->logStyles['D'] = 'Xóa'; $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; +$lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = 'Git'; $lang->repo->scmList['Subversion'] = 'SVN'; +$lang->repo->gitlabHost = 'GitLab Host'; +$lang->repo->gitlabToken = 'GitLab Token'; +$lang->repo->gitlabProject = 'Project'; + +$lang->repo->serviceHost = 'Host'; +$lang->repo->serviceProject = 'Project'; + +$lang->repo->placeholder = new stdclass; +$lang->repo->placeholder->gitlabHost = 'Input url of gitlab'; + $lang->repo->notice = new stdclass(); $lang->repo->notice->syncing = 'Đang đồng bộ. Vui lòng đợi ...'; $lang->repo->notice->syncComplete = 'Synchronized. Now redirecting ...'; @@ -147,6 +163,7 @@ $lang->repo->notice->syncedCount = 'The number of records synchronized is '; $lang->repo->notice->delete = 'Bạn có muốn xóa this repo?'; $lang->repo->notice->successDelete = 'Repository is removed.'; $lang->repo->notice->commentContent = 'Nhận xét'; +$lang->repo->notice->deleteReview = 'Do you want to delete this review?'; $lang->repo->notice->deleteBug = 'Bạn có muốn xóa bug này?'; $lang->repo->notice->deleteComment = 'Bạn có muốn xóa this comment?'; $lang->repo->notice->lastSyncTime = 'Last Sync:'; @@ -178,11 +195,15 @@ $lang->repo->error->output = "The command is: %s\nThe error is(%s): %s\n" $lang->repo->error->clientVersion = "Client version is too low, please upgrade or change SVN client"; $lang->repo->error->encoding = "The encoding maybe wrong. Vui lòng change the encoding and try again."; $lang->repo->error->deleted = "Deletion of the repository failed. The current repository has a commit record associated with the design."; +$lang->repo->error->linkedJob = "Deletion of the repository failed. The current repository has associated with the Compile."; $lang->repo->error->clientPath = "The client installation directory cannot have spaces!"; +$lang->repo->error->notFound = "The repository %s’s URL %s does not exist. Please confirm if this repository has been deleted from the local server."; $lang->repo->error->noWritable = '%s is not writable! Please check the privilege, or download will not be done.'; +$lang->repo->error->noCloneAddr = 'The repository clone address was not found'; -$lang->repo->syncTips = 'Bạn có thể tìm tham khảo làm sao thiết lập đồng bộ Git từ here.'; -$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated values,ví dụ: utf-8"; +$lang->repo->syncTips = 'Bạn có thể tìm tham khảo làm sao thiết lập đồng bộ Git từ here.'; +$lang->repo->encodingsTips = "The encodings of commit comments, can be comma separated values,ví dụ: utf-8"; +$lang->repo->pathTipsForGitlab = "GitLab Project URL"; $lang->repo->example = new stdclass(); $lang->repo->example->client = new stdclass(); diff --git a/module/repo/lang/zh-cn.php b/module/repo/lang/zh-cn.php index 964d445042..f94930c892 100644 --- a/module/repo/lang/zh-cn.php +++ b/module/repo/lang/zh-cn.php @@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; $lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = '本地 Git'; $lang->repo->scmList['Subversion'] = 'Subversion'; @@ -149,6 +150,9 @@ $lang->repo->gitlabHost = 'GitLab Server'; $lang->repo->gitlabToken = 'GitLab Token'; $lang->repo->gitlabProject = 'GitLab 项目'; +$lang->repo->serviceHost = '服务器'; +$lang->repo->serviceProject = '仓库'; + $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = '请填写GitLab访问地址'; @@ -195,6 +199,7 @@ $lang->repo->error->linkedJob = "删除代码库失败,当前代码库与 $lang->repo->error->clientPath = "客户端安装目录不能有空格!"; $lang->repo->error->notFound = "代码库『%s』路径 %s 不存在,请确认此代码库是否已在本地服务器被删除"; $lang->repo->error->noWritable = '%s 不可写!请检查该目录权限,否则无法下载。'; +$lang->repo->error->noCloneAddr = '该项目克隆地址未找到'; $lang->repo->syncTips = '请参照这里,设置代码库定时同步。'; $lang->repo->encodingsTips = "提交日志的编码,可以用逗号连接起来的多个,比如utf-8。"; diff --git a/module/repo/lang/zh-tw.php b/module/repo/lang/zh-tw.php index 839ae5e4b0..9811b114f1 100644 --- a/module/repo/lang/zh-tw.php +++ b/module/repo/lang/zh-tw.php @@ -135,6 +135,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8'; $lang->repo->encodingList['gbk'] = 'GBK'; $lang->repo->scmList['Gitlab'] = 'GitLab'; +$lang->repo->scmList['Gitea'] = 'Gitea'; $lang->repo->scmList['Git'] = '本地 Git'; $lang->repo->scmList['Subversion'] = 'Subversion'; @@ -142,6 +143,9 @@ $lang->repo->gitlabHost = 'GitLab Server'; $lang->repo->gitlabToken = 'GitLab Token'; $lang->repo->gitlabProject = 'GitLab 項目'; +$lang->repo->serviceHost = '服务器'; +$lang->repo->serviceProject = '仓库'; + $lang->repo->placeholder = new stdclass; $lang->repo->placeholder->gitlabHost = '請填寫GitLab訪問地址'; diff --git a/module/repo/model.php b/module/repo/model.php index fc8e128802..817276d1e8 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -38,6 +38,9 @@ class repoModel extends model if(empty($repoID)) $repoID = $this->session->repoID ? $this->session->repoID : key($repos); if(!isset($repos[$repoID])) $repoID = key($repos); + /* Init switcher menu. */ + $this->lang->switcherMenu = ''; + /* Check the privilege. */ if($repoID) { @@ -54,7 +57,7 @@ class repoModel extends model return print(js::locate('back')); } - if($repo->SCM != 'Gitlab') unset($this->lang->devops->menu->mr); + if(!in_array(strtolower($repo->SCM), $this->config->repo->gitServiceList)) unset($this->lang->devops->menu->mr); $this->lang->switcherMenu = $this->getSwitcher($repoID); } @@ -119,7 +122,8 @@ class repoModel extends model $productIdList = $this->loadModel('product')->getProductIDByProject($projectID, false); foreach($repos as $i => $repo) { - $repo->acl = json_decode($repo->acl); + $repo->acl = json_decode($repo->acl); + $repo->codePath = $repo->path; if(!$this->checkPriv($repo)) { unset($repos[$i]); @@ -138,7 +142,7 @@ class repoModel extends model } } - if($repo->SCM == 'Gitlab') $repo = $this->processGitlab($repo); + if(in_array(strtolower($repo->SCM), $this->config->repo->gitServiceList)) $repo = $this->processGitService($repo); } return $repos; @@ -163,9 +167,10 @@ class repoModel extends model foreach($repos as $i => $repo) { if($repo->encrypt == 'base64') $repo->password = base64_decode($repo->password); - $repo->acl = json_decode($repo->acl); + $repo->acl = json_decode($repo->acl); + $repo->codePath = $repo->path; if($type == 'haspriv' and !$this->checkPriv($repo)) unset($repos[$i]); - if(strtolower($repo->SCM) == 'gitlab') $repo = $this->processGitlab($repo); + if(in_array(strtolower($repo->SCM), $this->config->repo->gitServiceList)) $repo = $this->processGitService($repo); } return $repos; @@ -182,19 +187,20 @@ class repoModel extends model if(!$this->checkClient()) return false; if(!$this->checkConnection()) return false; - if($this->post->SCM == 'Gitlab') + $isPipelineServer = in_array(strtolower($this->post->SCM), $this->config->repo->gitServiceList) ? true : false; + if($isPipelineServer) { - if($this->post->gitlabHost == '') dao::$errors['gitlabHost'] = sprintf($this->lang->error->notempty, $this->lang->repo->gitlabHost); - if($this->post->gitlabProject == '') dao::$errors['gitlabProject'] = sprintf($this->lang->error->notempty, $this->lang->repo->gitlabProject); + if($this->post->serviceHost == '') dao::$errors['serviceHost'] = sprintf($this->lang->error->notempty, $this->lang->repo->serviceHost); + if($this->post->serviceProject == '') dao::$errors['serviceProject'] = sprintf($this->lang->error->notempty, $this->lang->repo->serviceProject); if(dao::isError()) return false; } $data = fixer::input('post') - ->setIf($this->post->SCM == 'Gitlab', 'password', $this->post->gitlabToken) - ->setIf($this->post->SCM == 'Gitlab', 'path', $this->post->gitlabProject) - ->setIf($this->post->SCM == 'Gitlab', 'client', $this->post->gitlabHost) - ->setIf($this->post->SCM == 'Gitlab', 'extra', $this->post->gitlabProject) - ->setIf($this->post->SCM == 'Gitlab', 'prefix', '') + ->setIf($isPipelineServer, 'password', $this->post->serviceToken) + ->setIf($isPipelineServer and $this->post->SCM == 'Gitlab', 'path', '') + ->setIf($isPipelineServer and $this->post->SCM == 'Gitlab', 'client', '') + ->setIf($isPipelineServer, 'extra', $this->post->serviceProject) + ->setIf($isPipelineServer, 'prefix', '') ->setIf($this->post->SCM == 'Git', 'account', '') ->setIf($this->post->SCM == 'Git', 'password', '') ->skipSpecial('path,client,account,password') @@ -202,14 +208,14 @@ class repoModel extends model ->join('product', ',') ->get(); - if($this->post->SCM == 'Gitlab') + if($isPipelineServer) { $repo = $this->dao->select('id')->from(TABLE_REPO) - ->where('SCM')->eq('Gitlab') - ->andWhere('client')->eq($data->client) - ->andWhere('path')->eq($data->path) + ->where('SCM')->eq($this->post->SCM) + ->andWhere('serviceHost')->eq($data->client) + ->andWhere('serviceProject')->eq($data->path) ->fetch(); - if(!empty($repo)) dao::$errors['gitlabProject'] = sprintf($this->lang->error->unique, $this->lang->repo->gitlabProject, $repo->id); + if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->name); if(dao::isError()) return false; } @@ -226,10 +232,12 @@ class repoModel extends model } if($data->encrypt == 'base64') $data->password = base64_encode($data->password); - $this->dao->insert(TABLE_REPO)->data($data, $skip = 'gitlabHost,gitlabToken,gitlabProject') + $this->dao->insert(TABLE_REPO)->data($data, $skip = 'serviceToken') ->batchCheck($this->config->repo->create->requiredFields, 'notempty') - ->checkIF($data->SCM == 'Gitlab', 'gitlabProject', 'notempty') + ->checkIF($data->SCM != 'Gitlab', 'path,client', 'notempty') + ->checkIF($isPipelineServer, 'serviceHost,serviceProject', 'notempty') ->checkIF($data->SCM == 'Subversion', $this->config->repo->svn->requiredFields, 'notempty') + ->checkIF($data->SCM == 'Gitea', $this->config->repo->gitea->requiredFields, 'notempty') ->checkIF($data->SCM == 'Git', 'path', 'unique', "`SCM` = 'Git'") ->checkIF($data->SCM == 'Subversion', 'path', 'unique', "`SCM` = 'Subversion'") ->autoCheck() @@ -262,17 +270,18 @@ class repoModel extends model { $repo = $this->getRepoByID($id); - if($this->post->SCM == 'Gitlab') + $isPipelineServer = in_array(strtolower($this->post->SCM), $this->config->repo->gitServiceList) ? true : false; + if($isPipelineServer) { - if($this->post->gitlabHost == '') dao::$errors['gitlabHost'] = sprintf($this->lang->error->notempty, $this->lang->repo->gitlabHost); - if($this->post->gitlabProject == '') dao::$errors['gitlabProject'] = sprintf($this->lang->error->notempty, $this->lang->repo->gitlabProject); + if($this->post->serviceHost == '') dao::$errors['serviceHost'] = sprintf($this->lang->error->notempty, $this->lang->repo->serviceHost); + if($this->post->serviceProject == '') dao::$errors['serviceProject'] = sprintf($this->lang->error->notempty, $this->lang->repo->serviceProject); } $data = fixer::input('post') - ->setIf($this->post->SCM == 'Gitlab', 'password', $this->post->gitlabToken) - ->setIf($this->post->SCM == 'Gitlab', 'path', $this->post->gitlabProject) - ->setIf($this->post->SCM == 'Gitlab', 'client', $this->post->gitlabHost) - ->setIf($this->post->SCM == 'Gitlab', 'extra', $this->post->gitlabProject) + ->setIf($isPipelineServer, 'password', $this->post->serviceToken) + ->setIf($isPipelineServer and $this->post->SCM == 'Gitlab', 'path', '') + ->setIf($isPipelineServer and $this->post->SCM == 'Gitlab', 'client', '') + ->setIf($isPipelineServer, 'extra', $this->post->serviceProject) ->setDefault('prefix', $repo->prefix) ->setIf($this->post->SCM == 'Gitlab', 'prefix', '') ->setDefault('client', 'svn') @@ -299,15 +308,15 @@ class repoModel extends model $data->prefix = ''; } - if($this->post->SCM == 'Gitlab') + if($isPipelineServer) { $repo = $this->dao->select('id')->from(TABLE_REPO) - ->where('SCM')->eq('Gitlab') - ->andWhere('client')->eq($data->client) - ->andWhere('path')->eq($data->path) + ->where('SCM')->eq($this->post->SCM) + ->andWhere('serviceHost')->eq($data->client) + ->andWhere('serviceProject')->eq($data->path) ->andWhere('id')->ne($id) ->fetch(); - if(!empty($repo)) dao::$errors['gitlabProject'] = sprintf($this->lang->error->unique, $this->lang->repo->gitlabProject, $repo->id); + if(!empty($repo)) dao::$errors['serviceProject'] = sprintf($this->lang->error->unique, $this->lang->repo->serviceProject, $repo->name); if(dao::isError()) return false; } @@ -315,8 +324,9 @@ class repoModel extends model if(!$this->checkConnection()) return false; if($data->encrypt == 'base64') $data->password = base64_encode($data->password); - $this->dao->update(TABLE_REPO)->data($data, $skip = 'gitlabHost,gitlabToken,gitlabProject') + $this->dao->update(TABLE_REPO)->data($data, $skip = 'serviceToken') ->batchCheck($this->config->repo->edit->requiredFields, 'notempty') + ->checkIF($data->SCM != 'Gitlab', 'path,client', 'notempty') ->checkIF($data->SCM == 'Subversion', $this->config->repo->svn->requiredFields, 'notempty') ->checkIF($data->SCM == 'Gitlab', 'extra', 'notempty') ->checkIF($data->SCM == 'Git', 'path', 'unique', "`SCM` = 'Git' and `id` <> $id") @@ -416,10 +426,8 @@ class repoModel extends model { $repoPairs = $this->getRepoPairs($type, $projectID); - $repos = array(); - $repos['Gitlab'] = array(); - $repos['SVN'] = array(); - $repos['Git'] = array(); + $repos = array(); + foreach($this->lang->repo->scmList as $scmType => $scm) $repos[$scmType] = array(); foreach($repoPairs as $id => $repo) { @@ -428,6 +436,11 @@ class repoModel extends model $repo = str_replace('[gitlab]', '', $repo); $repos['Gitlab'][$id] = $repo; } + if(strpos($repo, '[gitea]') !== false) + { + $repo = str_replace('[gitea]', '', $repo); + $repos['Gitea'][$id] = $repo; + } if(strpos($repo, '[svn]') !== false) { $repo = str_replace('[svn]', '', $repo); @@ -455,7 +468,8 @@ class repoModel extends model if(!$repo) return false; if($repo->encrypt == 'base64') $repo->password = base64_decode($repo->password); - if(strtolower($repo->SCM) == 'gitlab') $repo = $this->processGitlab($repo); + $repo->codePath = $repo->path; + if(in_array(strtolower($repo->SCM), $this->config->repo->gitServiceList)) $repo = $this->processGitService($repo); $repo->acl = json_decode($repo->acl); return $repo; } @@ -882,14 +896,17 @@ class repoModel extends model { $commitID = $this->dao->lastInsertID(); if($branch) $this->dao->replace(TABLE_REPOBRANCH)->set('repo')->eq($repoID)->set('revision')->eq($commitID)->set('branch')->eq($branch)->exec(); - foreach($logs['files'][$i] as $file) + if(!empty($logs['files'])) { - $parentPath = dirname($file->path); + foreach($logs['files'][$i] as $file) + { + $parentPath = dirname($file->path); - $file->parent = $parentPath == '\\' ? '/' : $parentPath; - $file->revision = $commitID; - $file->repo = $repoID; - $this->dao->insert(TABLE_REPOFILES)->data($file)->exec(); + $file->parent = $parentPath == '\\' ? '/' : $parentPath; + $file->revision = $commitID; + $file->repo = $repoID; + $this->dao->insert(TABLE_REPOFILES)->data($file)->exec(); + } } $revisionPairs[$commit->revision] = $commit->revision; $version++; @@ -1398,6 +1415,28 @@ class repoModel extends model return false; } } + elseif($scm == 'Gitea') + { + if($this->post->name != '' and $this->post->serviceProject != '') + { + $project = $this->loadModel('gitea')->apiGetSingleProject($this->post->serviceHost, $this->post->serviceProject); + if(isset($project->tokenCloneUrl)) + { + $path = dirname(dirname(dirname(__FILE__))) . '/tmp/repo/' . $this->post->name . '_gitea'; + if(!realpath($path)) + { + $cmd = 'git clone --progress -v "' . $project->tokenCloneUrl . '" "' . $path . '"'; + exec($cmd); + } + $_POST['path'] = $path; + } + else + { + dao::$errors['serviceProject'] = $this->lang->repo->error->noCloneAddr; + return false; + } + } + } elseif($scm == 'Git') { if(!is_dir($path)) @@ -2016,21 +2055,30 @@ class repoModel extends model } /** - * Process gitlab repo. + * Process git service repo. * * @param object $repo * @access public * @return object */ - public function processGitlab($repo) + public function processGitService($repo) { - $gitlab = $this->loadModel('gitlab')->getByID($repo->client); // The $repo->client is gitlabID. + $service = $this->loadModel('pipeline')->getByID($repo->serviceHost); + if($repo->SCM == 'Gitlab') + { + $project = $this->loadModel('gitlab')->apiGetSingleProject($repo->serviceHost, $repo->serviceProject); - $repo->gitlab = $gitlab ? $gitlab->id : 0; - $repo->project = $gitlab ? $repo->path : ''; // The projectID in gitlab. - $repo->path = $gitlab ? sprintf($this->config->repo->gitlab->apiPath, $gitlab->url, $repo->path) : ''; - $repo->client = $gitlab ? $gitlab->url : ''; - $repo->password = $gitlab ? $gitlab->token : ''; + $repo->path = $service ? sprintf($this->config->repo->{$service->type}->apiPath, $service->url, $repo->serviceProject) : ''; + $repo->client = $service ? $service->url : ''; + $repo->password = $service ? $service->token : ''; + $repo->codePath = $project ? $project->web_url : $repo->path; + } + elseif($repo->SCM == 'Gitea') + { + $repo->codePath = $service ? "{$service->url}/{$repo->serviceProject}" : $repo->path; + } + $repo->gitService = $repo->serviceHost; + $repo->project = $repo->serviceProject; return $repo; } @@ -2041,13 +2089,12 @@ class repoModel extends model * @param int $projectID * @return array */ - public function getGitLabRepoList($gitlabID, $projectID = 0) + public function getRepoListByClient($gitlabID, $projectID = 0) { return $this->dao->select('*')->from(TABLE_REPO)->where('deleted')->eq('0') - ->andWhere('SCM')->eq('Gitlab') ->andWhere('synced')->eq(1) - ->andWhere('client')->eq($gitlabID) - ->beginIF($projectID)->andWhere('path')->eq($projectID)->fi() + ->andWhere('serviceHost')->eq($gitlabID) + ->beginIF($projectID)->andWhere('serviceProject')->eq($projectID)->fi() ->fetchAll(); } @@ -2151,13 +2198,22 @@ class repoModel extends model } elseif($repo->SCM == 'Gitlab') { - $project = $this->loadModel('gitlab')->apiGetSingleProject($repo->gitlab, $repo->project); + $project = $this->loadModel('gitlab')->apiGetSingleProject($repo->gitService, $repo->project); if(isset($project->id)) { $url->http = $project->http_url_to_repo; $url->ssh = $project->ssh_url_to_repo; } } + elseif($repo->SCM == 'Gitea') + { + $project = $this->loadModel('gitea')->apiGetSingleProject($repo->gitService, $repo->project); + if(isset($project->id)) + { + $url->http = $project->clone_url; + $url->ssh = $project->ssh_url; + } + } else { $this->scm = $this->app->loadClass('scm'); diff --git a/module/repo/view/ajaxgetdropmenu.html.php b/module/repo/view/ajaxgetdropmenu.html.php index 1e6a0b1899..74fb4b2a48 100644 --- a/module/repo/view/ajaxgetdropmenu.html.php +++ b/module/repo/view/ajaxgetdropmenu.html.php @@ -23,7 +23,6 @@ #dropMenu {margin: 0;} #dropMenu ul > li > ul > li > a:hover {color: white; background-color: #0c64eb; text-decoration: none;} #dropMenu .tree .has-list > ul > li {padding-top: 0;} -li > a.selected {color: #3123ae !important; background: #f2eafc !important; line-height: 20px; border-radius: 5px;} .search-list .list-group {padding: 7px 10px;} #swapper li>div.hide-in-search>a:focus, #swapper li>div.hide-in-search>a:hover {color: #838a9d; cursor: default;} #dropMenu .label-type {margin: 1px 10px;} diff --git a/module/repo/view/ajaxsidecommits.html.php b/module/repo/view/ajaxsidecommits.html.php index 43e29ac258..6321a9f742 100644 --- a/module/repo/view/ajaxsidecommits.html.php +++ b/module/repo/view/ajaxsidecommits.html.php @@ -15,11 +15,11 @@ $pathInfo = '&root=' . $this->repo->encodePath(empty($path) ? '/' : $path); if(isset($entry)) $pathInfo .= '&type=file'; ?> repo->encodePath($path) . "&objectID=$objectID&type=$logType");?> -
+ - + SCM != 'Subversion'):?> diff --git a/module/repo/view/browse.html.php b/module/repo/view/browse.html.php index 7fbff43146..11ead84c3d 100644 --- a/module/repo/view/browse.html.php +++ b/module/repo/view/browse.html.php @@ -96,9 +96,8 @@
repo->revisionA?> repo->commit?>
- - + @@ -108,17 +107,15 @@ name)) continue;?> - - + comment, ENT_QUOTES);?> diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index 0c7b890b18..298d1b935f 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -32,20 +32,20 @@ - - - + + + - - - + + + - + - + - + - + - - diff --git a/module/repo/view/diff.html.php b/module/repo/view/diff.html.php index f867a31e32..5bff77e99f 100644 --- a/module/repo/view/diff.html.php +++ b/module/repo/view/diff.html.php @@ -101,8 +101,8 @@ lines as $line):?> - - + + + - + - - - + + + - - - + + + - + - + - + - + - - diff --git a/module/repo/view/maintain.html.php b/module/repo/view/maintain.html.php index c3fb93bb70..7dfebcc968 100644 --- a/module/repo/view/maintain.html.php +++ b/module/repo/view/maintain.html.php @@ -12,7 +12,10 @@ ?> - + - + - + - + - + + + + + + + + + + + + + '; $list .= "'; $list .= ''; - $list .= ''; - $list .= ''; + $list .= helper::isZeroDate($task->estStarted) ? '' : ''; + if(!helper::isZeroDate($task->deadline)) + { + if($task->status != 'done') + { + $list .= strtotime($today) > strtotime($task->deadline) ? '' : ''; + } + else + { + $list .= ''; + } + } + else + { + $list .= ''; + } $list .= ''; $list .= ''; $list .= ''; @@ -3892,4 +3929,124 @@ class taskModel extends model return $menu; } + + /** + * Update estimate date by gantt. + * + * @param int $objectID + * @param string $objectType + * @access public + * @return bool + */ + public function updateEsDateByGantt($objectID, $objectType) + { + $this->app->loadLang('project'); + $post = fixer::input('post')->get(); + $post->endDate = date('Y-m-d', strtotime('-1 day', strtotime($post->endDate))); + if($objectType == 'task') + { + $objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch(); + $parent = $objectData->parent; + $project = $objectData->project; + $execution = $objectData->execution; + $stage = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($execution)->andWhere('project')->eq($project)->fetch(); + + if($parent <= 0) + { + $parentData = $stage; + + $start = $parentData->begin; + $end = $parentData->end; + } + else + { + $parentData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($parent)->fetch(); + + $start = helper::isZeroDate($parentData->estStarted) ? '' : $parentData->estStarted; + $end = helper::isZeroDate($parentData->deadline) ? '' : $parentData->deadline; + } + + if(helper::diffDate($start, $post->startDate) > 0) + { + $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; + return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); + } + + if(helper::diffDate($end, $post->endDate) < 0) + { + $arg = !empty($parent) ? $this->lang->task->parent : $this->lang->project->stage; + return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); + } + + $this->dao->update(TABLE_TASK) + ->set('estStarted')->eq($post->startDate) + ->set('deadline')->eq($post->endDate) + ->set('lastEditedBy')->eq($this->app->user->account) + ->where('id')->eq($objectID) + ->exec(); + } + elseif($objectType == 'plan') + { + $objectData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch(); + $parent = $objectData->parent; + $project = $objectData->project; + + if(empty($parent)) + { + $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($project)->fetch(); + } + else + { + $parentData = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($parent)->fetch(); + } + + $start = helper::isZeroDate($parentData->begin) ? '' : $parentData->begin; + $end = helper::isZeroDate($parentData->end) ? '' : $parentData->end; + + if(helper::diffDate($start, $post->startDate) > 0) + { + $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; + return dao::$errors = sprintf($this->lang->task->overEsStartDate, $arg, $arg); + } + + if(helper::diffDate($end, $post->endDate) < 0) + { + $arg = !empty($parent) ? $this->lang->programplan->parent : $this->lang->project->common; + return dao::$errors = sprintf($this->lang->task->overEsEndDate, $arg, $arg); + } + + $this->dao->update(TABLE_PROJECT) + ->set('begin')->eq($post->startDate) + ->set('end')->eq($post->endDate) + ->set('lastEditedBy')->eq($this->app->user->account) + ->where('id')->eq($objectID) + ->exec(); + } + else + { + return false; + } + + return true; + } + + /** + * Update order by gantt. + * + * @access public + * @return void + */ + public function updateOrderByGantt() + { + $data = fixer::input('post')->get(); + + $order = 1; + foreach($data->tasks as $task) + { + $idList = explode('-', $task); + $taskID = $idList[1]; + $this->dao->update(TABLE_TASK)->set('`order`')->eq($order)->where('id')->eq($taskID)->exec(); + $order ++; + } + } } diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 3dd6fba585..3792df783b 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -339,6 +339,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field) isINT) and class_exists('common')) ? common::convert2Pinyin($stories) : array());?> id);?> +type);?> diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index b1219baecd..ca510701c1 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -23,7 +23,6 @@ team);?> task->confirmChangeExecution);?> -team) < 6 ? 6 - count($task->team) : 1);?> task->error->teamMember);?> lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?> diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index f0732f48dd..738022e41e 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -16,13 +16,6 @@ - + - + - + - + - diff --git a/module/testcase/view/exporttemplet.html.php b/module/testcase/view/exporttemplate.html.php similarity index 95% rename from module/testcase/view/exporttemplet.html.php rename to module/testcase/view/exporttemplate.html.php index 337f3a89d7..e35384c8ab 100644 --- a/module/testcase/view/exporttemplet.html.php +++ b/module/testcase/view/exporttemplate.html.php @@ -21,7 +21,7 @@ function closeWindow()
-

testcase->exportTemplet;?>

+

testcase->exportTemplate;?>

diff --git a/module/testcase/view/showimport.html.php b/module/testcase/view/showimport.html.php index 44d00ea281..dc44da2ec5 100644 --- a/module/testcase/view/showimport.html.php +++ b/module/testcase/view/showimport.html.php @@ -1,195 +1,72 @@ - - - - -
- $this->config->file->maxImport):?> -
-
-

testcase->import;?>

-
-

file->importSummary, $allCount, html::input('maxImport', $config->file->maxImport, "style='width:50px'"), ceil($allCount / $config->file->maxImport));?>

-

import, "id='import'", 'btn btn-primary');?>

-
- - +getModuleRoot() . 'port/view/header.html.php';?>
-

testcase->import;?>

+

port->import;?>

- -
-
repo->name?>repo->revisions?>repo->revisions?> repo->time?> repo->committer?> repo->comment?>
- - - name, '/'); - $link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath)); - echo html::a($link, $info->name, '', "title='{$info->name}' data-app={$app->tab}"); - ?> + + name, '/'); + $link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&objectID=$objectID&entry=" . $this->repo->encodePath($infoPath)); + echo html::a($link, $info->name, '', "title='{$info->name}' data-app={$app->tab}"); + ?> SCM == 'Subversion' ? $info->revision : substr($info->revision, 0, 10);?>SCM == 'Subversion' ? $info->revision : substr($info->revision, 0, 10);?> date, 0, 10)?> account?> repo->scmList, 'Gitlab', "onchange='scmChanged(this.value)' class='form-control chosen'"); ?> repo->syncTips; ?>
repo->gitlabHost;?>repo->placeholder->gitlabHost}'");?>
repo->serviceHost;?>
repo->gitlabProject;?>
repo->serviceProject;?>
repo->name; ?>
repo->path; ?> @@ -58,7 +58,7 @@ repo->encodingsTips; ?>
repo->client;?> @@ -66,11 +66,11 @@ repo->example->client->svn;?>
+ goback, '', 'class="btn btn-wide"');?>
type != 'new') echo $line->oldlc?>type != 'old') echo $line->newlc?>type != 'new' and $line->oldlc) echo $line->oldlc?>type != 'old' and $line->newlc) echo $line->newlc?> line = $repo->SCM == 'Subversion' ? htmlSpecialString($line->line) : $line->line; echo $line->type == 'old' ? preg_replace('/^\-/', '–', $line->line) : ($line->type == 'new' ? $line->line : ' ' . $line->line); @@ -125,18 +125,18 @@ } else { - $oldlc = $line->oldlc; + $oldlc = $line->oldlc > 0 ? $line->oldlc : ' '; $newlc = $line->newlc; if(!isset($content->new[$newlc])) continue; } ?> - type?> type == 'custom') echo "line-old"?> code'>old[$oldlc])) $content->old[$oldlc] = ''; $content->old[$oldlc] = $repo->SCM == 'Subversion' ? htmlSpecialString($content->old[$oldlc]) : $content->old[$oldlc]; if(!empty($oldlc)) echo $line->type != 'all' ? preg_replace('/^\-/', '–', $content->old[$oldlc]) : ' ' . $content->old[$oldlc]; ?> type?> type == 'custom') echo "line-new"?> code'>new[$newlc])) $content->new[$newlc] = ''; $content->new[$newlc] = $repo->SCM == 'Subversion' ? htmlSpecialString($content->new[$newlc]) : $content->new[$newlc]; diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index efa6f3c76e..c19a57b702 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -36,20 +36,20 @@ repo->scmList, $repo->SCM, "onchange='scmChanged(this.value)' class='form-control chosen'"); ?> repo->syncTips; ?>
repo->gitlabHost;?>gitlab) ? $repo->gitlab : '', "class='form-control chosen' placeholder='{$lang->repo->placeholder->gitlabHost}'");?>
repo->serviceHost;?>gitService) ? $repo->gitService : '', "class='form-control chosen'");?>
repo->gitlabProject;?>project) ? $repo->project : '', "class='form-control chosen'");?>
repo->serviceProject;?>project) ? $repo->project : '', "class='form-control chosen'");?>
repo->name; ?> name, "class='form-control'"); ?>
repo->path; ?> path, "class='form-control'"); ?> @@ -62,7 +62,7 @@ encoding, "class='form-control'"); ?> repo->encodingsTips; ?>
repo->client;?> client, "class='form-control'")?> @@ -70,11 +70,11 @@ repo->example->client->svn;?>
+ goback, '', 'class="btn btn-wide"'); ?> repo->name); ?> repo->product); ?> repo->path; ?>actions; ?>actions; ?>
id; ?>id; ?> repo->scmList, $repo->SCM); ?> createLink('repo', 'browse', "repoID={$repo->id}&branchID=&objectID=$objectID"), $repo->name);?> path; ?>codePath;?> id&objectID=$objectID", '', 'list', 'edit'); diff --git a/module/repo/view/revision.html.php b/module/repo/view/revision.html.php index 85f35ebea5..dd9eba5ff4 100644 --- a/module/repo/view/revision.html.php +++ b/module/repo/view/revision.html.php @@ -21,7 +21,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
session->revisionList != false ? $app->session->revisionList : $this->repo->createLink('browse', "repoID={$repoID}&branchID=" . helper::safe64Encode(base64_encode($branchID)) . "&objectID=$objectID{$preDir}");?> - " . $lang->goback, '', "class='btn btn-link'");?> + " . $lang->goback, '', "class='btn btn-link back-btn'");?>
@@ -35,15 +35,15 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
- repo->changes;?> -
repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=&fromRevision=$oldRevision&toRevision=$revision"), $lang->repo->diffAll, '', "data-app='{$app->tab}'");?>
+ repo->changes;?> + repo->createLink('diff', "repoID=$repoID&objectID=$objectID&entry=&fromRevision=$oldRevision&toRevision=$revision"), $lang->repo->diffAll, '', "data-app='{$app->tab}'");?>
$change):?> - - + +
" . $change['action'] . ' ' . $path?>" . $change['action'] . ' ' . $path;?>
@@ -54,30 +54,30 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
-
repo->info?>
+
repo->info;?>
- - + + - - + + SCM != 'Subversion'):?> - - + + - - + + - - + +
repo->committer?>committer?>repo->committer;?>committer;?>
repo->revisionA?>revision?>repo->revisionA;?>revision, 0, 10);?>
repo->commit?>commit?>repo->commit;?>commit;?>
repo->comment?>comment?>repo->comment;?>comment;?>
repo->time?>time?>repo->time;?>time;?>
@@ -85,10 +85,12 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
+
+ diff --git a/module/search/control.php b/module/search/control.php index ab95db6333..4d68f6b8d5 100644 --- a/module/search/control.php +++ b/module/search/control.php @@ -227,11 +227,9 @@ class search extends control $type = (empty($type) or $type[0] == 'all') ? 'all' : $type; $this->app->loadClass('pager', $static = true); - $begin = time(); - $results = $this->search->getList($words, $type); - $recTotal = count($results); - $pager = new pager($recTotal, $this->config->search->recPerPage, $pageID); - $results = array_chunk($results, $pager->recPerPage); + $begin = time(); + $pager = new pager(0, $this->config->search->recPerPage, $pageID); + $results = $this->search->getList($words, $type, $pager); /* Set session. */ $uri = inlink('index', "recTotal=$pager->recTotal&pageID=$pager->pageID"); @@ -264,7 +262,7 @@ class search extends control if(strpos($this->server->http_referer, 'search') === false) $this->session->set('referer', $this->server->http_referer); - $this->view->results = empty($results) ? $results : $results[$pageID - 1]; + $this->view->results = $results; $this->view->consumed = time() - $begin; $this->view->title = $this->lang->search->index; $this->view->type = $type; diff --git a/module/search/model.php b/module/search/model.php index f548435229..44ec85a0b9 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -24,45 +24,67 @@ class searchModel extends model public function setSearchParams($searchConfig) { $module = $searchConfig['module']; + if($this->config->edition != 'open') { $flowModule = $module; - if($module == 'projectStory') $flowModule = 'story'; - if($module == 'projectBug') $flowModule = 'bug'; + if($module == 'projectStory' || $module == 'executionStory') $flowModule = 'story'; + if($module == 'projectBug') $flowModule = 'bug'; - $fields = $this->loadModel('workflowfield')->getList($flowModule); - $maxCount = $this->config->maxCount; - $this->config->maxCount = 0; + $buildin = false; - foreach($fields as $field) + $this->app->loadLang('workflow'); + $this->app->loadConfig('workflow'); + if(!empty($this->config->workflow->buildin)) { - if($field->canSearch == 0) continue; - - /* The built-in modules and user defined modules all have the subStatus field, so set its configuration first. */ - if($field->field == 'subStatus') + foreach($this->config->workflow->buildin->modules as $appName => $appModules) { - $field = $this->workflowfield->getByField($flowModule, 'subStatus'); - if(!isset($field->options[''])) $field->options[''] = ''; + if(isset($appModules->$flowModule)) + { + $buildin = true; + break; + } + } + } - $searchConfig['fields'][$field->field] = $field->name; - $searchConfig['params'][$field->field] = array('operator' => '=', 'control' => 'select', 'values' => $field->options); + if($buildin) + { + $fields = $this->loadModel('workflowfield')->getList($flowModule, 'searchOrder, `order`, id'); + $maxCount = $this->config->maxCount; + $this->config->maxCount = 0; - continue; + $fieldValues = array(); + $formName = $module . 'Form'; + if($this->session->$formName) + { + foreach($this->session->$formName as $formKey => $formField) + { + if(strpos($formKey, 'field') !== false) + { + $fieldNO = substr($formKey, 5); + $fieldNO = "value" . $fieldNO; + $formNameList = $this->session->$formName; + $fieldValue = zget($formNameList, $fieldNO, ''); + + if($fieldValue) $fieldValues[$formField][$fieldValue] = $fieldValue; + } + } } - /* The other built-in fields do not need to set their configuration. */ - if($field->buildin) continue; + foreach($fields as $field) + { + if($field->canSearch == 0 || $field->buildin) continue; - /* Set configuration for user defined fields. */ - $operator = ($field->control == 'input' or $field->control == 'textarea') ? 'include' : '='; - $control = ($field->control == 'select' or $field->control == 'multi-select' or $field->control == 'radio' or $field->control == 'checkbox') ? 'select' : 'input'; - $options = $this->workflowfield->getFieldOptions($field); - $class = ($field->control == 'date' or $field->control == 'datetime') ? 'date' : ''; // Set date zui for date and datetime control. + if(in_array($field->control, $this->config->workflowfield->optionControls)) + { + $field->options = $this->workflowfield->getFieldOptions($field, true, zget($fieldValues, $field->field, ''), '', $this->config->flowLimit); + } - $searchConfig['fields'][$field->field] = $field->name; - $searchConfig['params'][$field->field] = array('operator' => $operator, 'control' => $control, 'values' => $options, 'class' => $class); + $searchConfig['fields'][$field->field] = $field->name; + $searchConfig['params'][$field->field] = $this->loadModel('flow', 'sys')->processSearchParams($field->control, $field->options); + } + $this->config->maxCount = $maxCount; } - $this->config->maxCount = $maxCount; } $searchParams['module'] = $searchConfig['module']; @@ -567,36 +589,32 @@ class searchModel extends model * * @param string $keywords * @param string $type + * @param object $pager * @access public * @return array */ - public function getList($keywords, $type) + public function getList($keywords, $type, $pager = null) { $spliter = $this->app->loadClass('spliter'); $words = explode(' ', self::unify($keywords, ' ')); - $against = ''; - $againstCond = ''; - $likeCondition = ''; + $against = ''; + $againstCond = ''; + foreach($words as $word) { $splitedWords = $spliter->utf8Split($word); - $trimedWord = trim($splitedWords['words']); $against .= '"' . $trimedWord . '" '; - $againstCond .= '+"' . $trimedWord . '" '; + $againstCond .= '(+"' . $trimedWord . '") '; - $likeWord = is_numeric($word) ? $word : $trimedWord; - if(is_numeric($word) and strpos($word, '.') === false and strlen($word) < 5) $likeWord = str_pad("|$likeWord|", 5, '_'); - $condition = "OR title like '%{$likeWord}%' OR content like '%{$likeWord}%'"; - if(is_numeric($word) and strpos($word, '.') === false and strlen($word) == 5) - { - $againstCond .= "-\" $word \" "; - $condition = "OR title REGEXP '[^ ]{$likeWord}[^ ]' OR content REGEXP '[^ ]{$likeWord}[^ ]'"; - } - $likeCondition .= $condition; + if(is_numeric($word) and strpos($word, '.') === false and strlen($word) == 5) $againstCond .= "(-\" $word \") "; } + $likeCondition = ''; + /* Assisted lookup by like condition when only one word. */ + if(count($words) == 1 and strpos($words[0], ' ') === false) $likeCondition = "OR title like '%{$words[0]}%' OR content like '%{$words[0]}%'"; + $words = str_replace('"', '', $against); $words = str_pad($words, 5, '_'); @@ -619,15 +637,61 @@ class searchModel extends model } } - $scoreColumn = "((1 * (MATCH(title) AGAINST('{$against}' IN BOOLEAN MODE))) + (0.6 * (MATCH(content) AGAINST('{$against}' IN BOOLEAN MODE))) )"; - $results = $this->dao->select("*, {$scoreColumn} as score") + $scoreColumn = "(MATCH(title, content) AGAINST('{$againstCond}' IN BOOLEAN MODE))"; + $stmt = $this->dao->select("*, {$scoreColumn} as score") ->from(TABLE_SEARCHINDEX) - ->where("(MATCH(title) AGAINST('{$againstCond}' IN BOOLEAN MODE) >= 1 or MATCH(content) AGAINST('{$againstCond}' IN BOOLEAN MODE) >= 1 $likeCondition)") + ->where("(MATCH(title,content) AGAINST('{$againstCond}' IN BOOLEAN MODE) >= 1 {$likeCondition})") ->andWhere('vision')->eq($this->config->vision) ->andWhere('objectType')->in($allowedObject) ->andWhere('addedDate')->le(helper::now()) ->orderBy('score_desc, editedDate_desc') - ->fetchAll('id'); + ->query(); + + $idListGroup = array(); + $results = array(); + while($record = $stmt->fetch()) + { + $module = $record->objectType == 'case' ? 'testcase' : $record->objectType; + $idListGroup[$module][$record->objectID] = $record->objectID; + + $results[$record->id] = $record; + } + + $results = $this->checkPriv($results, $idListGroup); + if(empty($results)) return $results; + + /* Reset pager total and get this page data. */ + $pager->setRecTotal(count($results)); + $pager->setPageTotal(); + $pager->setPageID($pager->pageID); + $results = array_chunk($results, $pager->recPerPage, true); + $results = $results[$pager->pageID - 1]; + + $idListGroup = array(); + foreach($results as $record) + { + $module = $record->objectType == 'case' ? 'testcase' : $record->objectType; + $idListGroup[$module][$record->objectID] = $record->objectID; + } + + $objectList = array(); + $linkProjectModules = ',task,bug,testcase,build,release,testtask,testsuite,testreport,trainplan,'; + foreach($idListGroup as $module => $idList) + { + if(!isset($this->config->objectTables[$module])) continue; + $table = $this->config->objectTables[$module]; + + $fields = ''; + if($module == 'issue') $fields = $this->config->edition == 'max' ? 'id,project,owner,lib' : 'id,project,owner'; + if($module == 'project') $fields = 'id,model'; + if($module == 'execution')$fields = 'id,type,project'; + if($module == 'story') $fields = $this->config->edition == 'max' ? 'id,type,lib' : 'id,type'; + if(($module == 'risk' or $module == 'opportunity') and $this->config->edition == 'max') $fields = 'id,lib'; + if($module == 'doc' and $this->config->edition == 'max') $fields = 'id,assetLib,assetLibType'; + if(empty($fields)) continue; + + $objectList[$module] = $this->dao->select($fields)->from($table)->where('id')->in($idList)->fetchAll('id'); + } foreach($results as $record) { @@ -644,17 +708,14 @@ class searchModel extends model $method = 'viewstep'; } - if(strpos(',task,bug,testcase,build,release,testtask,testsuite,testreport,trainplan,', ",$module,") !== false) + if(strpos($linkProjectModules, ",$module,") !== false) { if(!isset($this->config->objectTables[$record->objectType])) continue; - $table = $this->config->objectTables[$record->objectType]; - $projectID = $this->dao->select('project')->from($table)->where('id')->eq($record->objectID)->fetch('project'); $record->url = helper::createLink($module, $method, "id={$record->objectID}"); } elseif($module == 'issue') { - $issueField = $this->config->edition == 'max' ? 'id,project,owner,lib' : 'id,project,owner'; - $issue = $this->dao->select($issueField)->from(TABLE_ISSUE)->where('id')->eq($record->objectID)->fetch(); + $issue = $objectList['issue'][$record->objectID]; if(!empty($issue->lib)) { $module = 'assetlib'; @@ -666,28 +727,27 @@ class searchModel extends model } elseif($module == 'project') { - $projectModel = $this->dao->select('model')->from(TABLE_PROJECT)->where('id')->eq($record->objectID)->fetch('model'); + $projectModel = $objectList['project'][$record->objectID]->model; $method = $projectModel == 'kanban' ? 'index' : 'view'; $record->url = helper::createLink('project', $method, "id={$record->objectID}"); } elseif($module == 'execution') { - $execution = $this->dao->select('id,type,project')->from(TABLE_EXECUTION)->where('id')->eq($record->objectID)->fetch(); + $execution = $objectList['execution'][$record->objectID]; $method = $execution->type == 'kanban' ? 'kanban' : $method; $record->url = helper::createLink('execution', $method, "id={$record->objectID}"); $record->extraType = empty($execution->type) ? '' : $execution->type; } elseif($module == 'story') { - $storyField = $this->config->edition == 'max' ? 'id,type,lib' : 'id,type'; - $story = $this->dao->select($storyField)->from(TABLE_STORY)->where('id')->eq($record->objectID)->fetch(); + $story = $objectList['story'][$record->objectID]; if(!empty($story->lib)) { $module = 'assetlib'; $method = 'storyView'; } - $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true); + $record->url = helper::createLink($module, $method, "id={$record->objectID}", '', false, 0, true); if($this->config->vision == 'lite') $record->url = helper::createLink('projectstory', $method, "storyID={$record->objectID}", '', false, 0, true); @@ -695,8 +755,7 @@ class searchModel extends model } elseif(($module == 'risk' or $module == 'opportunity') and $this->config->edition == 'max') { - $table = $this->config->objectTables[$module]; - $object = $this->dao->select('id,lib')->from($table)->where('id')->eq($record->objectID)->fetch(); + $object = $objectList[$module][$record->objectID]; if(!empty($object->lib)) { $method = $module == 'risk' ? 'riskView' : 'opportunityView'; @@ -707,7 +766,7 @@ class searchModel extends model } elseif($module == 'doc' and $this->config->edition == 'max') { - $doc = $this->dao->select('id,assetLib,assetLibType')->from(TABLE_DOC)->where('id')->eq($record->objectID)->fetch(); + $doc = $objectList['doc'][$record->objectID]; if(!empty($doc->assetLib)) { $module = 'assetlib'; @@ -722,7 +781,7 @@ class searchModel extends model } } - return $this->checkPriv($results); + return $results; } /** @@ -855,10 +914,11 @@ class searchModel extends model * Check product and project priv. * * @param array $results + * @param array $objectPairs * @access public * @return array */ - public function checkPriv($results) + public function checkPriv($results, $objectPairs = array()) { if($this->app->user->admin) return $results; @@ -870,7 +930,10 @@ class searchModel extends model $objectPairs = array(); $total = count($results); - foreach($results as $record) $objectPairs[$record->objectType][$record->objectID] = $record->id; + if(empty($objectPairs)) + { + foreach($results as $record) $objectPairs[$record->objectType][$record->objectID] = $record->id; + } foreach($objectPairs as $objectType => $objectIdList) { @@ -878,7 +941,7 @@ class searchModel extends model $objectExecutions = array(); if(!isset($this->config->objectTables[$objectType])) continue; $table = $this->config->objectTables[$objectType]; - if(strpos(',bug,case,productplan,release,story,testtask,', ",$objectType,") !== false) + if(strpos(',bug,case,testcase,productplan,release,story,testtask,', ",$objectType,") !== false) { $objectProducts = $this->dao->select('id,product')->from($table)->where('id')->in(array_keys($objectIdList))->fetchGroup('product', 'id'); } diff --git a/module/search/view/buildform.html.php b/module/search/view/buildform.html.php index 2adc969643..a1dfc65776 100644 --- a/module/search/view/buildform.html.php +++ b/module/search/view/buildform.html.php @@ -17,6 +17,7 @@ include '../../common/view/chosen.html.php'; $formId = 'searchForm-' . uniqid(''); ?>
@@ -28,7 +30,7 @@
> app->rawModule == 'projectstory'): ?> diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 662f6a7f53..cb5483bf05 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -16,13 +16,6 @@ id;?> pri . "'>"; + echo ""; echo $child->pri == '0' ? '' : zget($this->lang->story->priList, $child->pri, $child->pri); echo ""; ?> @@ -419,7 +412,7 @@ ?> type == 'story') ? $lang->story->requirement : $lang->story->story;?>
  • createLink('story', 'linkStory', "storyID=$story->id", '', true), $lang->story->link . $linkLang, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'");?> - story->unlink . $linkLang, '', "class='btn btn-info' id='unlinkStory'");?>
  • + story->unlink, '', "class='btn btn-info' id='unlinkStory'");?> @@ -456,7 +449,7 @@
    story->legendFromBug;?>story->legendFromBug;?>
      id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id", '', true), "#$fromBug->id $fromBug->title", '', "class='iframe' data-width='80%'") . '';?> @@ -465,13 +458,13 @@
    story->legendBugs;?>story->legendBugs;?>
      id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), "[B] #$bug->id $bug->title", '', "class='iframe' data-width='80%'") . ''; + echo "
    • " . html::a($this->createLink('bug', 'view', "bugID=$bug->id", '', true), "#$bug->id $bug->title", '', "class='iframe' data-width='80%'") . '
    • '; } ?>
    @@ -486,12 +479,67 @@ foreach($cases as $case) { - echo "
  • " . html::a($this->createLink('testcase', 'view', "caseID=$case->id", '', true), "[C] #$case->id $case->title", '', $misc) . '
  • '; + echo "
  • " . html::a($this->createLink('testcase', 'view', "caseID=$case->id", '', true), "#$case->id $case->title", '', $misc) . '
  • '; } ?>
    story->legendBuilds;?> +
      + tab == 'product' ? 'project' : $app->tab; + foreach($builds as $build) + { + $link = common::hasPriv('build', 'view') ? html::a($this->createLink('build', 'view', "buildID=$build->id"), "#$build->id $build->name", '', "data-app='{$tab}'") : "#$build->id $build->name"; + echo "
    • $link
    • "; + } + ?> +
    +
    story->legendReleases;?> +
      + tab == 'execution' ? 'product' : $app->tab; + $releaseModule = $app->tab == 'project' ? 'projectrelease' : 'release'; + foreach($releases as $release) + { + $link = common::hasPriv($releaseModule, 'view') ? html::a($this->createLink($releaseModule, 'view', "release=$release->id"), "#$release->id $release->name", '', "data-app='{$tab}'") : "#$release->id $release->name"; + echo "
    • $link
    • "; + } + ?> +
    +
    story->linkStories;?> +
      + linkStoryTitles)) + { + foreach($story->linkStoryTitles as $linkStoryID => $linkStoryTitle) + { + if($app->user->admin or strpos(",{$app->user->view->products},", ",{$storyProducts[$linkStoryID]},") !== false) + { + $storyLink = html::a($this->createLink('story', 'view', "storyID=$linkStoryID", '', true), "#$linkStoryID $linkStoryTitle", '', "class='iframe' data-width='80%' title='$linkStoryTitle'") . '
      '; + } + else + { + $storyLink = "#$linkStoryID $linkStoryTitle"; + } + echo "
    • $storyLink
    • "; + } + } + ?> +
    +
    story->linkMR;?> @@ -502,11 +550,11 @@ { if($mrPriv) { - echo "
  • " . html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") . '
  • '; + echo "
  • " . html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") . '
  • '; } else { - echo "
  • " . "#$MRID $linkMRTitle" . '
  • '; + echo "
  • " . "#$MRID $linkMRTitle" . '
  • '; } } ?> @@ -577,11 +625,6 @@ js::set('cancel', $lang->cancel); js::set('rawModule', $this->app->rawModule); ?> diff --git a/module/task/config.php b/module/task/config.php index 7b488a6f5b..9068d4a030 100644 --- a/module/task/config.php +++ b/module/task/config.php @@ -28,7 +28,7 @@ $config->task->editor->pause = array('id' => 'comment', 'tools' => 'simpleToo $config->task->removeFields = 'objectTypeList,productList,executionList,gitlabID,gitlabProjectID,product'; $config->task->exportFields = ' - id, execution, module, story, + id, execution, module, story, fromBug, name, desc, type, pri,estStarted, realStarted, deadline, status,estimate, consumed, left, mailto, progress, mode, @@ -56,6 +56,23 @@ $config->task->datatable->fieldList['id']['fixed'] = 'left'; $config->task->datatable->fieldList['id']['width'] = '70'; $config->task->datatable->fieldList['id']['required'] = 'yes'; +$config->task->datatable->fieldList['module']['title'] = 'idAB'; +$config->task->datatable->fieldList['module']['control'] = 'select'; +$config->task->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getTaskOptionMenu', 'params' => '$executionID'); + +$config->task->datatable->fieldList['execution']['title'] = 'idAB'; +$config->task->datatable->fieldList['execution']['control'] = 'hidden'; +$config->task->datatable->fieldList['execution']['dataSource'] = array('module' => 'execution', 'method' => 'getPairs'); + +$config->task->datatable->fieldList['mode']['title'] = 'idAB'; +$config->task->datatable->fieldList['mode']['control'] = 'hidden'; + +$config->task->datatable->fieldList['desc']['title'] = 'idAB'; +$config->task->datatable->fieldList['desc']['control'] = 'textarea'; + +$config->task->datatable->fieldList['deadline']['title'] = 'idAB'; +$config->task->datatable->fieldList['deadline']['control'] = 'date'; + $config->task->datatable->fieldList['pri']['title'] = 'priAB'; $config->task->datatable->fieldList['pri']['fixed'] = 'left'; $config->task->datatable->fieldList['pri']['width'] = '50'; @@ -94,7 +111,7 @@ $config->task->datatable->fieldList['left']['required'] = 'no'; $config->task->datatable->fieldList['progress']['title'] = 'progressAB'; $config->task->datatable->fieldList['progress']['fixed'] = 'no'; -$config->task->datatable->fieldList['progress']['width'] = '50'; +$config->task->datatable->fieldList['progress']['width'] = '80'; $config->task->datatable->fieldList['progress']['required'] = 'no'; $config->task->datatable->fieldList['progress']['sort'] = 'no'; $config->task->datatable->fieldList['progress']['name'] = $lang->task->progress; @@ -118,16 +135,19 @@ $config->task->datatable->fieldList['estStarted']['title'] = 'estStarted'; $config->task->datatable->fieldList['estStarted']['fixed'] = 'no'; $config->task->datatable->fieldList['estStarted']['width'] = '90'; $config->task->datatable->fieldList['estStarted']['required'] = 'no'; +$config->task->datatable->fieldList['estStarted']['control'] = 'date'; $config->task->datatable->fieldList['realStarted']['title'] = 'realStarted'; $config->task->datatable->fieldList['realStarted']['fixed'] = 'no'; $config->task->datatable->fieldList['realStarted']['width'] = '95'; $config->task->datatable->fieldList['realStarted']['required'] = 'no'; -$config->task->datatable->fieldList['assignedTo']['title'] = 'assignedTo'; -$config->task->datatable->fieldList['assignedTo']['fixed'] = 'no'; -$config->task->datatable->fieldList['assignedTo']['width'] = '100'; -$config->task->datatable->fieldList['assignedTo']['required'] = 'no'; +$config->task->datatable->fieldList['assignedTo']['title'] = 'assignedTo'; +$config->task->datatable->fieldList['assignedTo']['fixed'] = 'no'; +$config->task->datatable->fieldList['assignedTo']['width'] = '100'; +$config->task->datatable->fieldList['assignedTo']['required'] = 'no'; +$config->task->datatable->fieldList['assignedTo']['control'] = 'select'; +$config->task->datatable->fieldList['assignedTo']['dataSource'] = array('module' => 'user', 'method' => 'getTeamMemberPairs', 'params' => '$executionID&execution'); $config->task->datatable->fieldList['assignedDate']['title'] = 'assignedDate'; $config->task->datatable->fieldList['assignedDate']['fixed'] = 'no'; @@ -164,16 +184,19 @@ $config->task->datatable->fieldList['closedDate']['fixed'] = 'no'; $config->task->datatable->fieldList['closedDate']['width'] = '95'; $config->task->datatable->fieldList['closedDate']['required'] = 'no'; -$config->task->datatable->fieldList['closedReason']['title'] = 'closedReason'; -$config->task->datatable->fieldList['closedReason']['fixed'] = 'no'; -$config->task->datatable->fieldList['closedReason']['width'] = '120'; -$config->task->datatable->fieldList['closedReason']['required'] = 'no'; +$config->task->datatable->fieldList['closedReason']['title'] = 'closedReason'; +$config->task->datatable->fieldList['closedReason']['fixed'] = 'no'; +$config->task->datatable->fieldList['closedReason']['width'] = '120'; +$config->task->datatable->fieldList['closedReason']['required'] = 'no'; +$config->task->datatable->fieldList['closedReason']['dataSource'] = array('lang' => 'reasonList'); -$config->task->datatable->fieldList['story']['title'] = "storyAB"; -$config->task->datatable->fieldList['story']['fixed'] = 'no'; -$config->task->datatable->fieldList['story']['width'] = '70'; -$config->task->datatable->fieldList['story']['required'] = 'no'; -$config->task->datatable->fieldList['story']['name'] = $lang->task->story; +$config->task->datatable->fieldList['story']['title'] = "storyAB"; +$config->task->datatable->fieldList['story']['fixed'] = 'no'; +$config->task->datatable->fieldList['story']['width'] = '70'; +$config->task->datatable->fieldList['story']['required'] = 'no'; +$config->task->datatable->fieldList['story']['name'] = $lang->task->story; +$config->task->datatable->fieldList['story']['control'] = 'select'; +$config->task->datatable->fieldList['story']['dataSource'] = array('module' => 'story', 'method' => 'getExecutionStories', 'params' => '$executionID', 'pairs' => array('id', 'title')); $config->task->datatable->fieldList['mailto']['title'] = 'mailto'; $config->task->datatable->fieldList['mailto']['fixed'] = 'no'; diff --git a/module/task/control.php b/module/task/control.php index e7d5578ab6..905ee7cdc3 100755 --- a/module/task/control.php +++ b/module/task/control.php @@ -230,7 +230,7 @@ class task extends control elseif($this->post->after == 'toTaskList') { setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); - $taskLink = $this->createLink('execution', 'task', "executionID=$executionID&status=unclosed¶m=0&orderBy=id_desc"); + $taskLink = $this->createLink('execution', 'task', "executionID=$executionID&status=all¶m=0&orderBy=id_desc"); $response['locate'] = $taskLink; return $this->send($response); } @@ -798,7 +798,7 @@ class task extends control $execution = $this->execution->getByID($task->execution); $execLaneType = $this->session->execLaneType ? $this->session->execLaneType : 'all'; $execGroupBy = $this->session->execGroupBy ? $this->session->execGroupBy : 'default'; - if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project')) and $execution->type == 'kanban') + if(($this->app->tab == 'execution' or ($this->config->vision == 'lite' and $this->app->tab == 'project' and $this->session->kanbanview == 'kanban')) and $execution->type == 'kanban') { $rdSearchValue = $this->session->rdSearchValue ? $this->session->rdSearchValue : ''; $kanbanData = $this->loadModel('kanban')->getRDKanban($task->execution, $execLaneType, 'id_desc', 0, $execGroupBy, $rdSearchValue); @@ -2083,7 +2083,11 @@ class task extends control /* Get related objects id lists. */ $relatedStoryIdList = array(); - foreach($tasks as $task) $relatedStoryIdList[$task->story] = $task->story; + foreach($tasks as $task) + { + $relatedStoryIdList[$task->story] = $task->story; + $relatedBugIdList[$task->fromBug] = $task->fromBug; + } /* Get team for multiple task. */ $taskTeam = $this->dao->select('*')->from(TABLE_TEAM) @@ -2190,6 +2194,7 @@ class task extends control } } + $bugs = $this->loadModel('bug')->getByList($relatedBugIdList); foreach($tasks as $task) { if($this->post->fileType == 'csv') @@ -2203,6 +2208,8 @@ class task extends control /* fill some field with useful value. */ $task->story = isset($relatedStories[$task->story]) ? $relatedStories[$task->story] . "(#$task->story)" : ''; + $task->fromBug = empty($task->fromBug) ? '' : "#$task->fromBug " . $bugs[$task->fromBug]->title; + if(isset($executions[$task->execution])) $task->execution = $executions[$task->execution] . "(#$task->execution)"; if(isset($taskLang->typeList[$task->type])) $task->type = $taskLang->typeList[$task->type]; if(isset($taskLang->priList[$task->pri])) $task->pri = $taskLang->priList[$task->pri]; diff --git a/module/task/css/create.css b/module/task/css/create.css index 79d09e61d2..b92727e405 100644 --- a/module/task/css/create.css +++ b/module/task/css/create.css @@ -22,6 +22,5 @@ .c-multipleTask {width: 110px;} .c-modulel {width: 110px;} -.c-selectStory {width: 120px;} .keep-row-height {height: 32px;} diff --git a/module/task/css/view.css b/module/task/css/view.css index 06e13d58a9..5bb814cad8 100644 --- a/module/task/css/view.css +++ b/module/task/css/view.css @@ -18,3 +18,5 @@ .c-consumedAB {width: 60px;} .c-leftAB {width: 60px;} .c-actions {width: 175px;} + +[lang^='de'] #mainContent .main-actions .btn-toolbar .btn {padding-left: 3px; padding-right: 3px;} diff --git a/module/task/js/create.js b/module/task/js/create.js index 4e87cc3cf1..11b86c9d76 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -23,9 +23,8 @@ $(function() return false; }); - var executionID = $('#execution').val(); + if(executionType != 'kanban') executionID = $('#execution').val(); loadStories(executionID); - }) /** @@ -350,6 +349,8 @@ function toggleSelectTestStory() $('#testStoryBox').removeClass('hidden'); $('#copyButton').addClass('hidden'); $('.colorpicker').css('right', '0'); + $('#dataform .table-form>tbody>tr>th').css('width', '130px'); + $('[lang^="zh-"] #dataform .table-form>tbody>tr>th').css('width', '120px'); } else { @@ -359,6 +360,7 @@ function toggleSelectTestStory() $('#estStarted').closest('tr').removeClass('hidden'); $('#estimate').closest('.table-col').removeClass('hidden'); $('#testStoryBox').addClass('hidden'); + $('#dataform .table-form>tbody>tr>th').css('width', '100px'); } } diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 97606c1f2e..d0571552fa 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -12,12 +12,7 @@ $(function() */ function loadAll(executionID) { - if(!changeExecutionConfirmed) - { - firstChoice = confirm(confirmChangeExecution); - changeExecutionConfirmed = true; // Only notice the user one time. - } - if(changeExecutionConfirmed && firstChoice) + if(confirm(confirmChangeExecution)) { loadModuleMenu(executionID); loadExecutionStories(executionID); diff --git a/module/task/lang/de.php b/module/task/lang/de.php index 6bd4ae30b7..7f3109669d 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -49,7 +49,7 @@ $lang->task->case = 'Fall'; $lang->task->confirmStoryChange = "Storyäanderung bestätigen"; $lang->task->storyChange = "Story Changed"; $lang->task->progress = 'Fortschritt'; -$lang->task->progressAB = '%'; +$lang->task->progressAB = 'Fortschritt'; $lang->task->progressTips = 'Genutzt/(Genutzt+Rest)'; $lang->task->copy = 'Aufgabe kopieren'; $lang->task->waitTask = 'Waiting Task'; @@ -161,7 +161,7 @@ $lang->task->recordEstimateAction = 'Record Estimate'; $lang->task->ditto = 'Dito'; $lang->task->dittoNotice = "Diese Aufgabe gehört nicht zum %s wie die Vorherige!"; -$lang->task->selectTestStory = 'Select Story Testd'; +$lang->task->selectTestStory = 'Select Story Tested'; $lang->task->selectAllUser = 'Alle'; $lang->task->noStory = 'Keine Story'; $lang->task->noAssigned = 'Nicht zugeordnet'; @@ -215,6 +215,7 @@ $lang->task->legendDetail = 'Task Detail'; $lang->task->legendMisc = 'Misc.'; $lang->task->confirmDelete = "Möchten Sie diese Aufgabe löschen?"; +$lang->task->confirmDeleteEstimate = "Do you want to delete it?"; $lang->task->confirmDeleteLastEstimate = "Do you want to delete the log? After deleting the last work log, the task status will be adjusted to Not Started."; $lang->task->copyStoryTitle = "Story kopieren"; $lang->task->afterSubmit = "Nach der Erstellung,"; @@ -351,3 +352,6 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Datum'; $lang->taskestimate = new stdclass(); $lang->taskestimate->consumed = 'Schätzung'; + +$lang->task->overEsStartDate = 'The %s schedule start time has exceeded, please modify the %s schedule start time first'; +$lang->task->overEsEndDate = 'The %s schedule end time has exceeded, please modify the %s schedule end time first'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 3561bfae37..1e1b1e536b 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -49,7 +49,7 @@ $lang->task->case = 'Linked Case'; $lang->task->confirmStoryChange = "Confirm Change"; $lang->task->storyChange = "Story Changed"; $lang->task->progress = 'Progress'; -$lang->task->progressAB = '%'; +$lang->task->progressAB = 'Progress'; $lang->task->progressTips = 'Cost/(Cost+Left)'; $lang->task->copy = 'Copy Task'; $lang->task->waitTask = 'Waiting Task'; @@ -161,7 +161,7 @@ $lang->task->recordEstimateAction = 'Record Estimate'; $lang->task->ditto = 'Ditto'; $lang->task->dittoNotice = "This Task is not linked to %s like the last one!"; -$lang->task->selectTestStory = 'Select Story Testd'; +$lang->task->selectTestStory = 'Select Story Tested'; $lang->task->selectAllUser = 'All Users'; $lang->task->noStory = 'No Story Linked'; $lang->task->noAssigned = 'Unassigned'; @@ -352,3 +352,6 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Date'; $lang->taskestimate = new stdclass(); $lang->taskestimate->consumed = 'Estimates'; + +$lang->task->overEsStartDate = 'The %s schedule start time has exceeded, please modify the %s schedule start time first'; +$lang->task->overEsEndDate = 'The %s schedule end time has exceeded, please modify the %s schedule end time first'; diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index eb892c7518..4d668186e3 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -49,7 +49,7 @@ $lang->task->case = 'Associée CasTest'; $lang->task->confirmStoryChange = "Confirmer Changement"; $lang->task->storyChange = "Story Changée"; $lang->task->progress = 'Progression'; -$lang->task->progressAB = '%'; +$lang->task->progressAB = 'Progression'; $lang->task->progressTips = 'Coût/(Coût+Reste)'; $lang->task->copy = 'Copier Tâche'; $lang->task->waitTask = 'Tâche en attente'; @@ -352,3 +352,6 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = 'Date'; $lang->taskestimate = new stdclass(); $lang->taskestimate->consumed = 'Estimés'; + +$lang->task->overEsStartDate = 'The %s schedule start time has exceeded, please modify the %s schedule start time first'; +$lang->task->overEsEndDate = 'The %s schedule end time has exceeded, please modify the %s schedule end time first'; \ No newline at end of file diff --git a/module/task/lang/vi.php b/module/task/lang/vi.php index e4f03617e6..488a1fccea 100644 --- a/module/task/lang/vi.php +++ b/module/task/lang/vi.php @@ -47,7 +47,7 @@ $lang->task->case = 'Tình huống liên kết'; $lang->task->confirmStoryChange = "Xác nhận thay đổi"; $lang->task->storyChange = "Câu chuyện đã thay đổi"; $lang->task->progress = 'Tiến độ'; -$lang->task->progressAB = '%'; +$lang->task->progressAB = 'Tiến độ'; $lang->task->progressTips = 'Đã làm/(Đã làm + Còn lại)'; $lang->task->copy = 'Copy nhiệm vụ'; $lang->task->waitTask = 'Đang đợi nhiệm vụ'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index fb3a7b85ca..6e0cd4e8bd 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -352,3 +352,6 @@ $lang->task->report->finishedTasksPerDay->graph->xAxisName = '日期'; $lang->taskestimate = new stdclass(); $lang->taskestimate->consumed = '工时'; + +$lang->task->overEsStartDate = '已超出%s计划开始时间,请先修改%s计划开始时间'; +$lang->task->overEsEndDate = '已超出%s计划结束时间,请先修改%s计划结束时间'; \ No newline at end of file diff --git a/module/task/model.php b/module/task/model.php index 857e6eef83..6566508e29 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -63,6 +63,7 @@ class taskModel extends model $requiredFields = str_replace(",story,", ',', "$requiredFields"); $requiredFields = str_replace(",estStarted,", ',', "$requiredFields"); $requiredFields = str_replace(",deadline,", ',', "$requiredFields"); + $requiredFields = str_replace(",module,", ',', "$requiredFields"); } $this->loadModel('file'); @@ -180,7 +181,7 @@ class taskModel extends model { if($storyID) $testStoryIdList[$storyID] = $storyID; } - $testStories = $this->dao->select('id,title,version')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchAll('id'); + $testStories = $this->dao->select('id,title,version,module')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchAll('id'); foreach($this->post->testStory as $i => $storyID) { if(!isset($testStories[$storyID])) continue; @@ -195,6 +196,7 @@ class taskModel extends model $task->assignedTo = $this->post->testAssignedTo[$i]; $task->estimate = $this->post->testEstimate[$i]; $task->left = $this->post->testEstimate[$i]; + $task->module = $testStories[$storyID]->module; $this->dao->insert(TABLE_TASK)->data($task)->exec(); $childTaskID = $this->dao->lastInsertID(); @@ -1673,7 +1675,7 @@ class taskModel extends model $estimate->left = zget($_POST, 'left', 0); $estimate->work = zget($task, 'work', ''); $estimate->account = $this->app->user->account; - $estimate->consumed = $estimate->consumed - $oldTask->consumed; + $estimate->consumed = !empty($oldTask->team) ? $estimate->consumed - $oldTask->team[$this->app->user->account]->consumed : $estimate->consumed - $oldTask->consumed; if($this->post->comment) $estimate->work = $this->post->comment; $this->addTaskEstimate($estimate); @@ -1823,7 +1825,7 @@ class taskModel extends model if(!empty($task->team)) { - $myConsumed = $task->team[$task->assignedTo]->consumed; + $myConsumed = $task->team[$this->app->user->account]->consumed; $newTeamInfo = new stdClass(); $newTeamInfo->consumed = $myConsumed + $consumed; @@ -1831,7 +1833,7 @@ class taskModel extends model $this->dao->update(TABLE_TEAM)->data($newTeamInfo) ->where('root')->eq($taskID) ->andWhere('type')->eq('task') - ->andWhere('account')->eq($task->assignedTo) + ->andWhere('account')->eq($this->app->user->account) ->exec(); $data = $this->computeHours4Multiple($task, $data); @@ -2384,9 +2386,13 @@ class taskModel extends model ->markRight(1) ->fi() ->beginIF($type == 'delayed')->andWhere('t1.deadline')->gt('1970-1-1')->andWhere('t1.deadline')->lt(date(DT_DATE1))->andWhere('t1.status')->in('wait,doing')->fi() - ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,assignedbyme,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() + ->beginIF(is_array($type) or strpos(',all,undone,needconfirm,assignedtome,delayed,finishedbyme,myinvolved,assignedbyme,review,', ",$type,") === false)->andWhere('t1.status')->in($type)->fi() ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() ->beginIF($type == 'assignedbyme')->andWhere('t1.id')->in($actionIDList)->andWhere('t1.status')->ne('closed')->fi() + ->beginIF($type == 'review') + ->andWhere("FIND_IN_SET('{$this->app->user->account}', t1.reviewers)") + ->andWhere('t1.reviewStatus')->eq('doing') + ->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy($orderBy) ->page($pager, 't1.id') @@ -2517,6 +2523,7 @@ class taskModel extends model ->beginIF($type == 'assignedTo' and ($this->app->rawModule == 'my' or $this->app->rawModule == 'block'))->andWhere('t2.status', true)->ne('suspended')->orWhere('t4.status')->ne('suspended')->markRight(1)->fi() ->beginIF($type != 'all' and $type != 'finishedBy' and $type != 'assignedTo')->andWhere("t1.`$type`")->eq($account)->fi() ->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}') )")->fi() + ->beginIF($type == 'assignedTo' and $this->app->rawModule == 'my' and $this->app->rawMethod == 'work')->andWhere('t1.status')->notin('closed,cancel,pause')->fi() ->orderBy($orderBy) ->beginIF($limit > 0)->limit($limit)->fi() ->page($pager) @@ -2558,6 +2565,7 @@ class taskModel extends model ->leftjoin(TABLE_PROJECT)->alias('t2')->on('t1.execution = t2.id') ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) ->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi() ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() ->beginIF(!empty($skipExecutionIDList))->andWhere('t1.execution')->notin($skipExecutionIDList)->fi() @@ -3623,7 +3631,19 @@ class taskModel extends model public function printAssignedHtml($task, $users) { $btnTextClass = ''; - $assignedToText = (!empty($task->team) and $task->mode == 'multi') ? $this->lang->task->team : zget($users, $task->assignedTo); + if(!empty($task->team) and $task->mode == 'multi' and $task->status != 'closed') + { + $assignedToText = $this->lang->task->team; + + $teamMembers = array(); + foreach($task->team as $teamMember) $teamMembers[] = zget($users, $teamMember->account); + $assignedToTitle = implode($this->lang->comma, $teamMembers); + } + else + { + $assignedToText = $assignedToTitle = zget($users, $task->assignedTo); + } + $assignedToText = (!empty($task->team) and $task->mode == 'multi' and $task->status != 'closed') ? $this->lang->task->team : zget($users, $task->assignedTo); if(empty($task->assignedTo)) { @@ -3635,7 +3655,7 @@ class taskModel extends model $btnClass = $task->assignedTo == 'closed' ? ' disabled' : ''; $btnClass = "iframe btn btn-icon-left btn-sm {$btnClass}"; $assignToLink = $task->assignedTo == 'closed' ? '#' : helper::createLink('task', 'assignTo', "executionID=$task->execution&taskID=$task->id", '', true); - $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); + $assignToHtml = html::a($assignToLink, " {$assignedToText}", '', "class='$btnClass'"); echo !common::hasPriv('task', 'assignTo', $task) ? "{$assignedToText}" : $assignToHtml; } @@ -3762,6 +3782,9 @@ class taskModel extends model */ public function buildNestedList($execution, $task, $isChild = false, $showmore = false, $users = array()) { + $this->app->loadLang('execution'); + + $today = helper::today(); $showmore = $showmore ? 'showmore' : ''; $trAttrs = "data-id='t$task->id'"; if(!$isChild) @@ -3786,8 +3809,22 @@ class taskModel extends model $list .= '
    ' . zget($users, $task->assignedTo, '') . '" . $this->processStatus('task', $task) . '' . $task->estStarted . '' . $task->deadline . '' . $task->estStarted . '' . $task->deadline . '' . $task->deadline . '' . $task->deadline . '' . $task->estimate . $this->lang->execution->workHourUnit . '' . $task->consumed . $this->lang->execution->workHourUnit . '' . $task->left . $this->lang->execution->workHourUnit . ' task->assignedTo;?> team) and $task->mode == 'multi') + if(!empty($task->team) and $task->mode == 'multi' and $task->status != 'closed') { foreach($task->team as $member) echo ' ' . zget($users, $member->account); } @@ -442,11 +435,6 @@ diff --git a/module/testcase/config.php b/module/testcase/config.php index 937d67af4a..ae74d339c7 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -84,6 +84,14 @@ $config->testcase->datatable->fieldList['id']['fixed'] = 'left'; $config->testcase->datatable->fieldList['id']['width'] = '70'; $config->testcase->datatable->fieldList['id']['required'] = 'yes'; +$config->testcase->datatable->fieldList['product']['title'] = 'priAB'; +$config->testcase->datatable->fieldList['product']['control'] = 'hidden'; +$config->testcase->datatable->fieldList['product']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&product&id,name'); + +$config->testcase->datatable->fieldList['module']['title'] = 'module'; +$config->testcase->datatable->fieldList['module']['control'] = 'select'; +$config->testcase->datatable->fieldList['module']['dataSource'] = array('module' => 'tree', 'method' => 'getOptionMenu', 'params' => '$productID&case'); + $config->testcase->datatable->fieldList['pri']['title'] = 'priAB'; $config->testcase->datatable->fieldList['pri']['fixed'] = 'left'; $config->testcase->datatable->fieldList['pri']['width'] = '40'; @@ -95,10 +103,11 @@ $config->testcase->datatable->fieldList['title']['fixed'] = 'left'; $config->testcase->datatable->fieldList['title']['width'] = 'auto'; $config->testcase->datatable->fieldList['title']['required'] = 'yes'; -$config->testcase->datatable->fieldList['branch']['title'] = 'branch'; -$config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; -$config->testcase->datatable->fieldList['branch']['width'] = '100'; -$config->testcase->datatable->fieldList['branch']['required'] = 'no'; +$config->testcase->datatable->fieldList['branch']['title'] = 'branch'; +$config->testcase->datatable->fieldList['branch']['fixed'] = 'left'; +$config->testcase->datatable->fieldList['branch']['width'] = '100'; +$config->testcase->datatable->fieldList['branch']['required'] = 'no'; +$config->testcase->datatable->fieldList['branch']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&branch&id,name'); $config->testcase->datatable->fieldList['type']['title'] = 'type'; $config->testcase->datatable->fieldList['type']['fixed'] = 'no'; @@ -109,6 +118,7 @@ $config->testcase->datatable->fieldList['stage']['title'] = 'stage'; $config->testcase->datatable->fieldList['stage']['fixed'] = 'no'; $config->testcase->datatable->fieldList['stage']['width'] = '110'; $config->testcase->datatable->fieldList['stage']['required'] = 'no'; +$config->testcase->datatable->fieldList['stage']['control'] = 'multiple'; $config->testcase->datatable->fieldList['precondition']['title'] = 'precondition'; $config->testcase->datatable->fieldList['precondition']['fixed'] = 'no'; @@ -192,6 +202,8 @@ $config->testcase->datatable->fieldList['story']['title'] = 'story'; $config->testcase->datatable->fieldList['story']['fixed'] = 'no'; $config->testcase->datatable->fieldList['story']['width'] = '90'; $config->testcase->datatable->fieldList['story']['required'] = 'no'; +$config->testcase->datatable->fieldList['story']['control'] = 'select'; +$config->testcase->datatable->fieldList['story']['dataSource'] = array('module' => 'port', 'method' => 'getRelatedObjects', 'params' => 'testcase&story&id,title'); $config->testcase->datatable->fieldList['bugs']['title'] = 'B'; $config->testcase->datatable->fieldList['bugs']['fixed'] = 'no'; diff --git a/module/testcase/control.php b/module/testcase/control.php index ce43238469..dc0d28d76b 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -910,13 +910,16 @@ class testcase extends control $branchTagOption[$case->branch] = $case->branch == BRANCH_MAIN ? $caseBranch : ($caseBranch->name . ($caseBranch->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '')); } + $moduleIdList = $case->module; + if($case->module) $moduleIdList = $this->tree->getAllChildID($case->module); + $this->view->productID = $productID; $this->view->product = $product; $this->view->products = $this->products; $this->view->branchTagOption = $branchTagOption; $this->view->productName = $this->products[$productID]; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch, 0, 'all','id_desc', 0, 'full', 'story', false); + $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch, $moduleIdList, 'all','id_desc', 0, 'full', 'story', false); } $forceNotReview = $this->testcase->forceNotReview(); if($forceNotReview) unset($this->lang->testcase->statusList['wait']); @@ -1034,8 +1037,7 @@ class testcase extends control $cases = $this->dao->select('t1.*,t2.id as runID')->from(TABLE_CASE)->alias('t1') ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.id = t2.case') ->where('t1.deleted')->eq(0) - ->beginIF($tab == 'my')->andWhere('t2.id')->in($caseIDList)->fi() - ->beginIF($tab != 'my')->andWhere('t1.id')->in($caseIDList)->fi() + ->andWhere('t1.id')->in($caseIDList) ->fetchAll('id'); $caseIDList = array_keys($cases); @@ -1728,7 +1730,7 @@ class testcase extends control * @access public * @return void */ - public function exportTemplet($productID) + public function exportTemplate($productID) { if($_POST) { diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js index e82c364e91..560ca72326 100644 --- a/module/testcase/js/batchedit.js +++ b/module/testcase/js/batchedit.js @@ -99,17 +99,16 @@ $(function() var id = $(this).attr('id'); var num = id.substring(5); var moduleID = $('#modules' + num).val(); - var branchID = $('#branches' + num).val(); + var branchID = typeof($('#branches' + num).val()) == 'undefined' ? 0 : $('#branches' + num).val(); var storyID = $("#story" + num).val(); - var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); + var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=' + storyID +'&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=0&number=' + num); $.get(storyLink, function(stories) { if(!stories) stories = ''; $('#story' + num).replaceWith(stories); $('#story' + num + "_chosen").remove(); $('#story' + num).next('.picker').remove(); - $('#story' + num).attr('name', 'story[' + num + ']').chosen(); - $('#story' + num).val(storyID).trigger('chosen:updated'); + $('#story' + num).attr('name', 'story[' + num + ']').picker(); }); }); } diff --git a/module/testcase/js/common.js b/module/testcase/js/common.js index b9f686ff18..f08c4ac4d7 100644 --- a/module/testcase/js/common.js +++ b/module/testcase/js/common.js @@ -131,7 +131,7 @@ function setStories() productID = $('#product').val(); branch = $('#branch').val(); if(typeof(branch) == 'undefined') branch = 0; - link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=' + executionID); + link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=' + executionID); $.get(link, function(stories) { @@ -141,7 +141,7 @@ function setStories() $('#story').val(value); $('#story_chosen').remove(); $('#story').next('.picker').remove(); - $("#story").chosen(); + $("#story").picker(); }); } @@ -364,7 +364,7 @@ function loadStories(productID, moduleID, num) { var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches'; var branchID = $(branchIDName + num).val(); - var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); + var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=0&number=' + num); $.get(storyLink, function(stories) { if(!stories) stories = ''; @@ -378,7 +378,7 @@ function loadStories(productID, moduleID, num) $('#story' + i + "_chosen").remove(); $('#story' + i).next('.picker').remove(); $('#story' + i).attr('name', 'story[' + i + ']'); - $('#story' + i).chosen(); + $('#story' + i).picker(); } } else @@ -387,7 +387,7 @@ function loadStories(productID, moduleID, num) $('#story' + num + "_chosen").remove(); $('#story' + num).next('.picker').remove(); $('#story' + num).attr('name', 'story[' + num + ']'); - $('#story' + num).chosen(); + $('#story' + num).picker(); } }); } diff --git a/module/testcase/js/showimport.js b/module/testcase/js/showimport.js index 4741a30fd6..e69de29bb2 100644 --- a/module/testcase/js/showimport.js +++ b/module/testcase/js/showimport.js @@ -1,43 +0,0 @@ -$("[name^='product']").each(function() -{ - var id = $(this).attr('id'); - $(this).attr('id', 'product' + id.match(/\d+/)); -}); - -$("[name^='branch']").each(function() -{ - var id = $(this).attr('id'); - $(this).attr('id', 'branch' + id.match(/\d+/)); -}); - -$("[name^='module']").each(function() -{ - var id = $(this).attr('id'); - $(this).attr('id', 'module' + id.match(/\d+/)); -}); - -$("[name^='story']").each(function() -{ - var id = $(this).attr('id'); - var num = id.substring(5); - var productID = $('#product' + num).val(); - var branchID = $('#branch' + num).val(); - var moduleID = $('#module' + num).val(); - var storyID = $("#story" + num).val(); - var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num); - - $.get(storyLink, function(stories) - { - if(!stories) stories = ''; - $('#story' + num).replaceWith(stories); - $('#story' + num + "_chosen").remove(); - $('#story' + num).next('.picker').remove(); - $('#story' + num).attr('name', 'story[' + num + ']').chosen(); - $('#story' + num).val(storyID).trigger('chosen:updated'); - }); -}); - -$(function() -{ - if(parseInt($('.c-name').css('width')) < 90) $('.c-name').css('width', '90px'); -}); diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php index 20888cd3c8..bab3e85285 100644 --- a/module/testcase/lang/de.php +++ b/module/testcase/lang/de.php @@ -130,7 +130,7 @@ $lang->testcase->importAction = "Import Case"; $lang->testcase->fileImport = "Importiere CSV"; $lang->testcase->importFromLib = "Import aus Bibliothek"; $lang->testcase->showImport = "Import Anzeigen"; -$lang->testcase->exportTemplet = "Export Vorlage"; +$lang->testcase->exportTemplate = "Export Vorlage"; $lang->testcase->export = "Exportiere Daten"; $lang->testcase->exportAction = "Export Case"; $lang->testcase->reportChart = 'Bericht Chart'; diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index 98f7e19313..a0196e03d2 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -130,7 +130,7 @@ $lang->testcase->importAction = "Import Case"; $lang->testcase->fileImport = "Import CSV"; $lang->testcase->importFromLib = "Import From Library"; $lang->testcase->showImport = "Show Import"; -$lang->testcase->exportTemplet = "Export Template"; +$lang->testcase->exportTemplate = "Export Template"; $lang->testcase->export = "Export Data"; $lang->testcase->exportAction = "Export Case"; $lang->testcase->reportChart = 'Report Chart'; diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php index 52d72910af..79d6ad2dcf 100644 --- a/module/testcase/lang/fr.php +++ b/module/testcase/lang/fr.php @@ -130,7 +130,7 @@ $lang->testcase->importAction = "Importer CasTest"; $lang->testcase->fileImport = "Importer CSV"; $lang->testcase->importFromLib = "Importer de la Library"; $lang->testcase->showImport = "Voir Import"; -$lang->testcase->exportTemplet = "Exporter Modèle"; +$lang->testcase->exportTemplate = "Exporter Modèle"; $lang->testcase->export = "Exporter Données"; $lang->testcase->exportAction = "Exporter CasTest"; $lang->testcase->reportChart = 'Graphique'; diff --git a/module/testcase/lang/vi.php b/module/testcase/lang/vi.php index c94f2630af..bcd797fd58 100644 --- a/module/testcase/lang/vi.php +++ b/module/testcase/lang/vi.php @@ -110,7 +110,7 @@ $lang->testcase->importAction = "Nhập tình huống"; $lang->testcase->fileImport = "Nhập CSV"; $lang->testcase->importFromLib = "Nhập từ thư viện"; $lang->testcase->showImport = "Hiển thị Nhập khẩu"; -$lang->testcase->exportTemplet = "Xuất Mẫu"; +$lang->testcase->exportTemplate = "Xuất Mẫu"; $lang->testcase->export = "Xuất dữ liệu"; $lang->testcase->exportAction = "Xuất tình huống"; $lang->testcase->reportChart = 'Biểu đồ báo cáo'; diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 5496e40098..94a2d47c79 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -130,7 +130,7 @@ $lang->testcase->importAction = "导入用例"; $lang->testcase->fileImport = "导入CSV"; $lang->testcase->importFromLib = "从用例库中导入"; $lang->testcase->showImport = "显示导入内容"; -$lang->testcase->exportTemplet = "导出模板"; +$lang->testcase->exportTemplate = "导出模板"; $lang->testcase->export = "导出数据"; $lang->testcase->exportAction = "导出用例"; $lang->testcase->reportChart = '报表统计'; diff --git a/module/testcase/lang/zh-tw.php b/module/testcase/lang/zh-tw.php index b240bdcd39..52b32cb3c4 100644 --- a/module/testcase/lang/zh-tw.php +++ b/module/testcase/lang/zh-tw.php @@ -126,7 +126,7 @@ $lang->testcase->importAction = "導入用例"; $lang->testcase->fileImport = "導入CSV"; $lang->testcase->importFromLib = "從用例庫中導入"; $lang->testcase->showImport = "顯示導入內容"; -$lang->testcase->exportTemplet = "導出模板"; +$lang->testcase->exportTemplate = "導出模板"; $lang->testcase->export = "導出數據"; $lang->testcase->exportAction = "導出用例"; $lang->testcase->reportChart = '報表統計'; diff --git a/module/testcase/model.php b/module/testcase/model.php index 2130aa43ea..fd02631f3b 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -97,8 +97,8 @@ class testcaseModel extends model $step->parent = ($step->type == 'item') ? $parentStepID : 0; $step->case = $caseID; $step->version = 1; - $step->desc = htmlSpecialString($stepDesc); - $step->expect = $step->type == 'group' ? '' : htmlSpecialString($data->expects[$stepID]); + $step->desc = rtrim(htmlSpecialString($stepDesc)); + $step->expect = $step->type == 'group' ? '' : rtrim(htmlSpecialString($data->expects[$stepID])); $this->dao->insert(TABLE_CASESTEP)->data($step)->autoCheck()->exec(); if($step->type == 'group') $parentStepID = $this->dao->lastInsertID(); if($step->type == 'step') $parentStepID = 0; @@ -620,16 +620,16 @@ class testcaseModel extends model */ public function getByAssignedTo($account, $orderBy = 'id_desc', $pager = null, $auto = 'no') { - return $this->dao->select('t1.task,t1.case,t1.version,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status,t2.id as id,t2.project,t2.pri,t2.title,t2.type,t2.openedBy,t2.color,t2.product,t2.branch,t2.module,t2.status,t3.name as taskName')->from(TABLE_TESTRUN)->alias('t1') + return $this->dao->select('t1.id as run, t1.task,t1.case,t1.version,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status,t2.id as id,t2.project,t2.pri,t2.title,t2.type,t2.openedBy,t2.color,t2.product,t2.branch,t2.module,t2.status,t3.name as taskName')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') ->leftJoin(TABLE_TESTTASK)->alias('t3')->on('t1.task = t3.id') ->where('t1.assignedTo')->eq($account) ->andWhere('t3.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t3.status')->ne('done') - ->beginIF($auto != 'skip' and $auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi() + ->beginIF(strpos($auto, 'skip') === false and $auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi() ->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi() - ->orderBy($orderBy)->page($pager)->fetchAll('id'); + ->orderBy($orderBy)->page($pager)->fetchAll(strpos($auto, 'run') !== false? 'run' : 'id'); } /** @@ -826,8 +826,8 @@ class testcaseModel extends model $step->parent = ($step->type == 'item') ? $parentStepID : 0; $step->case = $caseID; $step->version = $version; - $step->desc = htmlSpecialString($stepDesc); - $step->expect = $step->type == 'group' ? '' : htmlSpecialString($data->expects[$stepID]); + $step->desc = rtrim(htmlSpecialString($stepDesc)); + $step->expect = $step->type == 'group' ? '' : rtrim(htmlSpecialString($data->expects[$stepID])); $this->dao->insert(TABLE_CASESTEP)->data($step)->autoCheck()->exec(); if($step->type == 'group') $parentStepID = $this->dao->lastInsertID(); if($step->type == 'step') $parentStepID = 0; @@ -1050,15 +1050,15 @@ class testcaseModel extends model if($data->pris[$caseID] == 'ditto') $data->pris[$caseID] = isset($prev['pri']) ? $prev['pri'] : 3; if($data->modules[$caseID] == 'ditto') $data->modules[$caseID] = isset($prev['module']) ? $prev['module'] : 0; if($data->types[$caseID] == 'ditto') $data->types[$caseID] = isset($prev['type']) ? $prev['type'] : ''; - if($data->story[$caseID] == '') $data->story[$caseID] = 0; + if($data->story[$caseID] == '') $data->story[$caseID] = 0; + if($data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; if(isset($data->branches[$caseID]) and $data->branches[$caseID] == 'ditto') $data->branches[$caseID] = isset($prev['branch']) ? $prev['branch'] : 0; - if($data->story[$caseID] == 'ditto') $data->story[$caseID] = isset($prev['story']) ? $prev['story'] : 0; $prev['pri'] = $data->pris[$caseID]; $prev['type'] = $data->types[$caseID]; $prev['story'] = $data->story[$caseID]; - $prev['branch'] = $data->branches[$caseID]; $prev['module'] = $data->modules[$caseID]; + if(isset($data->branches)) $prev['branch'] = $data->branches[$caseID]; } /* Initialize cases from the post data.*/ @@ -1070,7 +1070,6 @@ class testcaseModel extends model $case->lastEditedBy = $this->app->user->account; $case->lastEditedDate = $now; $case->pri = $data->pris[$caseID]; - $case->branch = $data->branches[$caseID]; $case->module = $data->modules[$caseID]; $case->status = $data->statuses[$caseID]; $case->story = $data->story[$caseID]; @@ -1080,6 +1079,7 @@ class testcaseModel extends model $case->keywords = $data->keywords[$caseID]; $case->type = $data->types[$caseID]; $case->stage = empty($data->stages[$caseID]) ? '' : implode(',', $data->stages[$caseID]); + if(isset($data->branches[$caseID])) $case->branch = $data->branches[$caseID]; foreach($extendFields as $extendField) { @@ -1122,7 +1122,7 @@ class testcaseModel extends model unset($oldCase->steps); $allChanges[$caseID] = common::createChanges($oldCase, $case); - if($case->branch and isset($testtasks[$caseID])) + if(!empty($case->branch) and isset($testtasks[$caseID])) { foreach($testtasks[$caseID] as $taskID => $testtask) { @@ -2092,14 +2092,15 @@ class testcaseModel extends model /** * Append bugs and results. * - * @param array $cases - * @param string $type + * @param int $cases + * @param string $type + * @param array $caseIdlist * @access public - * @return array + * @return void */ - public function appendData($cases, $type = 'case') + public function appendData($cases, $type = 'case', $caseIdlist = array()) { - $caseIdList = array_keys($cases); + if(empty($caseIdlist)) $caseIdList = array_keys($cases); if($type == 'case') { $caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count'); @@ -2497,4 +2498,97 @@ class testcaseModel extends model return $menu; } + + /** + * processDatas + * + * @param array $datas + * @access public + * @return void + */ + public function processDatas($datas) + { + if(isset($datas->datas)) $datas = $datas->datas; + $columnKey = array(); + $caseData = array(); + $stepData = array(); + $stepVars = 0; + + foreach($datas as $row => $cellValue) + { + foreach($cellValue as $field => $value) + { + if($field != 'stepDesc' and $field != 'stepExpect') continue; + if($field == 'stepDesc' or $field == 'stepExpect') + { + $steps = $value; + if(strpos($value, "\n")) + { + $steps = explode("\n", $value); + } + elseif(strpos($value, "\r")) + { + $steps = explode("\r", $value); + } + if(is_string($steps)) $steps = explode("\n", $steps); + + $stepKey = str_replace('step', '', strtolower($field)); + + $caseStep = array(); + foreach($steps as $step) + { + $trimedStep = trim($step); + if(empty($trimedStep)) continue; + if(preg_match('/^(([0-9]+)\.[0-9]+)([.、]{1})/U', $step, $out) and ($field == 'stepDesc' or ($field == 'stepExpect' and isset($stepData[$row]['desc'][$out[1]])))) + { + $num = $out[1]; + $parent = $out[2]; + $sign = $out[3]; + $signbit = $sign == '.' ? 1 : 3; + $step = trim(substr($step, strlen($num) + $signbit)); + if(!empty($step)) $caseStep[$num]['content'] = $step; + $caseStep[$num]['type'] = 'item'; + $caseStep[$parent]['type'] = 'group'; + } + elseif(preg_match('/^([0-9]+)([.、]{1})/U', $step, $out) and ($field == 'stepDesc' or ($field == 'stepExpect' and isset($stepData[$row]['desc'][$out[1]])))) + { + $num = $out[1]; + $sign = $out[2]; + $signbit = $sign == '.' ? 1 : 3; + $step = trim(substr($step, strpos($step, $sign) + $signbit)); + if(!empty($step)) $caseStep[$num]['content'] = $step; + $caseStep[$num]['type'] = 'step'; + } + elseif(isset($num)) + { + if(!isset($caseStep[$num]['content'])) $caseStep[$num]['content'] = ''; + if(!isset($caseStep[$num]['type'])) $caseStep[$num]['type'] = 'step'; + $caseStep[$num]['content'] .= "\n" . $step; + } + else + { + if($field == 'stepDesc') + { + $num = 1; + $caseStep[$num]['content'] = $step; + $caseStep[$num]['type'] = 'step'; + } + if($field == 'stepExpect' and isset($stepData[$row]['desc'])) + { + end($stepData[$row]['desc']); + $num = key($stepData[$row]['desc']); $caseStep[$num]['content'] = $step; + } + } + } + + unset($num); + unset($sign); + $stepVars += count($caseStep, COUNT_RECURSIVE) - count($caseStep); + $stepData[$row][$stepKey] = $caseStep; + } + + } + } + return $stepData; + } } diff --git a/module/testcase/view/batchcreate.html.php b/module/testcase/view/batchcreate.html.php index 86afac21b6..ac496f4a04 100644 --- a/module/testcase/view/batchcreate.html.php +++ b/module/testcase/view/batchcreate.html.php @@ -90,7 +90,7 @@ branchBox'> moduleBox' style='overflow:visible'> storyBox' style='overflow:visible'> id : '', 'class="form-control chosen"');?> storyBox' style='overflow:visible'> id : '', 'class="form-control picker-select"');?>
    @@ -141,7 +141,7 @@
    %s branchBox'> moduleBox' style='overflow:visible'> storyBox' style='overflow:visible'> storyBox' style='overflow:visible'>
    @@ -180,7 +180,7 @@
    branchBox'> moduleBox' style='overflow:visible'> storyBox' style='overflow:visible'> id : '', 'class="form-control chosen"');?> storyBox' style='overflow:visible'> id : '', 'class="form-control picker-select"');?>
    diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index a3a38b0cf0..5549ccc491 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -97,7 +97,7 @@
    ' style='overflow:visible'> '/')), $cases[$caseID]->module, "class='form-control chosen' onchange='loadStories($productID, this.value, $caseID)'");?>' style='overflow:visible'>story, "class='form-control chosen'");?>' style='overflow:visible'>story, "class='form-control picker-select'");?>
    diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 98f2357687..f7e246bf8e 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -127,10 +127,10 @@ $link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy&taskID=0&browseType=$browseType") : '#'; echo "
  • " . html::a($link, $lang->testcase->export, '', $misc . "data-app={$this->app->tab}") . "
  • "; - $class = common::hasPriv('testcase', 'exportTemplet') ? '' : "class=disabled"; - $misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled"; - $link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#'; - echo "
  • " . html::a($link, $lang->testcase->exportTemplet, '', $misc . "data-app={$this->app->tab} data-width='50%'") . "
  • "; + $class = common::hasPriv('testcase', 'exportTemplate') ? '' : "class=disabled"; + $misc = common::hasPriv('testcase', 'exportTemplate') ? "class='export'" : "class=disabled"; + $link = common::hasPriv('testcase', 'exportTemplate') ? $this->createLink('testcase', 'exportTemplate', "productID=$productID") : '#'; + echo "
  • " . html::a($link, $lang->testcase->exportTemplate, '', $misc . "data-app={$this->app->tab} data-width='50%'") . "
  • "; ?>
    diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 4bfecdb21c..e9a6f9a188 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -84,7 +84,7 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field)
    testcase->lblStory;?>
    - searchMore . '"');?> + searchMore . '"');?> diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 449d189d30..07d9a0a0d6 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -204,7 +204,7 @@
    testcase->story;?>
    story, 'class="form-control chosen"');?>
    +
    story, 'class="form-control picker-select"');?>
    - - - testcase->create->requiredFields;?> - - - type != 'normal'):?> - - - - - - - - - - - show) continue; - - $width = ($field->width && $field->width != 'auto' ? $field->width . 'px' : 'auto'); - $required = strpos(",$field->rules,", ",$notEmptyRule->id,") !== false ? 'required' : ''; - echo ""; - } - } - ?> - - - - - - $case):?> - title)) continue;?> - - - - - type != 'normal'):?> - branch)) $branchID = $case->branch; - if(!isset($branches[$branchID])) $branchID = $branch; - ?> - - - - - - - - - - - loadModel('flow'); - foreach($appendFields as $field) - { - if(!$field->show) continue; - $value = $field->defaultValue ? $field->defaultValue : zget($case, $field->field, ''); - echo ''; - } - } - ?> - - - + +
    lineNumber?>idAB?>testcase->branch?>'>testcase->title?>'>testcase->module?>'>testcase->story?>'>testcase->pri?>'>testcase->type?>'>testcase->stage?>'>testcase->precondition?>'>testcase->keywords?>$field->name - - - - - -
    testcase->stepDesc?>testcase->stepExpect?>
    -
    - id)) - { - echo $case->id . html::hidden("id[$key]", $case->id); - $insert = false; - } - else - { - echo "{$lang->testcase->new}"; - } - echo html::hidden("product[$key]", $productID); - ?> - title, ENT_QUOTES), "class='form-control'")?> - - module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen moduleChange' onchange='loadStories($productID, this.value, $key)'")?> - - story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : '');?> - zget($stories, $storyID, '')), $storyID, "class='form-control chosen storyChange'")?>testcase->priList, isset($case->pri) ? $case->pri : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->pri : ''), "class='form-control chosen'")?>testcase->typeList, isset($case->type) ? $case->type : '', "class='form-control chosen'")?>testcase->stageList, !empty($case->stage) ? $case->stage : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?>precondition) ? htmlSpecialString($case->precondition) : "", "class='form-control'")?>keywords) ? $case->keywords : '', "class='form-control'")?>' . $this->flow->buildControl($field, $value, "$field->field[$key]", true) . ' - - - - $desc):?> - - - - - - - - - - - - - - - -
    - - - - - - - -
    - -
    + + + + $value):?> + + + + + + - - - - "; } - else - { - echo html::submitButton($submitText); - if($dataInsert !== '') echo html::hidden('insert', $dataInsert); - } - echo html::hidden('isEndPage', $isEndPage ? 1 : 0); - echo html::hidden('pagerID', $pagerID); - echo html::linkButton($lang->goback, $this->inlink('browse', "productID=$productID"), 'self', '', 'btn btn-wide'); - echo sprintf($lang->file->importPager, $allCount, $pagerID, $allPager); - ?> - - - -
    port->id?> + + + + + +
    +
    - lang->save : $this->lang->file->saveAndNext; - if(!$insert and $dataInsert === '') + {$submitText}"; + if(!$field->show) continue; + + $width = ($field->width && $field->width != 'auto' ? $field->width . 'px' : 'auto'); + $required = strpos(",$field->rules,", ",$notEmptyRule->id,") !== false ? 'required' : ''; + echo "$field->name
    -
    - + } + ?> + + + + + + getModuleRoot() . 'port/view/tfoot.html.php';?> + + + getModuleRoot() . 'common/view/noticeimport.html.php';?>
    - +getModuleRoot() . 'port/view/footer.html.php';?> - diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 7f10daebfd..91739e1c81 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -50,6 +50,7 @@ class testsuite extends control * Browse test suites. * * @param int $productID + * @param string $type * @param string $orderBy * @param int $recTotal * @param int $recPerPage @@ -57,7 +58,7 @@ class testsuite extends control * @access public * @return void */ - public function browse($productID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function browse($productID = 0, $type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ $this->session->set('testsuiteList', $this->app->getURI(true), 'qa'); @@ -74,11 +75,11 @@ class testsuite extends control $sort = common::appendOrder($orderBy); $productName = isset($this->products[$productID]) ? $this->products[$productID] : ''; - $suites = $this->testsuite->getSuites($productID, $sort, $pager); + $suites = $this->testsuite->getSuites($productID, $sort, $pager, $type); if(empty($suites) and $pageID > 1) { $pager = pager::init(0, $recPerPage, 1); - $suites = $this->testsuite->getSuites($productID, $sort, $pager, 'all'); + $suites = $this->testsuite->getSuites($productID, $sort, $pager, $type); } $this->view->title = $productName . $this->lang->testsuite->common; @@ -89,6 +90,7 @@ class testsuite extends control $this->view->productName = $productName; $this->view->orderBy = $orderBy; $this->view->suites = $suites; + $this->view->type = $type; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->pager = $pager; $this->view->product = $this->product->getByID($productID); diff --git a/module/testsuite/lang/de.php b/module/testsuite/lang/de.php index e24e9142cf..87f5b051b0 100644 --- a/module/testsuite/lang/de.php +++ b/module/testsuite/lang/de.php @@ -54,3 +54,5 @@ $lang->testsuite->lblUnlinkCase = 'Unverknüpfte Fälle'; $lang->testsuite->authorList['private'] = 'Privat'; $lang->testsuite->authorList['public'] = 'Öffentlich'; + +$lang->testsuite->featureBar['browse']['all'] = 'Suite List'; diff --git a/module/testsuite/lang/en.php b/module/testsuite/lang/en.php index 013fe21932..ad27dd4346 100644 --- a/module/testsuite/lang/en.php +++ b/module/testsuite/lang/en.php @@ -54,3 +54,5 @@ $lang->testsuite->lblUnlinkCase = 'Unlink Case'; $lang->testsuite->authorList['private'] = 'Private'; $lang->testsuite->authorList['public'] = 'Public'; + +$lang->testsuite->featureBar['browse']['all'] = 'Suite List'; diff --git a/module/testsuite/lang/fr.php b/module/testsuite/lang/fr.php index 93538e4cbb..40d8c6b906 100644 --- a/module/testsuite/lang/fr.php +++ b/module/testsuite/lang/fr.php @@ -54,3 +54,5 @@ $lang->testsuite->lblUnlinkCase = 'Retirer CasTest'; $lang->testsuite->authorList['private'] = 'Privé'; $lang->testsuite->authorList['public'] = 'Public'; + +$lang->testsuite->featureBar['browse']['all'] = 'Suite List'; diff --git a/module/testsuite/lang/vi.php b/module/testsuite/lang/vi.php index f6d989ae25..f262b8932f 100644 --- a/module/testsuite/lang/vi.php +++ b/module/testsuite/lang/vi.php @@ -51,3 +51,5 @@ $lang->testsuite->lblUnlinkCase = 'Hủy liên kết tình huống'; $lang->testsuite->authorList['private'] = 'Riêng tư'; $lang->testsuite->authorList['public'] = 'Công khai'; + +$lang->testsuite->featureBar['browse']['all'] = 'Suite List'; diff --git a/module/testsuite/lang/zh-cn.php b/module/testsuite/lang/zh-cn.php index 114a225bcc..3ac13b0a20 100644 --- a/module/testsuite/lang/zh-cn.php +++ b/module/testsuite/lang/zh-cn.php @@ -54,3 +54,5 @@ $lang->testsuite->lblUnlinkCase = '移除用例'; $lang->testsuite->authorList['private'] = '私有'; $lang->testsuite->authorList['public'] = '公开'; + +$lang->testsuite->featureBar['browse']['all'] = '套件列表'; diff --git a/module/testsuite/model.php b/module/testsuite/model.php index cdce1bb6b3..0116a04688 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -99,6 +99,7 @@ class testsuiteModel extends model ->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testsuite != 'qa')->andWhere('project')->eq($this->session->project)->fi() ->andWhere('deleted')->eq(0) ->beginIF(strpos($param, 'all') === false)->andWhere("(`type` = 'public' OR (`type` = 'private' and addedBy = '{$this->app->user->account}'))")->fi() + ->beginIF(strpos($param, 'review') !== false)->andWhere("FIND_IN_SET('{$this->app->user->account}', `reviewers`)")->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php index b6d0ffc989..05d7aa1291 100644 --- a/module/testsuite/view/browse.html.php +++ b/module/testsuite/view/browse.html.php @@ -15,10 +15,16 @@ global->flow);?>