Merge branch 'zenops_46' of https://gitlab.zcorp.cc/easycorp/zentaopms into zenops_46

This commit is contained in:
caoyanyi
2022-12-12 08:29:34 +08:00
55 changed files with 924 additions and 285 deletions
+14 -10
View File
@@ -57,18 +57,22 @@ class hostHeartbeatEntry extends baseEntry
->set('zap')->eq($zap)
->where('id')->eq($id)->exec();
foreach($vms as $vm)
if($vms)
{
if(!empty($vm->vncPortOnHost))
foreach($vms as $vm)
{
$this->dao->update(TABLE_ZAHOST)
->set('vnc')->eq($vm->vncPortOnHost)
->set('zap')->eq($vm->agentPortOnHost)
->set('ztf')->eq($vm->ztfPortOnHost)
->set('zd')->eq($vm->zdPortOnHost)
->set('ssh')->eq($vm->sshPortOnHost)
->set('status')->eq($vm->status)
->where('mac')->eq($vm->macAddress)->exec();
if(!empty($vm->vncPortOnHost))
{
$this->dao->update(TABLE_ZAHOST)
->set('vnc')->eq($vm->vncPortOnHost)
->set('zap')->eq($vm->agentPortOnHost)
->set('ztf')->eq($vm->ztfPortOnHost)
->set('zd')->eq($vm->zdPortOnHost)
->set('ssh')->eq($vm->sshPortOnHost)
->set('status')->eq($vm->status)
->set('extranet')->eq($vm->ip)
->where('mac')->eq($vm->macAddress)->exec();
}
}
}
+9 -7
View File
@@ -46,26 +46,28 @@ class testcaseEntry extends entry
$oldCase = $this->loadModel('testcase')->getByID($caseID);
/* Set $_POST variables. */
$fields = 'title,pri,story,type,stage,product,module,branch,precondition';
$fields = 'title,pri,story,type,stage,product,module,branch,precondition,script';
$this->batchSetPost($fields, $oldCase);
if(isset($this->requestBody->script)) $this->setPost('auto', 'auto');
/* Set steps and expects. */
$steps = array();
$expects = array();
$stepType = array();
if(isset($this->requestBody->steps))
{
$steps = array();
$expects = array();
$stepType = array();
foreach($this->requestBody->steps as $step)
{
$steps[] = $step->desc;
$expects[] = $step->expect;
$stepType[] = 'item';
}
$this->setPost('steps', $steps);
$this->setPost('expects', $expects);
$this->setPost('stepType', $stepType);
}
$this->setPost('steps', $steps);
$this->setPost('expects', $expects);
$this->setPost('stepType', $stepType);
$control = $this->loadController('testcase', 'edit');
$control->edit($caseID);
+19 -6
View File
@@ -33,19 +33,19 @@ class zanodeHeartbeatEntry extends baseEntry
if(!$status || !$mac) return $this->sendError(400, 'Params error.');
$this->dao = $this->loadModel('common')->dao;
$hostID = $this->dao->select('id')->from(TABLE_ZAHOST)
$host = $this->dao->select('id,extranet')->from(TABLE_ZAHOST)
->beginIF($secret)->where('secret')->eq($secret)->fi()
->beginIF(!$secret)->where('tokenSN')->eq($token)
->andWhere('tokenTime')->gt($now)->fi()
->fetch('id');
if(!$hostID) return $this->sendError(400, 'Secret error.');
->fetch();
if(empty($host)) return $this->sendError(400, 'Secret error.');
$node = $this->dao->select('id')->from(TABLE_ZAHOST)
$node = $this->dao->select('id,parent')->from(TABLE_ZAHOST)
->where('mac')->eq($mac)
->fetch();
if(empty($node) || ($node->parent != $hostID || $node->id != $hostID)) return $this->sendError(400, 'Secret error.');
if(empty($node) || ($node->parent != $host->id && $node->id != $host->id)) return $this->sendError(400, 'Secret error.');
$node = new stdclass();
$node->zap = $this->requestBody->agentPortOnHost;
$node->status = $this->requestBody->status;
@@ -57,6 +57,19 @@ class zanodeHeartbeatEntry extends baseEntry
$this->dao->update(TABLE_ZAHOST)->data($node)->where('id')->eq($node->id)->exec();
if($secret)
{
//install services
$node->ip = $host->extranet;
$nodeStatus = $this->loadModel('zanode')->getServiceStatus($node);
if($nodeStatus['ZTF'] != "ready")
{
$node->secret = $secret;
$node->extranet = $host->extranet;
$this->loadModel('zanode')->installService($node, "ZTF");
}
}
if(!$secret) return $this->sendSuccess(200, 'success');
$node->tokenTimeUnix = strtotime($node->tokenTime);
+10 -8
View File
@@ -318,14 +318,16 @@ $filter->execution->export->cookie['checkedItem'] = 'reg::checked';
$filter->execution->kanban->cookie['taskToOpen'] = 'int';
$filter->execution->all->cookie['showExecutionBatchEdit'] = 'int';
$filter->testcase->browse->cookie['caseModule'] = 'int';
$filter->testcase->browse->cookie['caseSuite'] = 'int';
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
$filter->testcase->default->cookie['lastProduct'] = 'int';
$filter->testcase->default->cookie['preProductID'] = 'int';
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
$filter->testcase->browse->cookie['caseModule'] = 'int';
$filter->testcase->browse->cookie['caseSuite'] = 'int';
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
$filter->testcase->browse->cookie['showAutoCase'] = 'int';
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
$filter->testcase->default->cookie['lastProduct'] = 'int';
$filter->testcase->default->cookie['preProductID'] = 'int';
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
$filter->testcase->groupcase->cookie['showAutoCase'] = 'int';
$filter->testreport->default->cookie['lastProduct'] = 'int';
$filter->testreport->default->cookie['lastProject'] = 'int';
+1 -105
View File
@@ -1,3 +1,4 @@
ALTER TABLE `zt_case` ADD `script` longtext NOT NULL AFTER `howRun`;
ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`;
ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`;
ALTER table `zt_project` ADD `multiple` enum('0', '1') NOT NULL DEFAULT '1' AFTER `fluidBoard`;
@@ -7,109 +8,6 @@ ALTER TABLE `zt_release` CHANGE `branch` `branch` varchar(255) NOT NULL;
ALTER TABLE `zt_release` CHANGE `build` `build` varchar(255) NOT NULL;
ALTER TABLE `zt_release` ADD `shadow` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `branch`;
ALTER TABLE `zt_host`
DROP COLUMN `cabinet`,
DROP COLUMN `cpuRate`,
DROP COLUMN `diskType`,
DROP COLUMN `unit`,
DROP COLUMN `nic`,
DROP COLUMN `webserver`,
DROP COLUMN `database`,
DROP COLUMN `language`,
DROP COLUMN `instanceNum`,
DROP COLUMN `pri`,
DROP COLUMN `tags`,
DROP COLUMN `bridgeID`,
DROP COLUMN `cloudKey`,
DROP COLUMN `cloudSecret`,
DROP COLUMN `cloudRegion`,
DROP COLUMN `cloudNamespace`,
DROP COLUMN `cloudUser`,
DROP COLUMN `cloudAccount`,
DROP COLUMN `cloudPassword`,
DROP COLUMN `couldVPC`,
ADD COLUMN `name` varchar(255) NOT NULL DEFAULT '' AFTER `id`,
MODIFY COLUMN `type` varchar(30) NOT NULL DEFAULT 'normal' AFTER `name`,
MODIFY COLUMN `hostType` varchar(30) NOT NULL DEFAULT '' AFTER `type`,
MODIFY COLUMN `mac` varchar(128) NOT NULL AFTER `hostType`,
MODIFY COLUMN `memory` varchar(30) NOT NULL AFTER `mac`,
MODIFY COLUMN `diskSize` varchar(30) NOT NULL AFTER `memory`,
MODIFY COLUMN `status` varchar(50) NOT NULL AFTER `diskSize`,
MODIFY COLUMN `secret` varchar(50) NOT NULL DEFAULT '' AFTER `status`,
ADD COLUMN `desc` text NOT NULL AFTER `secret`,
CHANGE COLUMN `token` `tokenSN` varchar(50) NOT NULL DEFAULT '' AFTER `desc`,
CHANGE COLUMN `expiredDate` `tokenTime` datetime NOT NULL AFTER `tokenSN`,
CHANGE COLUMN `virtualSoftware` `vsoft` varchar(30) NOT NULL DEFAULT '' AFTER `tokenTime`,
CHANGE COLUMN `heartbeatTime` `heartbeat` datetime NOT NULL AFTER `vsoft`,
CHANGE COLUMN `agentPort` `zap` varchar(10) NOT NULL AFTER `heartbeat`,
MODIFY COLUMN `provider` varchar(255) NOT NULL DEFAULT '' AFTER `zap`,
ADD COLUMN `vnc` int(11) NOT NULL AFTER `provider`,
ADD COLUMN `ztf` int(11) NOT NULL AFTER `vnc`,
ADD COLUMN `zd` int(11) NOT NULL AFTER `ztf`,
ADD COLUMN `ssh` int(11) NOT NULL AFTER `zd`,
ADD COLUMN `parent` int(11) unsigned NOT NULL DEFAULT '0' AFTER `vnc`,
ADD COLUMN `image` int(11) unsigned NOT NULL DEFAULT '0' AFTER `parent`,
ADD COLUMN `group` varchar(128) NOT NULL DEFAULT '' AFTER `osVersion`,
ADD COLUMN `createdBy` varchar(30) NOT NULL,
ADD COLUMN `createdDate` datetime NOT NULL,
ADD COLUMN `editedBy` varchar(30) NOT NULL,
ADD COLUMN `editedDate` datetime NOT NULL,
ADD COLUMN `deleted` enum('0','1') NOT NULL DEFAULT '0',
CHANGE COLUMN `privateIP` `intranet` varchar(128) NOT NULL AFTER `cpuCores`,
CHANGE COLUMN `publicIP` `extranet` varchar(128) NOT NULL AFTER `intranet`;
UPDATE zt_host h,
zt_asset a
SET h.`name` = a.`name`,
h.`createdBy` = a.`createdBy`,
h.`createdDate` = a.`createdDate`,
h.`editedBy` = a.`editedBy`,
h.`editedDate` = a.`editedDate`,
h.`group` = a.`group`,
h.`type` = a.`type`,
h.`deleted` = a.`deleted`
WHERE
h.`assetID` = a.`id`;
ALTER TABLE `zt_host` DROP COLUMN `assetID`;
DROP TABLE IF EXISTS `zt_asset`;
DROP TABLE IF EXISTS `zt_baseimagebrowser`;
DROP TABLE IF EXISTS `zt_browser`;
DROP TABLE IF EXISTS `zt_baseimage`;
DROP TABLE IF EXISTS `zt_vmtemplate`;
DROP TABLE IF EXISTS `zt_vm`;
CREATE TABLE `zt_image` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`host` int(11) unsigned NOT NULL DEFAULT 0,
`name` varchar(64) NOT NULL DEFAULT '',
`address` varchar(64) NOT NULL DEFAULT '',
`path` varchar(64) NOT NULL DEFAULT '',
`status` varchar(20) NOT NULL DEFAULT '',
`osName` varchar(32) NOT NULL DEFAULT '',
`from` varchar(10) NOT NULL DEFAULT 'zentao',
`memory` float unsigned NOT NULL,
`disk` float unsigned NOT NULL,
`fileSize` float unsigned NOT NULL,
`md5` varchar(64) NOT NULL,
`desc` text NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `zt_automation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`node` int(11) unsigned NOT NULL DEFAULT 0,
`product` int(11) unsigned NOT NULL DEFAULT 0,
`scriptPath` varchar(255) NOT NULL DEFAULT '',
`shell` mediumtext NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES
@@ -145,5 +43,3 @@ ALTER TABLE `zt_build` ADD `builds` varchar(255) NOT NULL AFTER `execution`;
UPDATE `zt_block` SET block = 'scrumrisk' WHERE module = 'project' AND type = 'scrum' AND block = 'waterfallrisk';
UPDATE `zt_block` SET block = 'scrumissue' WHERE module = 'project' AND type = 'scrum' AND block = 'waterfallissue';
ALTER TABLE `zt_repofiles` ADD `oldPath` varchar(255) DEFAULT '' AFTER `path`;
+141
View File
@@ -0,0 +1,141 @@
ALTER TABLE `zt_story` ADD COLUMN `siblings` varchar(255) NOT NULL AFTER `linkRequirements`;
ALTER TABLE `zt_productplan` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0';
ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NOT NULL AFTER `end`;
ALTER TABLE `zt_build` MODIFY COLUMN `branch` varchar(255) NOT NULL DEFAULT '0';
ALTER TABLE `zt_host`
DROP COLUMN `cabinet`,
DROP COLUMN `cpuRate`,
DROP COLUMN `diskType`,
DROP COLUMN `unit`,
DROP COLUMN `nic`,
DROP COLUMN `webserver`,
DROP COLUMN `database`,
DROP COLUMN `language`,
DROP COLUMN `instanceNum`,
DROP COLUMN `pri`,
DROP COLUMN `tags`,
DROP COLUMN `bridgeID`,
DROP COLUMN `cloudKey`,
DROP COLUMN `cloudSecret`,
DROP COLUMN `cloudRegion`,
DROP COLUMN `cloudNamespace`,
DROP COLUMN `cloudUser`,
DROP COLUMN `cloudAccount`,
DROP COLUMN `cloudPassword`,
DROP COLUMN `couldVPC`,
ADD COLUMN `name` varchar(255) NOT NULL DEFAULT '' AFTER `id`,
MODIFY COLUMN `type` varchar(30) NOT NULL DEFAULT 'normal' AFTER `name`,
MODIFY COLUMN `hostType` varchar(30) NOT NULL DEFAULT '' AFTER `type`,
MODIFY COLUMN `mac` varchar(128) NOT NULL AFTER `hostType`,
MODIFY COLUMN `memory` varchar(30) NOT NULL AFTER `mac`,
MODIFY COLUMN `diskSize` varchar(30) NOT NULL AFTER `memory`,
MODIFY COLUMN `status` varchar(50) NOT NULL AFTER `diskSize`,
MODIFY COLUMN `secret` varchar(50) NOT NULL DEFAULT '' AFTER `status`,
ADD COLUMN `desc` text NOT NULL AFTER `secret`,
CHANGE COLUMN `token` `tokenSN` varchar(50) NOT NULL DEFAULT '' AFTER `desc`,
CHANGE COLUMN `expiredDate` `tokenTime` datetime NOT NULL AFTER `tokenSN`,
CHANGE COLUMN `virtualSoftware` `vsoft` varchar(30) NOT NULL DEFAULT '' AFTER `tokenTime`,
CHANGE COLUMN `heartbeatTime` `heartbeat` datetime NOT NULL AFTER `vsoft`,
CHANGE COLUMN `agentPort` `zap` varchar(10) NOT NULL AFTER `heartbeat`,
MODIFY COLUMN `provider` varchar(255) NOT NULL DEFAULT '' AFTER `zap`,
ADD COLUMN `vnc` int(11) NOT NULL AFTER `provider`,
ADD COLUMN `ztf` int(11) NOT NULL AFTER `vnc`,
ADD COLUMN `zd` int(11) NOT NULL AFTER `ztf`,
ADD COLUMN `ssh` int(11) NOT NULL AFTER `zd`,
ADD COLUMN `parent` int(11) unsigned NOT NULL DEFAULT '0' AFTER `vnc`,
ADD COLUMN `image` int(11) unsigned NOT NULL DEFAULT '0' AFTER `parent`,
ADD COLUMN `group` varchar(128) NOT NULL DEFAULT '' AFTER `osVersion`,
ADD COLUMN `createdBy` varchar(30) NOT NULL,
ADD COLUMN `createdDate` datetime NOT NULL,
ADD COLUMN `editedBy` varchar(30) NOT NULL,
ADD COLUMN `editedDate` datetime NOT NULL,
ADD COLUMN `deleted` enum('0','1') NOT NULL DEFAULT '0',
CHANGE COLUMN `privateIP` `intranet` varchar(128) NOT NULL AFTER `cpuCores`,
CHANGE COLUMN `publicIP` `extranet` varchar(128) NOT NULL AFTER `intranet`;
UPDATE zt_host h,
zt_asset a
SET h.`name` = a.`name`,
h.`createdBy` = a.`createdBy`,
h.`createdDate` = a.`createdDate`,
h.`editedBy` = a.`editedBy`,
h.`editedDate` = a.`editedDate`,
h.`group` = a.`group`,
h.`type` = a.`type`,
h.`deleted` = a.`deleted`
WHERE
h.`assetID` = a.`id`;
ALTER TABLE `zt_host` DROP COLUMN `assetID`;
DROP TABLE IF EXISTS `zt_asset`;
DROP TABLE IF EXISTS `zt_baseimagebrowser`;
DROP TABLE IF EXISTS `zt_browser`;
DROP TABLE IF EXISTS `zt_baseimage`;
DROP TABLE IF EXISTS `zt_vmtemplate`;
DROP TABLE IF EXISTS `zt_vm`;
CREATE TABLE `zt_image` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`host` int(11) unsigned NOT NULL DEFAULT 0,
`name` varchar(64) NOT NULL DEFAULT '',
`address` varchar(64) NOT NULL DEFAULT '',
`path` varchar(64) NOT NULL DEFAULT '',
`status` varchar(20) NOT NULL DEFAULT '',
`osName` varchar(32) NOT NULL DEFAULT '',
`from` varchar(10) NOT NULL DEFAULT 'zentao',
`memory` float unsigned NOT NULL,
`disk` float unsigned NOT NULL,
`fileSize` float unsigned NOT NULL,
`md5` varchar(64) NOT NULL,
`desc` text NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `zt_automation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`node` int(11) unsigned NOT NULL DEFAULT 0,
`product` int(11) unsigned NOT NULL DEFAULT 0,
`scriptPath` varchar(255) NOT NULL DEFAULT '',
`shell` mediumtext NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES
('product-progress', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u5b8c\\u6210\\u5ea6\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u5b8c\\u6210\\u5ea6\\u7d71\\u8a08\\u8868\",\"en\":\"Product Progress\",\"de\":\"Product Progress\",\"fr\":\"Product Progress\"}', ',product', 'select t1.*,t2.name, (case when t1.status = \'closed\' or t1.stage = \'released\' then 1 else 0 end) as done, 1 as count from TABLE_STORY as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"count\",\"done\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"count\",\"done\"],\"percent\":{\"1\":\"1\"},\"contrast\":{\"1\":\"count\"},\"showAlone\":{\"1\":\"1\"}}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u603b\\u6570(\\u72b6\\u6001\\u662f\\u5173\\u95ed\\uff0c\\u6216\\u8005\\u7814\\u53d1\\u9636\\u6bb5\\u662f\\u53d1\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u7e3d\\u6578(\\u72c0\\u614b\\u662f\\u95dc\\u9589\\uff0c\\u6216\\u8005\\u7814\\u767c\\u968e\\u6bb5\\u662f\\u767c\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"en\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\",\"de\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\",\"fr\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\"}', 'admin', '2015-07-21 15:07:48'),
('story-status', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Story Status\",\"de\":\"Story Status\",\"fr\":\"Story Status\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u72b6\\u6001\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u72c0\\u614b\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and status distribution of stories.\",\"de\":\"Total number and status distribution of stories.\",\"fr\":\"Total number and status distribution of stories.\"}', 'admin', '2015-07-21 15:35:38'),
('story-stage', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Story Stage\",\"de\":\"Story Stage\",\"fr\":\"Story Stage\"}', ',product', 'select t1.*,t2.name from TABLE_STORY as t1\r\n left join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u7814\\u53d1\\u9636\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u7814\\u767c\\u968e\\u6bb5\\u7684\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Total number and stage distribution of stories \",\"de\":\"Total number and stage distribution of stories \",\"fr\":\"Total number and stage distribution of stories \"}', 'admin', '2015-07-21 15:38:34'),
('product-release', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u53d1\\u5e03\\u6570\\u91cf\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u767c\\u5e03\\u6578\\u91cf\\u7d71\\u8a08\\u8868\",\"en\":\"Product Release\",\"de\":\"Product Release\",\"fr\":\"Product Release\"}', ',product', 'select t2.name, 1 as releases from TABLE_RELEASE as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"releases\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"releases\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u53d1\\u5e03\\u7684\\u6570\\u91cf\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u767c\\u5e03\\u7684\\u6578\\u91cf\\u3002\",\"en\":\"Product Release.\",\"de\":\"Product Release.\",\"fr\":\"Product Release.\"}', 'admin', '2015-07-21 16:00:52'),
('task-status', '{\"zh-cn\":\"\\u4efb\\u52a1\\u72b6\\u6001\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u72c0\\u614b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Status Report\",\"de\":\"Task Status Report\",\"fr\":\"Task Status Report\",\"vi\":\"Task Status Report\",\"ja\":\"Task Status Report\"}', ',project', 'select t1.id,t3.name as project,t1.name,t2.status,IF(t3.multiple="1",t1.name,"") as execution,t2.id as taskID, t1.status as projectstatus, (case when t2.deadline < CURDATE() and t2.deadline != \'0000-00-00\' and t2.status != \'closed\' and t2.status != \'done\' and t2.status != \'cancel\' then 1 else 0 end) as timeout from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u6267\\u884c\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u57f7\\u884c\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 11:28:33'),
('task-type', '{\"zh-cn\":\"\\u4efb\\u52a1\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u4efb\\u52d9\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Task Type Report\",\"de\":\"Task Type Report\",\"fr\":\"Task Type Report\",\"vi\":\"Task Type Report\",\"ja\":\"Task Type Report\"}', ',project', 'select t1.id,t3.name as project,IF(t3.multiple="1",t1.name,"") as execution,t2.type,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:06:46'),
('task-assign', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u6307\\u6d3e\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u6307\\u6d3e\\u7d71\\u8a08\\u8868\",\"en\":\"Task Assign Report\",\"de\":\"Task Assign Report\",\"fr\":\"Task Assign Report\",\"vi\":\"Task Assign Report\",\"ja\":\"Task Assign Report\"}', ',project', 'select t1.id,t4.name as project,IF(t4.multiple="1",t1.name,"") as execution,if(t3.account is not null, t3.account,t2.assignedTo) as assignedTo,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1\r\n left join TABLE_TASK as t2 on t1.id=t2.execution\r\n left join TABLE_TEAM as t3 on t3.type=\'task\' && t3.root=t2.id \r\nleft join TABLE_PROJECT as t4 on t1.project=t4.id\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and if($project=\'\',1,t4.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"assignedTo\":{\"zh-cn\":\"\\u6307\\u6d3e\\u7ed9\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:13:28'),
('task-finish', '{\"zh-cn\":\"\\u9879\\u76ee\\u4efb\\u52a1\\u5b8c\\u6210\\u8005\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u4efb\\u52d9\\u5b8c\\u6210\\u8005\\u7d71\\u8a08\\u8868\",\"en\":\"Task Finish Report\",\"de\":\"Task Finish Report\",\"fr\":\"Task Finish Report\",\"vi\":\"Task Finish Report\",\"ja\":\"Task Finish Report\"}', ',project', 'select t1.id,t3.name as project,IF(t3.multiple="1",t1.name,"") as execution,t2.finishedBy,t2.id as taskID, t1.status as projectstatus from TABLE_EXECUTION as t1 \r\nleft join TABLE_TASK as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t1.project=t3.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t2.deleted=\'0\' and t2.finishedBy!=\'\' and if($project=\'\',1,t3.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"finishedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u4efb\\u52a1\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u4efb\\u52d9\\u7684\\u5b8c\\u6210\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 13:16:21'),
('project-invest', '{\"zh-cn\":\"\\u9879\\u76ee\\u6295\\u5165\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u6295\\u5165\\u7d71\\u8a08\\u8868\",\"en\":\"Project Invest Report\",\"de\":\"Project Invest Report\",\"fr\":\"Project Invest Report\",\"vi\":\"Project Invest Report\",\"ja\":\"Project Invest Report\"}', ',project', 'select t1.id,t5.name as project,IF(t5.multiple="1",t1.name,"") as execution,CONCAT(t1.begin,\' ~ \',t1.end) as timeLimit,t2.teams,t3.stories,round(t4.consumed,1) as consumed,t4.number, t1.status as projectstatus \r\nfrom TABLE_EXECUTION as t1\r\n left join ztv_projectteams as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\n left join ztv_executionsummary as t4 on t1.id=t4.execution \r\nleft join TABLE_PROJECT as t5 on t1.project=t5.id \r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t5.id=$project) and if($status=\'\',1,t1.status=$status) and if($beginDate=\'\',1,t1.begin>=$beginDate) and if($endDate=\'\',1,t1.end<=$endDate)', '{\"varName\":[\"project\",\"status\",\"beginDate\",\"endDate\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\",\"\\u6267\\u884c\\u8d77\\u59cb\\u65e5\\u671f\",\"\\u6267\\u884c\\u7ed3\\u675f\\u65e5\\u671f\"],\"requestType\":[\"select\",\"select\",\"date\",\"date\"],\"selectList\":[\"project\",\"project.status\",\"user\",\"user\"],\"default\":[\"\",\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"timeLimit\":{\"zh-cn\":\"\\u5de5\\u671f\"},\"teams\":{\"zh-cn\":\"\\u4eba\\u6570\"},\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\"},\"consumed\":{\"zh-cn\":\"\\u603b\\u6d88\\u8017\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"number\",\"stories\",\"teams\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"number\",\"stories\",\"teams\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52a1\\u6570\\uff0c\\u9700\\u6c42\\u6570\\uff0c\\u4eba\\u6570\\uff0c\\u603b\\u6d88\\u8017\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u5217\\u51fa\\uff1a\\u4efb\\u52d9\\u6578\\uff0c\\u9700\\u6c42\\u6578\\uff0c\\u4eba\\u6578\\uff0c\\u7e3d\\u6d88\\u8017\\u5de5\\u6642\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-22 16:37:38'),
('projectstory-status', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Story Status\",\"de\":\"Project Story Status\",\"fr\":\"Project Story Status\",\"vi\":\"Project Story Status\",\"ja\":\"Project Story Status\"}', ',project', 'select t2.id, t4.name as project,IF(t4.multiple="1",t2.name,"") as execution,t3.status from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:35:08'),
('project-stage', '{\"zh-cn\":\"\\u9879\\u76ee\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u8868\",\"en\":\"Project Stage Report\",\"de\":\"Project Stage Report\",\"fr\":\"Project Stage Report\",\"vi\":\"Project Stage Report\",\"ja\":\"Project Stage Report\"}', ',project', 'select t2.id, t4.name as project,IF(t4.multiple="1",t2.name,"") as execution,t3.stage from TABLE_PROJECTSTORY as t1 \r\nleft join TABLE_EXECUTION as t2 on t1.project=t2.id \r\nleft join TABLE_STORY as t3 on t1.story=t3.id \r\nleft join TABLE_PROJECT as t4 on t4.id=t2.project\r\nwhere t2.deleted=\'0\' and t2.type in(\'sprint\', \'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t2.id=$execution) and if($status=\'\',1,t2.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stage\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1\\u9700\\u6c42\\u9636\\u6bb5\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08\\u9700\\u6c42\\u968e\\u6bb5\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:38:18'),
('projectbug-resolution', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolution\",\"de\":\"Project Bug Resolution\",\"fr\":\"Project Bug Resolution\",\"vi\":\"Project Bug Resolution\",\"ja\":\"Project Bug Resolution\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t1.id as bugID,t2.resolution from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\n where t1.deleted=\'0\' and t2.deleted=\'0\' and t2.resolution!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u65b9\\u6848\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:04:46'),
('projectbug-status', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u72b6\\u6001\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u72c0\\u614b\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Status\",\"de\":\"Project Bug Status\",\"fr\":\"Project Bug Status\",\"vi\":\"Project Bug Status\",\"ja\":\"Project Bug Status\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t1.id as bugID,t2.status from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\' \' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"status\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u72b6\\u6001\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u72c0\\u614b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 15:48:03'),
('projectbug-opened', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Opened\",\"de\":\"Project Bug Opened\",\"fr\":\"Project Bug Opened\",\"vi\":\"Project Bug Opened\",\"ja\":\"Project Bug Opened\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t1.id as bugID,t2.openedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"openedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u521b\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u5275\\u5efa\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:08:10'),
('projectbug-resolve', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Resolve\",\"de\":\"Project Bug Resolve\",\"fr\":\"Project Bug Resolve\",\"vi\":\"Project Bug Resolve\",\"ja\":\"Project Bug Resolve\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t1.id as bugID,t2.resolvedBy from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and t2.status!=\'active\' and t2.resolvedBy!=\'\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"resolvedBy\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u89e3\\u51b3\\u8005\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u89e3\\u6c7a\\u8005\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:13:16'),
('projectbug-assign', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u8868\",\"en\":\"Project Bug Assign\",\"de\":\"Project Bug Assign\",\"fr\":\"Project Bug Assign\",\"vi\":\"Project Bug Assign\",\"ja\":\"Project Bug Assign\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t1.id as bugID,t2.assignedTo from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution \r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' having bugID!=\'\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"assignedTo\"],\"isUser\":{\"reportField\":[[\"1\"]]},\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u6307\\u6d3e\\u7ed9\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u6307\\u6d3e\\u7d66\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 16:29:10'),
('project-quality', '{\"zh-cn\":\"\\u9879\\u76ee\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u8cea\\u91cf\\u8868\",\"en\":\"Project Quality Report\",\"de\":\"Project Quality Report\",\"fr\":\"Project Quality Report\",\"vi\":\"Project Quality Report\",\"ja\":\"Project Quality Report\"}', ',project', 'select t1.id, t5.name as project,t5.id,IF(t5.multiple="1",t1.name,"") as execution,t2.stories,(t2.stories-t2.undone) as doneStory,t3.number,(t3.number-t3.undone) as doneTask,t4.bugs,t4.resolutions, round(t4.bugs/(t2.stories-t2.undone),2) as bugthanstory,round(t4.bugs/(t3.number-t3.undone),2) as bugthantask,t4.seriousBugs from TABLE_EXECUTION as t1 \r\nleft join ztv_projectstories as t2 on t1.id=t2.execution\r\nleft join ztv_executionsummary as t3 on t1.id=t3.execution\r\nleft join ztv_projectbugs as t4 on t1.id=t4.execution\r\nleft join TABLE_PROJECT as t5 on t5.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and t1.grade=\'1\' and if($project=\'\',1,t5.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\"},\"number\":{\"zh-cn\":\"\\u4efb\\u52a1\\u603b\\u6570\"},\"doneTask\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\"},\"bugthantask\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u4efb\\u52a1\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdBug\\u6bd4\\u7387\"},\"project\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"number\",\"doneTask\",\"bugs\",\"resolutions\",\"bugthanstory\",\"bugthantask\",\"seriousBugs\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52a1\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3\\uff09\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0cBug\\/\\u4efb\\u52d9\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3\\uff09\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 17:03:10'),
('productbug-type', '{\"zh-cn\":\"\\u4ea7\\u54c1Bug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1Bug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Bug Type of Product\",\"de\":\"Bug Type of Product\",\"fr\":\"Bug Type of Product\"}', ',product,test', 'select t1.id,t1.name,t2.id as bugID,t2.type from TABLE_PRODUCT as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.product \r\nleft join TABLE_PROGRAM as t3 on t1.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t1.line desc, t1.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"Type distribution of Bugs.\",\"de\":\"Type distribution of Bugs.\",\"fr\":\"Type distribution of Bugs.\"}', 'admin', '2015-07-24 13:48:22'),
('product-quality', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u8d28\\u91cf\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u8cea\\u91cf\\u8868\",\"en\":\"Product Quality\",\"de\":\"Product Quality\",\"fr\":\"Product Quality\"}', ',product', 'select t1.id,t1.name,t2.stories,(t2.stories-t2.undone) as doneStory,t3.bugs,t3.resolutions,round(t3.bugs/(t2.stories-t2.undone),2) as bugthanstory,t3.seriousBugs from TABLE_PRODUCT as t1 \r\nleft join ztv_productstories as t2 on t1.id=t2.product \r\nleft join ztv_productbugs as t3 on t1.id=t3.product \r\nleft join TABLE_PROGRAM as t4 on t1.program=t4.id \r\nwhere t1.deleted=\'0\'\r\norder by t4.`order` asc, t1.line desc, t1.`order` asc', '', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u603b\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u603b\\u6570\",\"en\":\"Stories\"},\"doneStory\":{\"zh-cn\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"en\":\"Finished Stories\"},\"bugs\":{\"zh-cn\":\"Bug\\u6570\",\"zh-tw\":\"Bug\\u6570\",\"en\":\"Bugs\"},\"resolutions\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6570\",\"en\":\"Solved Bugs\"},\"bugthanstory\":{\"zh-cn\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"zh-tw\":\"Bug\\/\\u5b8c\\u6210\\u9700\\u6c42\",\"en\":\"Bug\\/Finished Story\"},\"seriousBugs\":{\"zh-cn\":\"\\u91cd\\u8981Bug\\u6570\",\"zh-tw\":\"\\u91cd\\u8981Bug\\u6570\",\"en\":\"Serious Bugs\"},\"seriousBugsPercent\":{\"zh-cn\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"zh-tw\":\"\\u4e25\\u91cdbug\\u6bd4\\u7387\",\"en\":\"Serious Bugs %\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"doneStory\",\"bugs\",\"resolutions\",\"bugthanstory\",\"seriousBugs\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"bugs\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u4ea7\\u54c1\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u603b\\u6570\\uff0cBug\\u6570\\uff0c\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6570\\u91cf(\\u4e25\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u4e8e3)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u7522\\u54c1\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u9700\\u6c42\\u7e3d\\u6578\\uff0cBug\\u6578\\uff0c\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0cBug\\/\\u9700\\u6c42\\uff0c\\u91cd\\u8981Bug\\u6578\\u91cf(\\u56b4\\u91cd\\u7a0b\\u5ea6\\u4e0d\\u5927\\u65bc3)\\u3002\",\"en\":\"Serious Bug (severity is less than 3).\",\"de\":\"Serious Bug (severity is less than 3).\",\"fr\":\"Serious Bug (severity is less than 3).\"}', 'admin', '2015-07-23 17:17:40'),
('user-login', '{\"zh-cn\":\"\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u8868\",\"en\":\"Login Times\",\"de\":\"Login Times\",\"fr\":\"Login Times\"}', ',staff', 'select actor,LEFT(`date`,10) as `day` from TABLE_ACTION where `action`=\'login\' and if($startDate=\'\',1,`date`>=$startDate) and if($endDate=\'\',1,`date`<=$endDate) order by `date` asc, actor asc', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"actor\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"day\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5b9e\\u73b0\\u5458\\u5de5\\u767b\\u5f55\\u6b21\\u6570\\u7edf\\u8ba1\\u62a5\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7edf\\u8ba1\\u6bcf\\u5929\\u6bcf\\u4e2a\\u4eba\\u7684\\u767b\\u5f55\\u6b21\\u6570\\uff0c\\u4ee5\\u53ca\\u603b\\u6570\\u3002\",\"zh-tw\":\"\\u5be6\\u73fe\\u54e1\\u5de5\\u767b\\u9304\\u6b21\\u6578\\u7d71\\u8a08\\u5831\\u8868\\uff0c\\u6309\\u7167\\u5929\\u7d71\\u8a08\\u6bcf\\u5929\\u6bcf\\u500b\\u4eba\\u7684\\u767b\\u9304\\u6b21\\u6578\\uff0c\\u4ee5\\u53ca\\u7e3d\\u6578\\u3002\",\"en\":\"The summary of user login times.\",\"de\":\"The summary of user login times.\",\"fr\":\"The summary of user login times.\"}', 'admin', '2015-07-24 14:28:11'),
('effort', '{\"zh-cn\":\"\\u65e5\\u5fd7\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u65e5\\u8a8c\\u532f\\u7e3d\\u8868\",\"en\":\"Effort Summary\",\"de\":\"Effort Summary\",\"fr\":\"Effort Summary\"}', ',staff', 'select t1.account,t1.consumed,t1.`date`,if($dept=\'0\',0,t2.dept) as dept from TABLE_EFFORT as t1 left join TABLE_USER as t2 on t1.account=t2.account where t1.`deleted`=\'0\' and if($startDate=\'\',1,t1.`date`>=$startDate) and if($endDate=\'\',1,t1.`date`<=$endDate) having dept=$dept order by `date` asc', '{\"varName\":[\"dept\",\"startDate\",\"endDate\"],\"showName\":[\"\\u90e8\\u95e8\",\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"dept\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"date\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"consumed\":{\"zh-cn\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost\"}}', '{\"group1\":\"account\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"date\"],\"reportType\":[\"sum\"],\"sumAppend\":[\"consumed\"]}', 2, '{\"zh-cn\":\"\\u67e5\\u770b\\u67d0\\u4e2a\\u65f6\\u95f4\\u6bb5\\u5185\\u7684\\u65e5\\u5fd7\\u60c5\\u51b5\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u95e8\\u9009\\u62e9\\u3002\",\"zh-tw\":\"\\u67e5\\u770b\\u67d0\\u500b\\u6642\\u9593\\u6bb5\\u5167\\u7684\\u65e5\\u8a8c\\u60c5\\u6cc1\\uff0c\\u53ef\\u4ee5\\u6309\\u7167\\u90e8\\u9580\\u9078\\u64c7\\u3002\",\"en\":\"Effort summary of users.\",\"de\":\"Effort summary of users\",\"fr\":\"Effort summary of users\"}', 'admin', '2015-07-27 13:53:32'),
('company-dynamic', '{\"zh-cn\":\"\\u516c\\u53f8\\u52a8\\u6001\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\\u516c\\u53f8\\u52d5\\u614b\\u532f\\u7e3d\\u8868\",\"en\":\"Company Dynamics\",\"de\":\"Company Dynamics\",\"fr\":\"Company Dynamics\"}', ',staff', 'select t1.day,t2.userlogin,t3.consumed,t4.storyopen,t5.storyclose,t6.taskopen,t7.taskfinish,t8.bugopen,t9.bugresolve,t1.actions from ztv_dayactions as t1 left join ztv_dayuserlogin as t2 on t1.day=t2.day left join ztv_dayeffort as t3 on t1.day=t3.date left join ztv_daystoryopen as t4 on t1.day=t4.day left join ztv_daystoryclose as t5 on t1.day=t5.day left join ztv_daytaskopen as t6 on t1.day=t6.day left join ztv_daytaskfinish as t7 on t1.day=t7.day left join ztv_daybugopen as t8 on t1.day=t8.day left join ztv_daybugresolve as t9 on t1.day=t9.day where if($startDate=\'\',1,t1.day>=$startDate) and if($endDate=\'\',1,t1.day<=$endDate)', '{\"varName\":[\"startDate\",\"endDate\"],\"showName\":[\"\\u8d77\\u59cb\\u65f6\\u95f4\",\"\\u7ed3\\u675f\\u65f6\\u95f4\"],\"requestType\":[\"date\",\"date\"],\"selectList\":[\"user\",\"user\"],\"default\":[\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"day\":{\"zh-cn\":\"\\u65e5\\u671f\",\"zh-tw\":\"\\u65e5\\u671f\",\"en\":\"Date\"},\"userlogin\":{\"zh-cn\":\"\\u767b\\u5f55\\u6b21\\u6570\",\"zh-tw\":\"\\u767b\\u9304\\u6b21\\u6578\",\"en\":\"Login\"},\"consumed\":{\"zh-cn\":\"\\u65e5\\u5fd7\\u5de5\\u65f6\",\"zh-tw\":\"\\u65e5\\u8a8c\\u5de5\\u6642\",\"en\":\"Cost(h)\"},\"storyopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u9700\\u6c42\\u6578\",\"en\":\"Open Story\"},\"storyclose\":{\"zh-cn\":\"\\u5173\\u95ed\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u95dc\\u9589\\u9700\\u6c42\\u6578\",\"en\":\"Closed Story\"},\"taskopen\":{\"zh-cn\":\"\\u65b0\\u589e\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u65b0\\u589e\\u4efb\\u52d9\\u6578\",\"en\":\"Open Task\"},\"taskfinish\":{\"zh-cn\":\"\\u5b8c\\u6210\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u4efb\\u52d9\\u6578\",\"en\":\"Finished Task\"},\"bugopen\":{\"zh-cn\":\"\\u65b0\\u589eBug\\u6570\",\"zh-tw\":\"\\u65b0\\u589eBug\\u6578\",\"en\":\"Open Bug\"},\"bugresolve\":{\"zh-cn\":\"\\u89e3\\u51b3Bug\\u6570\",\"zh-tw\":\"\\u89e3\\u51b3Bug\\u6578\",\"en\":\"Resolved bug\"},\"actions\":{\"zh-cn\":\"\\u52a8\\u6001\\u6570\",\"zh-tw\":\"\\u52d5\\u614b\\u6578\",\"en\":\"Dynamics\"}}', '{\"group1\":\"day\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"userlogin\",\"consumed\",\"storyopen\",\"storyclose\",\"taskopen\",\"taskfinish\",\"bugopen\",\"bugresolve\",\"actions\"]}', 2, '{\"zh-cn\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u4e2a\\u65f6\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u5e94\\u7684\\u6570\\u636e\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u5f55\\u6b21\\u6570\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u5fd7\\u5de5\\u65f6\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6570\\u30024. \\u6bcf\\u5929\\u5173\\u95ed\\u7684\\u9700\\u6c42\\u6570\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52a1\\u6570\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52a1\\u6570\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6570\\u30028. \\u6bcf\\u5929\\u89e3\\u51b3\\u7684Bug\\u6570\\u30029. \\u6bcf\\u5929\\u7684\\u52a8\\u6001\\u6570\\u3002\",\"zh-tw\":\"\\u53ef\\u4ee5\\u6307\\u5b9a\\u4e00\\u500b\\u6642\\u671f\\uff0c\\u5217\\u51fa\\u76f8\\u61c9\\u7684\\u6578\\u64da\\uff1a1. \\u6bcf\\u5929\\u7684\\u767b\\u9304\\u6b21\\u6578\\u30022. \\u6bcf\\u5929\\u7684\\u65e5\\u8a8c\\u5de5\\u6642\\u91cf\\u30023. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u9700\\u6c42\\u6578\\u30024. \\u6bcf\\u5929\\u95dc\\u9589\\u7684\\u9700\\u6c42\\u6578\\u30025. \\u6bcf\\u5929\\u65b0\\u589e\\u7684\\u4efb\\u52d9\\u6578\\u30026. \\u6bcf\\u5929\\u5b8c\\u6210\\u7684\\u4efb\\u52d9\\u6578\\u30027. \\u6bcf\\u5929\\u65b0\\u589e\\u7684Bug\\u6578\\u30028. \\u6bcf\\u5929\\u89e3\\u6c7a\\u7684Bug\\u6578\\u30029. \\u6bcf\\u5929\\u7684\\u52d5\\u614b\\u6578\\u3002\",\"en\":\"The summary of company dynamics\",\"de\":\"The summary of company dynamics\",\"fr\":\"The summary of company dynamics\"}', 'admin', '2015-07-27 15:09:42'),
('bug-resolve', '{\"zh-cn\":\"Bug\\u89e3\\u51b3\\u8868\",\"zh-tw\":\"Bug\\u89e3\\u6c7a\\u8868\",\"en\":\"Solved Bugs\",\"de\":\"Solved Bugs\",\"fr\":\"Solved Bugs\"}', ',test', 'select *,if($product=\'\',0,product) as customproduct from TABLE_BUG where deleted=\'0\' and resolution!=\'\' and if($startDate=\'\',1,resolvedDate>=$startDate) and if($endDate=\'\',1,resolvedDate<=$endDate) having customproduct=$product', '{\"varName\":[\"product\",\"startDate\",\"endDate\"],\"showName\":[\"\\u4ea7\\u54c1\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u5f00\\u59cb\",\"\\u89e3\\u51b3\\u65e5\\u671f\\u7ed3\\u675f\"],\"requestType\":[\"select\",\"date\",\"date\"],\"selectList\":[\"product\",\"user\",\"user\"],\"default\":[\"\",\"$MONTHBEGIN\",\"$MONTHEND\"]}', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"resolvedBy\",\"isUser\":{\"group1\":[\"1\"]},\"group2\":\"\",\"reportField\":[\"resolution\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"],\"reportTotal\":[\"1\"],\"percent\":[\"1\"],\"contrast\":[\"crystalTotal\"],\"showAlone\":[\"1\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u89e3\\u51b3\\u7684Bug\\u603b\\u6570\\uff0c\\u89e3\\u51b3\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8be5\\u7528\\u6237\\u89e3\\u51b3\\u7684Bug\\u7684\\u6570\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u51b3\\u7684Bug\\u7684\\u6570\\u91cf)\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u89e3\\u6c7a\\u7684Bug\\u7e3d\\u6578\\uff0c\\u89e3\\u6c7a\\u65b9\\u6848\\u7684\\u5206\\u5e03\\uff0c\\u5360\\u7684\\u6bd4\\u4f8b\\uff08\\u8a72\\u7528\\u6236\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf\\u5360\\u6240\\u6709\\u7684\\u89e3\\u6c7a\\u7684Bug\\u7684\\u6578\\u91cf)\\u3002\",\"en\":\"percentage:self resolved \\/ all resolved\",\"de\":\"percentage:self resolved \\/ all resolved\",\"fr\":\"percentage:self resolved \\/ all resolved\"}', 'admin', '2015-07-24 13:44:25'),
('project-progress', '{\"zh-cn\":\"\\u9879\\u76ee\\u8fdb\\u5c55\\u8868\",\"zh-tw\":\"\\u9805\\u76ee\\u9032\\u5c55\\u8868\",\"en\":\"Project Progress Report\",\"de\":\"Project Progress Report\",\"fr\":\"Project Progress Report\",\"vi\":\"Project Progress Report\",\"ja\":\"Project Progress Report\"}', ',project', 'select t1.id,t4.name as project,t4.id,IF(t4.multiple="1",t1.name,"") as execution,t1.status,t2.number as tasks,round(t2.consumed,2) as consumed,round(t2.`left`,2) as `left`,t3.stories,t2.undone as undoneTask,t3.undone as undoneStory,t2.totalReal from TABLE_EXECUTION as t1 \r\nleft join ztv_executionsummary as t2 on t1.id=t2.execution\r\nleft join ztv_projectstories as t3 on t1.id=t3.execution\r\nleft join TABLE_PROJECT as t4 on t4.id=t1.project\r\nwhere t1.deleted=\'0\' and t1.type in (\'sprint\',\'stage\') and if($project=\'\',1,t4.id=$project) and if($execution=\'\',1,t1.id=$execution) and if($status=\'\',1,t1.status=$status)', '{\"varName\":[\"project\",\"execution\",\"status\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\",\"\\u6267\\u884c\\u72b6\\u6001\"],\"requestType\":[\"select\",\"select\",\"select\"],\"selectList\":[\"project\",\"execution\",\"project.status\"],\"default\":[\"\",\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"reportType\":[\"sum\",\"sum\",\"sum\",\"sum\",\"sum\",\"sum\"],\"sumAppend\":[\"stories\",\"undoneStory\",\"tasks\",\"undoneTask\",\"left\",\"consumed\"],\"percent\":{\"5\":\"1\"},\"contrast\":{\"5\":\"totalReal\"},\"showAlone\":{\"5\":\"1\"}}', 2, '{\"zh-cn\":\"\\u9879\\u76ee\\u7684\\u9700\\u6c42\\u6570\\uff0c\\u4efb\\u52a1\\u6570\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u5de5\\u65f6\\uff0c\\u5269\\u4f59\\u9700\\u6c42\\u6570\\uff0c\\u5269\\u4f59\\u4efb\\u52a1\\u6570\\uff0c\\u8fdb\\u5ea6\\u3002\",\"zh-tw\":\"\\u9805\\u76ee\\u7684\\u9700\\u6c42\\u6578\\uff0c\\u4efb\\u52d9\\u6578\\uff0c\\u5df2\\u6d88\\u8017\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u5de5\\u6642\\uff0c\\u5269\\u9918\\u9700\\u6c42\\u6578\\uff0c\\u5269\\u9918\\u4efb\\u52d9\\u6578\\uff0c\\u9032\\u5ea6\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-07-23 14:03:06'),
('projectbug-type', '{\"zh-cn\":\"\\u9879\\u76eeBug\\u7c7b\\u578b\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u9805\\u76eeBug\\u985e\\u578b\\u7d71\\u8a08\\u8868\",\"en\":\"Project Bug Type\",\"de\":\"Project Bug Type\",\"fr\":\"Project Bug Type\",\"vi\":\"Project Bug Type\",\"ja\":\"Project Bug Type\"}', ',project,test', 'select t1.id,t3.name as project,t3.id,IF(t3.multiple="1",t1.name,"") as execution,t2.id as bugID,t2.type from TABLE_EXECUTION as t1 \r\nleft join TABLE_BUG as t2 on t1.id=t2.execution\r\nleft join TABLE_PROJECT as t3 on t3.id=t1.project\r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\' and if($project=\'\',1,t3.id=$project) and if($execution=\'\',1,t1.id=$execution)', '{\"varName\":[\"project\",\"execution\"],\"showName\":[\"\\u9879\\u76ee\\u5217\\u8868\",\"\\u6267\\u884c\\u5217\\u8868\"],\"requestType\":[\"select\",\"select\"],\"selectList\":[\"project\",\"execution\"],\"default\":[\"\",\"\"]}', '{\"stories\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"tasks\":{\"zh-cn\":\"\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u4efb\\u52a1\\u6570\",\"en\":\"Tasks\"},\"undoneStory\":{\"zh-cn\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u9700\\u6c42\\u6570\",\"en\":\"Undone Story\"},\"undoneTask\":{\"zh-cn\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"zh-tw\":\"\\u5269\\u4f59\\u4efb\\u52a1\\u6570\",\"en\":\"Undone Task\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"},\"left\":{\"zh-cn\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"zh-tw\":\"\\u5269\\u4f59\\u5de5\\u65f6\",\"en\":\"Left(h)\"},\"consumedPercent\":{\"zh-cn\":\"\\u8fdb\\u5ea6\",\"zh-tw\":\"\\u8fdb\\u5ea6\",\"en\":\"Process\"},\"execution\":{\"zh-cn\":\"\\u6267\\u884c\\u540d\\u79f0\"}}', '{\"group1\":\"project\",\"group2\":\"execution\",\"reportField\":[\"type\"],\"reportType\":[\"count\"],\"sumAppend\":[\"\"]}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u9879\\u76ee\\u7edf\\u8ba1Bug\\u7684\\u7c7b\\u578b\\u5206\\u5e03\\u60c5\\u51b5\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u9805\\u76ee\\u7d71\\u8a08Bug\\u7684\\u985e\\u578b\\u5206\\u5e03\\u60c5\\u6cc1\\u3002\",\"en\":\"\",\"de\":\"\",\"fr\":\"\",\"vi\":\"\",\"ja\":\"\"}', 'admin', '2015-08-04 13:54:22');
ALTER TABLE `zt_repofiles` ADD `oldPath` varchar(255) DEFAULT '' AFTER `path`;
ALTER TABLE `zt_testresult` ADD `ZTFResult` text NOT NULL;
ALTER TABLE `zt_testresult` ADD `ZTFTask` varchar(255) DEFAULT '';
+3 -1
View File
@@ -1687,6 +1687,8 @@ CREATE TABLE IF NOT EXISTS `zt_testresult` (
`compile` mediumint(8) unsigned NOT NULL,
`caseResult` char(30) NOT NULL,
`stepResults` text NOT NULL,
`ZTFResults` text NOT NULL,
`ZTFTask` varchar(30) NOT NULL,
`lastRunner` varchar(30) NOT NULL,
`date` datetime NOT NULL,
`duration` float NOT NULL,
@@ -7294,7 +7296,7 @@ CREATE TABLE `zt_host` (
`editedDate` datetime NOT NULL,
`deleted` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DROP TABLE IF EXISTS `zt_image`;
CREATE TABLE `zt_image` (
+32
View File
@@ -0,0 +1,32 @@
<style>
#successModal #modalLink{color: #2e7fff;text-decoration: underline;}
#successModal .modal-dialog .modal-content{border: 2px solid #75e5c4; background-color: #f1fcf9; border-radius: 4px;}
#successModal .icon-check-circle{color: #17ce97; margin-right: 10px; font-size: 20px;}
#successModal .modal-dialog{width: fit-content;}
#successModal .modal-dialog{border-radius: 4px;}
#successModal .modal-header{padding:9px 15px 0px; margin:0px; border-bottom:0;}
#successModal .modal-dialog .modal-body{padding: 5px 15px 20px 15px;}
</style>
<div class="modal fade" id="successModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<?php echo html::a($closeLink, '×', '', 'class="close"');?>
</div>
<div class="modal-body">
<p>
<i class="icon-check-circle icon"></i><?php echo $notice;?>
<?php $modalLink = !empty($modalLink) ? $modalLink : '';?>
<?php echo html::a($modalLink, $buttonName, '', 'id="modalLink"');?>
</p>
</div>
</div>
</div>
</div>
<script>
function showModal(url = '')
{
if(url) $("#modalLink").attr('href', url);
$('#successModal').modal('show', 'center');
}
</script>
+2
View File
@@ -1052,6 +1052,7 @@ $lang->resource->testcase->batchCreate = 'batchCreate';
$lang->resource->testcase->createBug = 'createBug';
$lang->resource->testcase->view = 'view';
$lang->resource->testcase->edit = 'edit';
$lang->resource->testcase->showScript = 'showScript';
$lang->resource->testcase->linkCases = 'linkCases';
$lang->resource->testcase->linkBugs = 'linkBugs';
$lang->resource->testcase->batchEdit = 'batchEdit';
@@ -1106,6 +1107,7 @@ $lang->testcase->methodOrder[130] = 'ignoreLibcaseChange';
$lang->testcase->methodOrder[135] = 'batchConfirmStoryChange';
$lang->testcase->methodOrder[140] = 'importToLib';
$lang->testcase->methodOrder[145] = 'automation';
$lang->testcase->methodOrder[150] = 'showScript';
/* Test task. */
$lang->resource->testtask = new stdclass();
+1 -1
View File
@@ -1329,7 +1329,7 @@ class project extends control
$hasProduct = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if($hasProduct) $this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', $extra, $branch);
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&caseType=&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
}
/**
+1 -1
View File
@@ -230,6 +230,6 @@ $config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testc
$config->testcase->datatable->fieldList['actions']['title'] = 'actions';
$config->testcase->datatable->fieldList['actions']['fixed'] = 'right';
$config->testcase->datatable->fieldList['actions']['width'] = '150';
$config->testcase->datatable->fieldList['actions']['width'] = '180';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
+25 -6
View File
@@ -78,6 +78,7 @@ class testcase extends control
* @param int|string $branch
* @param string $browseType
* @param int $param
* @param string $caseType
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -86,7 +87,7 @@ class testcase extends control
* @access public
* @return void
*/
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $caseType = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
{
$this->loadModel('datatable');
$this->app->loadLang('zanode');
@@ -145,11 +146,11 @@ class testcase extends control
$sort = common::appendOrder($orderBy);
/* Get test cases. */
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
if(empty($cases) and $pageID > 1)
{
$pager = pager::init(0, $recPerPage, 1);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
}
/* save session .*/
@@ -220,6 +221,7 @@ class testcase extends control
$this->view->orderBy = $orderBy;
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->caseType = $caseType;
$this->view->cases = $cases;
$this->view->branch = (!empty($product) and $product->type != 'normal') ? $branch : 0;
$this->view->branchOption = $branchOption;
@@ -238,11 +240,14 @@ class testcase extends control
* Group case.
*
* @param int $productID
* @param string $branch
* @param string $groupBy
* @param int $projectID
* @param string $caseType
* @access public
* @return void
*/
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0)
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0, $caseType = '')
{
$groupBy = empty($groupBy) ? 'story' : $groupBy;
$productID = $this->product->saveState($productID, $this->products);
@@ -260,7 +265,7 @@ class testcase extends control
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
$cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy);
$cases = $this->testcase->getModuleCases($productID, $branch, 0, '', 'no', $caseType, $groupBy);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
$cases = $this->testcase->appendData($cases);
@@ -296,6 +301,7 @@ class testcase extends control
$this->view->suiteID = 0;
$this->view->moduleID = 0;
$this->view->branch = $branch;
$this->view->caseType = $caseType;
$this->view->product = $product;
$this->display();
}
@@ -620,7 +626,7 @@ class testcase extends control
$currentModule = $this->app->tab == 'project' ? 'project' : 'testcase';
$currentMethod = $this->app->tab == 'project' ? 'testcase' : 'browse';
$projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : '';
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all&param=0&orderBy=id_desc"), 'parent'));
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all&param=0&caseType=&orderBy=id_desc"), 'parent'));
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
@@ -2350,6 +2356,19 @@ class testcase extends control
$this->display();
}
/**
* Show script.
*
* @param int $caseID
* @access public
* @return void
*/
public function showScript($caseID)
{
$this->view->case = $this->testcase->getByID($caseID);
$this->display();
}
/**
* Automation test setting.
*
+3
View File
@@ -0,0 +1,3 @@
.repoCode pre {margin: 0; padding: 0; background: white; border: none;}
.repoCode pre > table > tbody > tr > th, .repoCode pre > table > tbody > tr > td {padding: 1px 3px;}
.repoCode pre > table > tbody > tr > th {border-right: 1px solid #E4E4E4; background: #fafafa; color: #999; width: 40px; text-align: right; vertical-align: top;}
+7
View File
@@ -31,5 +31,12 @@ $(function()
$('#caseIdList').val(storyIdList);
});
});
$('input[name^="showAutoCase"]').click(function()
{
var showAutoCase = $(this).is(':checked') ? 1 : 0;
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
window.location.reload();
});
});
+9
View File
@@ -0,0 +1,9 @@
$(function()
{
$('input[name^="showAutoCase"]').click(function()
{
var showAutoCase = $(this).is(':checked') ? 1 : 0;
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
window.location.reload();
});
})
+20
View File
@@ -0,0 +1,20 @@
$(document).ready(function()
{
var $pre = $('.repoCode .content pre');
var rowTip = '';
if($('#rowTip').length > 0) rowTip = $('#rowTip').html();
if($pre.length)
{
hljs.initHighlightingOnLoad();
var content = hljs.highlight($pre.attr('class'), $pre.text());
var code = '', line;
var arr = content.value.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);
for(var i = 0 ; i < arr.length ; i++)
{
line = i + 1;
code += "<tr data-line='" + line +"'><th id='L" + line + "'><div class='comment-btn view'></div>" + line + "</th><td>" + (arr[i] || '&nbsp;') + rowTip + "</td></tr>";
}
$pre.html("<table><tbody>" + code + "</tbody></table>");
}
});
+6
View File
@@ -97,6 +97,9 @@ $lang->testcase->deleted = 'Deleted';
$lang->testcase->browseUnits = 'Unit Test';
$lang->testcase->suite = 'Test Suite';
$lang->testcase->executionStatus = 'executionStatus';
$lang->testcase->caseType = 'Case Type';
$lang->testcase->allType = 'All Types';
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
@@ -147,6 +150,7 @@ $lang->testcase->step = 'Schritt';
$lang->testcase->stepChild = 'Teilschritt';
$lang->testcase->viewAll = 'Alle anziegen';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Neu';
@@ -252,11 +256,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Wartend';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+6
View File
@@ -97,6 +97,9 @@ $lang->testcase->deleted = 'Deleted';
$lang->testcase->browseUnits = 'Unit Test';
$lang->testcase->suite = 'Test Suite';
$lang->testcase->executionStatus = 'executionStatus';
$lang->testcase->caseType = 'Case Type';
$lang->testcase->allType = 'All Types';
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
@@ -147,6 +150,7 @@ $lang->testcase->step = 'Steps';
$lang->testcase->stepChild = 'Child Steps';
$lang->testcase->viewAll = 'All Cases';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'New';
@@ -252,11 +256,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Waiting';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+6
View File
@@ -97,6 +97,9 @@ $lang->testcase->deleted = 'Deleted';
$lang->testcase->browseUnits = 'Unit Test';
$lang->testcase->suite = 'Test Suite';
$lang->testcase->executionStatus = 'executionStatus';
$lang->testcase->caseType = 'Case Type';
$lang->testcase->allType = 'All Types';
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
@@ -147,6 +150,7 @@ $lang->testcase->step = 'Etapes';
$lang->testcase->stepChild = 'Sous-Etapes';
$lang->testcase->viewAll = 'Tous les CasTests';
$lang->testcase->importToLib = "Import To Library";
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Nouveau';
@@ -252,11 +256,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'En Attente';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+6
View File
@@ -75,6 +75,9 @@ $lang->testcase->fromTesttask = 'Từ Yêu cầu Test';
$lang->testcase->fromCaselib = 'Từ thư viện tình huống';
$lang->testcase->deleted = 'Đã xóa';
$lang->testcase->browseUnits = 'Unit Test';
$lang->testcase->caseType = 'Case Type';
$lang->testcase->allType = 'All Types';
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
@@ -123,6 +126,7 @@ $lang->testcase->groupName = 'Tên nhóm';
$lang->testcase->step = 'Các bước';
$lang->testcase->stepChild = 'Các bước con';
$lang->testcase->viewAll = 'Tất cả tình huống';
$lang->testcase->showScript = 'Show Script';
$lang->testcase->new = 'Mới';
@@ -222,6 +226,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = 'Đang đợi';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
@@ -229,4 +234,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+8 -2
View File
@@ -97,6 +97,9 @@ $lang->testcase->deleted = '是否删除';
$lang->testcase->browseUnits = '单元测试';
$lang->testcase->suite = '套件';
$lang->testcase->executionStatus = '执行状态';
$lang->testcase->caseType = '用例类型';
$lang->testcase->allType = '所有类型';
$lang->testcase->showAutoCase = '显示自动化用例';
$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。
@@ -146,7 +149,8 @@ $lang->testcase->groupName = '分组名称';
$lang->testcase->step = '步骤';
$lang->testcase->stepChild = '子步骤';
$lang->testcase->viewAll = '查看所有';
$lang->testcase->importToLib = "导入用例库";
$lang->testcase->importToLib = '导入用例库';
$lang->testcase->showScript = '查看自动化脚本';
$lang->testcase->new = '新增';
@@ -252,11 +256,13 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
$lang->testcase->featureBar['browse']['all'] = '全部';
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
$lang->testcase->featureBar['browse']['wait'] = '待评审';
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
$lang->testcase->featureBar['browse']['group'] = '分组查看';
$lang->testcase->featureBar['browse']['zerocase'] = "零用例{$lang->SRCommon}";
$lang->testcase->featureBar['browse']['browseunits'] = '单元测试';
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
$lang->testcase->featureBar['browse']['suite'] = '套件';
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
+52 -10
View File
@@ -238,14 +238,15 @@ class testcaseModel extends model
* @param int $productID
* @param int|string $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto no|unit
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$stmt = $this->dao->select('t1.*, t2.title as storyTitle, t2.deleted as storyDeleted')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id');
@@ -259,6 +260,8 @@ class testcaseModel extends model
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)
->page($pager)
@@ -271,14 +274,15 @@ class testcaseModel extends model
* @param int $productID
* @param int|string $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto no|unit
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$executions = $this->loadModel('execution')->getIdList($this->session->project);
array_push($executions, $this->session->project);
@@ -294,6 +298,8 @@ class testcaseModel extends model
->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi()
->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t2.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t2.type')->eq($caseType)->fi()
->andWhere('t2.deleted')->eq('0')
->orderBy($orderBy)
->page($pager, 't1.case')
@@ -398,6 +404,35 @@ class testcaseModel extends model
->orderBy($orderBy)->page($pager)->fetchAll('id');
}
/**
* Get cases by type.
*
* @param int $productID
* @param int|string $branch
* @param int $suiteID
* @param array $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $auto no|unit
* @access public
* @return array
*/
public function getByType($productID, $branch = 0, $type = '', $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
->where('t1.product')->eq((int)$productID)
->beginIF($this->app->tab == 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($type)->andWhere('t1.type')->eq($type)->fi()
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)->page($pager)
->fetchAll('id');
}
/**
* Get case info by ID.
*
@@ -487,18 +522,20 @@ class testcaseModel extends model
* @param string $browseType
* @param int $queryID
* @param int $moduleID
* @param string $caseType
* @param string $sort
* @param object $pager
* @param string $auto no|unit
* @access public
* @return array
*/
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no')
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $caseType = '', $sort = 'id_desc', $pager = null, $auto = 'no')
{
/* Set modules and browse type. */
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
$browseType = ($browseType == 'bymodule' and $this->session->caseBrowseType and $this->session->caseBrowseType != 'bysearch') ? $this->session->caseBrowseType : $browseType;
$group = $this->lang->navGroup->testcase;
$auto = $this->cookie->showAutoCase ? 'auto' : $auto;
/* By module or all cases. */
$cases = array();
@@ -506,11 +543,11 @@ class testcaseModel extends model
{
if($this->app->tab == 'project')
{
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
}
else
{
$cases = $this->getModuleCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
$cases = $this->getModuleCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
}
}
/* Cases need confirmed. */
@@ -528,6 +565,8 @@ class testcaseModel extends model
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
->orderBy($sort)
->page($pager, 't1.id')
->fetchAll();
@@ -2040,9 +2079,11 @@ class testcaseModel extends model
{
$showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1;
}
$autoIcon = $case->auto == 'auto' ? " <i class='icon icon-ztf'></i>" : '';
if(isset($branches[$case->branch]) and $showBranch) echo "<span class='label label-outline label-badge'>{$branches[$case->branch]}</span> ";
if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]" . $autoIcon, '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title . $autoIcon, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
break;
case 'branch':
echo $branches[$case->branch];
@@ -2524,6 +2565,7 @@ class testcaseModel extends model
}
$menu .= $this->buildMenu('testtask', 'runCase', "runID=0&$params&version=$case->version", $case, 'browse', 'play', '', 'runCase iframe', false, "data-width='95%'");
if($case->auto == 'auto') $menu .= $this->buildMenu('testcase', 'showScript', $params, $case, 'browse', 'file-code', '', 'runCase iframe', false);
$menu .= $this->buildMenu('testtask', 'results', "runID=0&$params", $case, 'browse', '', '', 'iframe', true, "data-width='95%'");
$editParams = $params;
+47 -4
View File
@@ -13,6 +13,7 @@
.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
.body-modal #mainMenu>.btn-toolbar {width: auto;}
#mainMenu .pull-left .checkbox-primary {margin-top: 5px;}
#mainMenu .dividing-line {width: 1px; height: 16px; display: inline-block; background: #D8DBDE; margin: 7px 8px 0 0; float: left;}
</style>
<div id='mainMenu' class='clearfix'>
@@ -48,6 +49,7 @@
<?php
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
$caseType = isset($caseType) ? $caseType : '';
if(!$config->testcase->needReview and empty($config->testcase->forceReview) and $menuType == 'wait') continue;
if($hasBrowsePriv and $menuType == 'QUERY' and in_array($browseType, array('all', 'needconfirm', 'bysuite')))
{
@@ -55,9 +57,50 @@
$isBySearch = $browseType == 'bysearch';
include '../../common/view/querymenu.html.php';
}
elseif($hasBrowsePriv and $menuType == 'casetype')
{
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
if($browseType == 'bysuite') continue;
$lang->testcase->typeList[''] = $lang->testcase->allType;
$currentTypeName = zget($lang->testcase->typeList, $caseType, '');
$currentLable = empty($currentTypeName) ? $lang->testcase->allType : $currentTypeName;
if(!isset($param)) $param = 0;
echo "<div id='byTypeTab' class='btn-group'>";
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
foreach($lang->testcase->typeList as $type => $typeName)
{
echo '<li' . ($type == $caseType ? " class='active'" : '') . '>';
if(isset($groupBy))
{
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story&projectID=$projectID&caseType=$type"), $typeName);
}
else
{
echo html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&caseType=$type"), $typeName);
}
echo "</li>";
}
echo '</ul></div>';
}
elseif($hasBrowsePriv and $menuType == 'autocase')
{
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
if($browseType == 'bysuite' or $browseType == 'bysearch') continue;
echo html::checkbox('showAutoCase', array('1' => $lang->testcase->showAutoCase), '', $this->cookie->showAutoCase ? 'checked=checked' : '');
}
elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
{
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType&param=0&caseType=$caseType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
}
elseif($hasBrowsePriv and $menuType == 'suite' and $this->app->tab == 'qa')
{
@@ -67,10 +110,10 @@
echo "<div id='bysuiteTab' class='btn-group'>";
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
if(empty($productID) or common::canModify('product', $product))
{
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
if(empty($suiteList))
{
echo '<li>';
@@ -103,7 +146,7 @@
$projectID = $isProjectApp ? $this->session->project : 0;
echo html::a($this->createLink('testcase', 'zeroCase', "productID=$productID&branch=$branch&orderBy=id_desc&projectID=$projectID"), "<span class='text'>{$lang->testcase->zeroCase}</span>", '', "class='btn btn-link' id='zerocaseTab' data-app='{$this->app->tab}'");
}
elseif($hasUnitPriv and $menuType == 'browseunits')
elseif($hasUnitPriv and $menuType == 'browseunits' and !$caseType)
{
echo html::a($this->createLink('testtask', 'browseUnits', "productID=$productID&browseType=newest&orderBy=id_desc&recTotal=0&recPerPage=20&pageID=1&projectID=$projectID"), "<span class='text'>{$lang->testcase->browseUnits}</span>", '', "class='btn btn-link' id='browseunitsTab' data-app='{$this->app->tab}'");
}
+31
View File
@@ -0,0 +1,31 @@
<?php
/**
* The show script view file of testcase of ZenTaoPMS.
*
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Yuchun Li <liyuchun@easycorp.ltd>
* @package testcase
* @version $Id: showscript.html.php 4723 2022-07-28 08:47:29Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php
include '../../common/view/header.lite.html.php';
css::import($jsRoot . 'misc/highlight/styles/code.css');
js::import($jsRoot . 'misc/highlight/highlight.pack.js');
?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
<span class='label label-id'><?php echo $case->id;?></span>
<span title='<?php echo $case->title?>'><?php echo $case->title;?></span>
</h2>
</div>
<div class="main-col repoCode main">
<div class="content panel">
<pre class="cpp"><?php echo trim(htmlSpecialString($case->script, defined('ENT_SUBSTITUTE') ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES));?></pre>
</div>
</div>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+11 -2
View File
@@ -1209,11 +1209,13 @@ class testtask extends control
* Run case.
*
* @param int $runID
* @param String $extras others params, forexample, caseID=10, version=3
* @param int $caseID
* @param int $version
* @param string $confirm
* @access public
* @return void
*/
public function runCase($runID, $caseID = 0, $version = 0)
public function runCase($runID, $caseID = 0, $version = 0, $confirm = '')
{
if($runID)
{
@@ -1227,6 +1229,12 @@ class testtask extends control
$caseID = $caseID ? $caseID : $run->case->id;
$preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
$automation = $this->loadModel('zanode')->getAutomationByProduct($run->case->product);
$confirmURL = inlink('runCase', "runID=$runID&caseID=$caseID&version=$version&confirm=yes");
$cancelURL = inlink('runCase', "runID=$runID&caseID=$caseID&version=$version&confirm=no");
if($automation and $confirm == '') return print(js::confirm($this->lang->zanode->runCaseConfirm, $confirmURL, $cancelURL));
if(!empty($_POST))
{
$caseResult = $this->testtask->createResult($runID);
@@ -1289,6 +1297,7 @@ class testtask extends control
$this->view->caseID = $caseID;
$this->view->version = $version;
$this->view->runID = $runID;
$this->view->confirm = $confirm;
$this->display();
}
+5
View File
@@ -14,6 +14,7 @@
<?php include '../../common/view/form.html.php';?>
<?php js::set('caseResultSave', $lang->save);?>
<?php js::set('tab', $app->tab);?>
<?php js::set('confirm', $confirm);?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
@@ -27,6 +28,7 @@
<tr>
<td colspan='5' style='word-break: break-all;'><strong><?php echo $lang->testcase->precondition;?></strong><br/><?php echo nl2br($run->case->precondition);?></td>
</tr>
<?php if($confirm != 'yes'):?>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p30'><?php echo $lang->testcase->stepDesc;?></th>
@@ -34,7 +36,9 @@
<th class='w-100px'><?php echo $lang->testcase->result;?></th>
<th><?php echo $lang->testcase->real;?></th>
</tr>
<?php endif;?>
</thead>
<?php if($confirm != 'yes'):?>
<?php
if(empty($run->case->steps))
{
@@ -81,6 +85,7 @@
</tr>
<?php $childId ++;?>
<?php endforeach;?>
<?php endif;?>
<tr class='text-center'>
<td colspan='5' class='form-actions'>
<?php
+8 -7
View File
@@ -95,13 +95,14 @@ class zahost extends control
return $this->send(array('result' => 'fail', 'message' => array("extranet" => array($this->lang->zahost->netError))));
}
$initLink = $this->createLink('zahost', 'inithost', "hostID=$hostID");
$initLink = $this->createLink('zahost', 'init', "hostID=$hostID");
return print("<script>showModal('$initLink')</script>");
}
$this->view->title = $this->lang->zahost->create;
$this->view->notice = $this->lang->zahost->initHostNotice;
$this->view->buttonName = $this->lang->zahost->init;
$this->view->notice = $this->lang->zahost->initNotice;
$this->view->buttonName = $this->lang->zahost->init->title;
$this->view->closeLink = $this->createLink('zahost', 'browse');
$this->display();
}
@@ -117,7 +118,7 @@ class zahost extends control
if($_POST)
{
$changes = $this->zahost->update($hostID);
if(dao::isError())
if(dao::isError())
{
return $this->send(array('result' => 'fail', 'message' => dao::getError()));
}
@@ -325,17 +326,18 @@ class zahost extends control
* @param int $hostID
* @return void
*/
public function initHost($hostID)
public function init($hostID)
{
$imageList = $this->zahost->getImagePairs($hostID);
$this->view->title = $this->lang->zahost->init;
$this->view->title = $this->lang->zahost->init->title;
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$this->view->hostID = $hostID;
$this->view->host = $this->zahost->getById($hostID);
$this->view->notice = $imageList ? $this->lang->zahost->createZanodeNotice : $this->lang->zahost->downloadImageNotice;
$this->view->buttonName = $imageList ? $this->lang->zahost->createZanode : $this->lang->zahost->image->downloadImage;
$this->view->modalLink = $imageList ? $this->createLink('zanode', 'create', "hostID=$hostID") : $this->createLink('zahost', 'browseImage', "hostID=$hostID");
$this->view->closeLink = $this->createLink('zahost', 'browse');
$this->display();
}
@@ -344,7 +346,6 @@ class zahost extends control
* Check service status by ajax.
*
* @param int $hostID
* @param int $templateID
* @access public
* @return void
*/
-7
View File
@@ -1,7 +0,0 @@
#modalLink{color: #2e7fff;text-decoration: underline;}
.modal-dialog .modal-content{border: 2px solid #75e5c4; background-color: #f1fcf9; border-radius: 4px;}
.icon-check-circle{color: #17ce97; margin-right: 10px; font-size: 20px;}
.modal-dialog{width: fit-content;}
.modal-dialog{border-radius: 4px;}
.modal-header{padding:9px 15px 0px; margin:0px; border-bottom:0;}
.modal-dialog .modal-body{padding: 5px 15px 20px 15px;}
@@ -14,3 +14,6 @@
margin-left: 20px;
min-width: 100px;
}
.zahost-init-desc{
display: inline-block;
}
-6
View File
@@ -32,9 +32,3 @@ $(function()
$('#osCategory').change();
})
function showModal(url = '')
{
if(url) $("#modalLink").attr('href', url);
$('#successModal').modal('show', 'center');
}
+5 -4
View File
@@ -37,7 +37,7 @@ $lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->undeletedNotice = "The host has nodes that cannot be deleted.";
@@ -54,13 +54,14 @@ $lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the ini
$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zahost->init->serviceStatus = [
"kvm" => 'not_install',
"novnc" => 'not_install',
"kvm" => 'not_install',
"nginx" => 'not_install',
"novnc" => 'not_install',
"websockify" => 'not_install',
];
$lang->zahost->init->title = "Initialize Host";
$lang->zahost->init->descTitle = "Follow these steps to complete the initialization on the host:";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k ";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k %s<br>- Click check service status button.";
$lang->zahost->init->statusTitle = "Service Status";
$lang->zahost->image = new stdclass;
+5 -4
View File
@@ -37,7 +37,7 @@ $lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->undeletedNotice = "The host has nodes that cannot be deleted.";
@@ -54,13 +54,14 @@ $lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the ini
$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zahost->init->serviceStatus = [
"kvm" => 'not_install',
"novnc" => 'not_install',
"kvm" => 'not_install',
"nginx" => 'not_install',
"novnc" => 'not_install',
"websockify" => 'not_install',
];
$lang->zahost->init->title = "Initialize Host";
$lang->zahost->init->descTitle = "Follow these steps to complete the initialization on the host:";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k ";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k %s<br>- Click check service status button.";
$lang->zahost->init->statusTitle = "Service Status";
$lang->zahost->image = new stdclass;
+5 -4
View File
@@ -37,7 +37,7 @@ $lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->undeletedNotice = "The host has nodes that cannot be deleted.";
@@ -54,13 +54,14 @@ $lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the ini
$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zahost->init->serviceStatus = [
"kvm" => 'not_install',
"novnc" => 'not_install',
"kvm" => 'not_install',
"nginx" => 'not_install',
"novnc" => 'not_install',
"websockify" => 'not_install',
];
$lang->zahost->init->title = "Initialize Host";
$lang->zahost->init->descTitle = "Follow these steps to complete the initialization on the host:";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k ";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k %s<br>- Click check service status button.";
$lang->zahost->init->statusTitle = "Service Status";
$lang->zahost->image = new stdclass;
+5 -5
View File
@@ -40,7 +40,7 @@ $lang->zahost->osLang = 'Language';
$lang->zahost->imageName = 'Image File';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->initNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->netError = 'Unable to connect to the host, please check the network and try again.';
@@ -53,13 +53,13 @@ $lang->zahost->init->ready = "Ready";
$lang->zahost->init->next = "Next";
$lang->zahost->init->initSuccessNotice = "The initialization was successful, click Next to complete the next steps.";
$lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:";
$lang->zahost->init->initDesc = "Execute the init script on the host: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k %s<br>- Click check service status button.";
$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zahost->init->serviceStatus = [
"nginx" => 'not_install',
"kvm" => 'not_install',
"novnc" => 'not_install',
"kvm" => 'not_install',
"nginx" => 'not_install',
"novnc" => 'not_install',
"websockify" => 'not_install',
];
$lang->zahost->init->title = "Initialize Host";
+6 -5
View File
@@ -37,7 +37,7 @@ $lang->zahost->os = '操作系统';
$lang->zahost->imageName = '镜像文件';
$lang->zahost->createZanode = '创建执行节点';
$lang->zahost->initNotice = '保存成功,请您初始化宿主机或返回列表。';
$lang->zahost->initNotice = '保存成功,请您初始化宿主机或返回列表。';
$lang->zahost->createZanodeNotice = '初始化成功,您现在可以创建执行节点了。';
$lang->zahost->downloadImageNotice = '初始化成功,请下载镜像用于创建执行节点。';
$lang->zahost->undeletedNotice = "宿主机下存在执行节点无法删除。";
@@ -54,14 +54,15 @@ $lang->zahost->init->next = "下一步";
$lang->zahost->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:";
$lang->zahost->init->initFailNoticeDesc = "1. 重新执行脚本 <br/>2. 查看初始化常见问题";
$lang->zahost->init->serviceStatus = [
"kvm" => 'not_install',
"novnc" => 'not_install',
"kvm" => 'not_install',
"nginx" => 'not_install',
"novnc" => 'not_install',
"websockify" => 'not_install',
];
$lang->zahost->init->title = "初始化宿主机";
$lang->zahost->init->descTitle = "请根据引导完成宿主机上的初始化: ";
$lang->zahost->init->initDesc = "1. 在宿主机上执行:bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k ";
$lang->zahost->init->statusTitle = "Service Status";
$lang->zahost->init->initDesc = "- 在宿主机上执行命令:bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -k %s<br>- 点击检测服务状态。";
$lang->zahost->init->statusTitle = "服务状态";
$lang->zahost->image = new stdclass;
$lang->zahost->image->list = '镜像仓库';
+1
View File
@@ -33,6 +33,7 @@ class zahostModel extends model
{
$hostInfo = fixer::input('post')
->setDefault('cpuNumber,cpuCores,diskSize,memory', 0)
->trim('extranet')
->get();
$this->dao->table = 'zahost';
+1 -1
View File
@@ -74,7 +74,7 @@
<?php if(common::hasPriv('zahost', 'edit')) common::printIcon('zahost', 'edit', "hostID={$host->hostID}", $host, 'list');?>
<?php if(common::hasPriv('zahost', 'delete')) echo html::a($this->createLink('zahost', 'delete', "hostID={$host->id}"), '<i class="icon-trash"></i>', 'hiddenwin', "title='$title' class='btn $disabled'");;?>
<?php if(common::hasPriv('zahost', 'browseImage')) common::printIcon('zahost', 'browseImage', "hostID={$host->hostID}", $host, 'list', 'file', '', 'iframe', true, "data-width='60%'", $lang->zahost->image->list);?>
<?php if(common::hasPriv('zahost', 'init')) common::printIcon('zahost', 'init', "hostID={$host->hostID}", $host, 'list', 'info', '', ' init', false, "data-placement='bottom'", $lang->zahost->init->title);?>
<?php if(common::hasPriv('zahost', 'init')) common::printIcon('zahost', 'init', "hostID={$host->hostID}", $host, 'list', 'refresh', '', ' init', false, "data-placement='bottom'", $lang->zahost->init->title);?>
</td>
</tr>
<?php endforeach;?>
+1 -1
View File
@@ -49,7 +49,7 @@
<td class="image-progress-<?php echo zget($image, 'id', 0);?>"><?php echo $image->status == 'completed' ? '100%' : '';?></td>
<td class='c-actions'>
<?php if(common::hasPriv('zahost', 'downloadImage')) echo html::a($this->createLink('zahost', 'downloadImage', "hostID={$hostID}&imageName={$image->name}&imageID={$image->id}"), '<i class="icon-download"></i>', 'hiddenwin', zget($image, 'downloadMisc', ''));?>
<?php if(common::hasPriv('zahost', 'cancelDownload')) echo html::a($this->createLink('zahost', 'cancelDownload', "id={$image->id}"), '<i class="icon-undo"></i>', 'hiddenwin', zget($image, 'cancelMisc', ''));?>
<?php if(common::hasPriv('zahost', 'cancelDownload')) echo html::a($this->createLink('zahost', 'cancelDownload', "id={$image->id}"), '<i class="icon-close"></i>', 'hiddenwin', zget($image, 'cancelMisc', ''));?>
</td>
</tr>
<?php endforeach;?>
+1 -1
View File
@@ -78,5 +78,5 @@
</div>
</div>
</div>
<?php include 'successmodal.html.php';?>
<?php include $app->getModuleRoot() . 'common/view/successmodal.html.php';?>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
+3 -3
View File
@@ -25,8 +25,8 @@
<h4><?php echo $lang->zahost->init->descTitle; ?></h4>
<div>
<span class='dot-symbol'></span>
<span>
<?php echo $lang->zahost->init->initDesc . ' ' . $host->secret . ' -z ' . getWebRoot(true); ?>
<span class='zahost-init-desc'>
<?php echo sprintf($lang->zahost->init->initDesc, $host->secret . ' -z ' . getWebRoot(true)); ?>
</span>
</div>
<div id="statusContainer">
@@ -39,5 +39,5 @@
</div>
</div>
</div>
<?php include 'successmodal.html.php';?>
<?php include $app->getModuleRoot() . 'common/view/successmodal.html.php';?>
<?php include '../../common/view/footer.html.php'; ?>
+49
View File
@@ -123,6 +123,26 @@ class zanode extends control
$this->display();
}
/*
* Init node.
*
* @param int $hostID
* @return void
*/
public function init($nodeID)
{
$this->view->title = $this->lang->zanode->initTitle;
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$this->view->nodeID = $nodeID;
$this->view->node = $this->zanode->getNodeById($nodeID);
$this->view->notice = $this->lang->zanode->init->initSuccessNoticeTitle;
$this->view->buttonName = $this->lang->zanode->init->button;
$this->view->modalLink = $this->createLink('zanode', 'browse');
$this->view->closeLink = $this->createLink('zanode', 'browse');
$this->display();
}
/**
* Suspend Node.
*
@@ -329,4 +349,33 @@ class zanode extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
}
}
/**
* Check service status by ajax.
*
* @param int $nodeID
* @access public
* @return void
*/
public function ajaxGetServiceStatus($hostID)
{
$node = $this->zanode->getNodeById($hostID);
$serviceStatus = $this->zanode->getServiceStatus($node);
return $this->send(array('result' => 'success', 'message' => '', 'data' => $serviceStatus));
}
/**
* ajaxRunZTFScript
*
* @param int $scriptID
* @access public
* @return void
*/
public function ajaxRunZTFScript($scriptID = 0)
{
$script = $this->zanode->getAutomationByID($scriptID);
return $this->send(array('result' => 'success', 'message' => '', 'data' => $serviceStatus));
}
}
View File
+19
View File
@@ -0,0 +1,19 @@
.dot-symbol{
margin-right: 10px;
}
#statusContainer h5{
line-height: 20px;
}
.host-desc-container{
margin-top: 20px;
}
.host-action{
margin-top: 60px;
}
.host-action .btn{
margin-left: 20px;
min-width: 100px;
}
.zahost-init-desc{
display: inline-block;
}
+25
View File
@@ -0,0 +1,25 @@
$('#checkServiceStatus').click(function(){
$.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response)
{
var resultData = JSON.parse(response);
let html = "<h4 style='margin-top: 20px;'>" + zanodeLang.init.statusTitle + "</h4>";
let isSuccess = true
for (let key in resultData.data) {
if(resultData.data[key] == 'ready'){
html += "<div class='text-success'><span class='dot-symbol'>●</span><span>" + key + ' ' + zanodeLang.init[resultData.data[key]] + "</span></div>"
}else{
isSuccess = false
html += "<div class='text-danger'><span class='dot-symbol'>●</span><span>" + key + ' ' + zanodeLang.init[resultData.data[key]] + "</span></div>"
}
};
if(!isSuccess){
html += '<h4 style="margin-top:20px;">' + zanodeLang.init.initFailNoticeTitle + '</h4>';
html += '<div><span class="dot-symbol">' + zanodeLang.init.initFailNoticeDesc + '<a href="https://github.com/easysoft/zenagent/" target="_blank">https://github.com/easysoft/zenagent/</a></span></div>'
}
$('#statusContainer').html(html)
if(isSuccess) showModal();
});
return
})
+32 -7
View File
@@ -4,6 +4,7 @@ $lang->zanode->browse = 'Execution Node List';
$lang->zanode->create = 'Create Execution Node';
$lang->zanode->editAction = 'Edit Execution Node';
$lang->zanode->view = 'View Execution Node';
$lang->zanode->initTitle = 'Init ZenAgent Node';
$lang->zanode->suspend = 'Suspend Execution Node';
$lang->zanode->destroy = 'Destroy Execution Node';
$lang->zanode->handleVM = 'Restart Execution Node';
@@ -46,14 +47,15 @@ $lang->zanode->shell = "Shell";
$lang->zanode->automation = "Automation";
$lang->automation = new stdClass();
$lang->automation->path = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->automation->scriptPath = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "Name must be letters, numbers,'-','_','.', And cannot begin with a symbol";
$lang->zanode->empty = 'Execution node not found.';
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "Name must be letters, numbers,'-','_','.', And cannot begin with a symbol";
$lang->zanode->empty = 'Execution node not found.';
$lang->zanode->runCaseConfirm = 'The system detects the presence of an automation script. Whether to execute?';
$lang->zanode->empty = 'No Execution Node';
$lang->zanode->createImaging = 'Creating';
@@ -76,4 +78,27 @@ $lang->zanode->statusList['running'] = 'Running';
$lang->zanode->statusList['suspend'] = 'Suspend';
$lang->zanode->statusList['offline'] = 'Offline';
$lang->zanode->statusList['destroy'] = 'Destroyed';
$lang->zanode->statusList['shutoff'] = 'Shutoff';
$lang->zanode->statusList['shutdown'] = 'shutdown';
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
$lang->zanode->init = new stdclass;
$lang->zanode->init->checkStatus = "Check Service Status";
$lang->zanode->init->not_install = "Not installed";
$lang->zanode->init->not_available = "Installed, Not Started";
$lang->zanode->init->ready = "Ready";
$lang->zanode->init->next = "Next";
$lang->zanode->init->button = "Go To Settings";
$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse.";
$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:";
$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zanode->init->serviceStatus = [
"ZenAgent" => 'not_install',
"ZTF" => 'not_install',
];
$lang->zanode->init->title = "Initialize Node";
$lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:";
$lang->zanode->init->initDesc = "Execute the init script on the node: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -s vm -k ";
$lang->zanode->init->statusTitle = "Service Status";
+33 -8
View File
@@ -4,6 +4,7 @@ $lang->zanode->browse = 'Execution Node List';
$lang->zanode->create = 'Create Execution Node';
$lang->zanode->editAction = 'Edit Execution Node';
$lang->zanode->view = 'View Execution Node';
$lang->zanode->initTitle = 'Init ZenAgent Node';
$lang->zanode->suspend = 'Suspend Execution Node';
$lang->zanode->destroy = 'Destroy Execution Node';
$lang->zanode->handleVM = 'Restart Execution Node';
@@ -46,16 +47,17 @@ $lang->zanode->shell = "Shell";
$lang->zanode->automation = "Automation";
$lang->automation = new stdClass();
$lang->automation->path = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->automation->scriptPath = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol";
$lang->zanode->empty = 'No zanode is found';
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol";
$lang->zanode->empty = 'No zanode is found';
$lang->zanode->runCaseConfirm = 'The system detects the presence of an automation script. Whether to execute?';
$lang->zanode->empty = 'No Execution Node';
$lang->zanode->empty = 'No ZenAgent Node';
$lang->zanode->createImaging = 'Creating';
$lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the execution node to be shut down. Do you want to continue?';
$lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.';
@@ -76,4 +78,27 @@ $lang->zanode->statusList['running'] = 'Running';
$lang->zanode->statusList['suspend'] = 'Suspend';
$lang->zanode->statusList['offline'] = 'Offline';
$lang->zanode->statusList['destroy'] = 'Destroyed';
$lang->zanode->statusList['shutoff'] = 'Shutoff';
$lang->zanode->statusList['shutdown'] = 'shutdown';
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
$lang->zanode->init = new stdclass;
$lang->zanode->init->checkStatus = "Check Service Status";
$lang->zanode->init->not_install = "Not installed";
$lang->zanode->init->not_available = "Installed, Not Started";
$lang->zanode->init->ready = "Ready";
$lang->zanode->init->next = "Next";
$lang->zanode->init->button = "Go To Settings";
$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse.";
$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:";
$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zanode->init->serviceStatus = [
"ZenAgent" => 'not_install',
"ZTF" => 'not_install',
];
$lang->zanode->init->title = "Initialize Node";
$lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:";
$lang->zanode->init->initDesc = "Execute the init script on the node: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -s vm -k ";
$lang->zanode->init->statusTitle = "Service Status";
+32 -7
View File
@@ -4,6 +4,7 @@ $lang->zanode->browse = 'Execution Node List';
$lang->zanode->create = 'Create Execution Node';
$lang->zanode->editAction = 'Edit Execution Node';
$lang->zanode->view = 'View Execution Node';
$lang->zanode->initTitle = 'Init ZenAgent Node';
$lang->zanode->suspend = 'Suspend Execution Node';
$lang->zanode->destroy = 'Destroy Execution Node';
$lang->zanode->handleVM = 'Restart Execution Node';
@@ -46,14 +47,15 @@ $lang->zanode->shell = "Shell";
$lang->zanode->automation = "Automation";
$lang->automation = new stdClass();
$lang->automation->path = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->automation->scriptPath = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol";
$lang->zanode->empty = 'No zanode is found';
$lang->zanode->notFoundAgent = 'No Agent service is found';
$lang->zanode->createVmFail = 'Failed to create a execution node';
$lang->zanode->noVncPort = 'Failed to get vnc port';
$lang->zanode->nameValid = "The name can only be letters, numbers, '-', '_', '.', and cannot start with a symbol";
$lang->zanode->empty = 'No zanode is found';
$lang->zanode->runCaseConfirm = 'The system detects the presence of an automation script. Whether to execute?';
$lang->zanode->empty = 'No Execution Node';
$lang->zanode->createImaging = 'Creating';
@@ -76,4 +78,27 @@ $lang->zanode->statusList['running'] = 'Running';
$lang->zanode->statusList['suspend'] = 'Suspend';
$lang->zanode->statusList['offline'] = 'Offline';
$lang->zanode->statusList['destroy'] = 'Destroyed';
$lang->zanode->statusList['shutoff'] = 'Shutoff';
$lang->zanode->statusList['shutdown'] = 'shutdown';
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
$lang->zanode->init = new stdclass;
$lang->zanode->init->checkStatus = "Check Service Status";
$lang->zanode->init->not_install = "Not installed";
$lang->zanode->init->not_available = "Installed, Not Started";
$lang->zanode->init->ready = "Ready";
$lang->zanode->init->next = "Next";
$lang->zanode->init->button = "Go To Settings";
$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse.";
$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:";
$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script <br/>2. Review the initialization FAQ";
$lang->zanode->init->serviceStatus = [
"ZenAgent" => 'not_install',
"ZTF" => 'not_install',
];
$lang->zanode->init->title = "Initialize Node";
$lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:";
$lang->zanode->init->initDesc = "Execute the init script on the node: bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -s vm -k ";
$lang->zanode->init->statusTitle = "Service Status";
+31 -7
View File
@@ -4,6 +4,7 @@ $lang->zanode->browse = '执行节点列表';
$lang->zanode->create = '创建执行节点';
$lang->zanode->editAction = '编辑执行节点';
$lang->zanode->view = '执行节点详情';
$lang->zanode->initTitle = '初始化执行节点';
$lang->zanode->suspend = '暂停执行节点';
$lang->zanode->destroy = '销毁执行节点';
$lang->zanode->handleVM = '重启执行节点';
@@ -46,14 +47,15 @@ $lang->zanode->shell = "shell命令";
$lang->zanode->automation = "自动化测试";
$lang->automation = new stdClass();
$lang->automation->path = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->automation->scriptPath = $lang->zanode->scriptPath;
$lang->automation->node = $lang->zanode->common;
$lang->zanode->notFoundAgent = '没有发现Agent服务';
$lang->zanode->createVmFail = '创建执行节点失败';
$lang->zanode->noVncPort = '无法获取执行节点端口';
$lang->zanode->nameValid = "名称只能是字母、数字,'-','_','.',且不能以符号开头";
$lang->zanode->empty = '暂时没有执行节点';
$lang->zanode->notFoundAgent = '没有发现Agent服务';
$lang->zanode->createVmFail = '创建执行节点失败';
$lang->zanode->noVncPort = '无法获取执行节点端口';
$lang->zanode->nameValid = "名称只能是字母、数字,'-','_','.',且不能以符号开头";
$lang->zanode->empty = '暂时没有执行节点';
$lang->zanode->runCaseConfirm = '系统检测到选择的用例存在自动化测试脚本,是否自动执行用例?';
$lang->zanode->createImage = '创建镜像';
$lang->zanode->createImaging = '正在创建镜像';
@@ -76,4 +78,26 @@ $lang->zanode->statusList['running'] = '运行中';
$lang->zanode->statusList['suspend'] = '暂停';
$lang->zanode->statusList['offline'] = '下线';
$lang->zanode->statusList['destroy'] = '已销毁';
$lang->zanode->statusList['shutoff'] = '已关机';
$lang->zanode->statusList['shutodown'] = '已关机';
$lang->zanode->statusList['destroy_fail'] = '销毁失败';
$lang->zanode->init = new stdclass;
$lang->zanode->init->statusTitle = "服务状态";
$lang->zanode->init->checkStatus = "检测服务状态";
$lang->zanode->init->not_install = "未安装";
$lang->zanode->init->not_available = "已安装,未启动";
$lang->zanode->init->ready = "已就绪";
$lang->zanode->init->next = "下一步";
$lang->zanode->init->button = "去设置";
$lang->zanode->init->initSuccessNoticeTitle = "初始化成功,您可以进行自动化测试设置或返回列表。";
$lang->zanode->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:";
$lang->zanode->init->initFailNoticeDesc = "1. 重新执行脚本 <br/>2. 查看初始化常见问题";
$lang->zanode->init->serviceStatus = [
"ZenAgent" => 'not_install',
"ZTF" => 'not_install',
];
$lang->zanode->init->title = "初始化执行节点";
$lang->zanode->init->descTitle = "请根据引导完成执行节点上的初始化: ";
$lang->zanode->init->initDesc = "- 在执行节点上执行命令:bash <(curl -s -S -L https://pkg.qucheng.com/zenagent/zagent.sh) -s zvm -k %s<br>- 点击检测服务状态。";$lang->zanode->init->statusTitle = "Service Status";
+126 -8
View File
@@ -60,9 +60,6 @@ class zanodemodel extends model
/* Get host info. */
$host = $this->getHostByID($data->parent);
/* Gen mac address */
$mac = $this->genmac();
/* Prepare create params. */
$agnetUrl = 'http://' . $host->extranet . ':' . $host->zap;
$param = array(
@@ -90,7 +87,7 @@ class zanodemodel extends model
/* Prepare create execution node data. */
$data->image = $data->image;
$data->parent = $host->id;
$data->mac = $mac;
$data->mac = $result->data->mac;
$data->status = static::STATUS_RUNNING;
$data->createdBy = $this->app->user->account;
$data->createdDate = helper::now();
@@ -122,7 +119,6 @@ class zanodemodel extends model
if(dao::isError()) return false;
$node = $this->getNodeByID($zanodeID);
$image = $this->getImageByID($node->image);
$newImage = new stdClass();
$newImage->host = $node->parent;
@@ -472,7 +468,7 @@ class zanodemodel extends model
*/
public function getNodeByID($id)
{
return $this->dao->select('t1.*, t1.name as hostName, t2.extranet as ip,t2.zap as hzap,t3.osName, t2.tokenSN as hTokenSN')->from(TABLE_ZAHOST)->alias('t1')
return $this->dao->select('t1.*, t2.name as hostName, t2.extranet as ip,t2.zap as hzap,t3.osName, t2.tokenSN as hTokenSN, t2.secret as secret')->from(TABLE_ZAHOST)->alias('t1')
->leftJoin(TABLE_ZAHOST)->alias('t2')->on('t1.parent = t2.id')
->leftJoin(TABLE_IMAGE)->alias('t3')->on('t3.id = t1.image')
->where('t1.id')->eq($id)
@@ -493,6 +489,19 @@ class zanodemodel extends model
->fetch();
}
/**
* Get automation by id.
*
* @param int $id
* @return object
*/
public function getScriptByID($id)
{
return $this->dao->select('*')->from(TABLE_AUTOMATION)
->where('id')->eq($id)
->fetch();
}
/**
* Generage unique mac address.
*
@@ -534,7 +543,7 @@ class zanodemodel extends model
$agnetUrl = 'http://' . $node->ip . ':' . $node->hzap . static::KVM_TOKEN_PATH;
$result = json_decode(commonModel::http("$agnetUrl?port={$node->vnc}", array(), array(CURLOPT_CUSTOMREQUEST => 'GET'), array("Authorization:$node->hTokenSN"), 'json'));
if(empty($result) or $result->code != 'success') return false;
$returnData = new stdClass();
@@ -584,7 +593,7 @@ class zanodemodel extends model
/**
* Build operateMenu for browse view.
*
* @param int $node
* @param object $node
* @access public
* @return void
*/
@@ -601,6 +610,85 @@ class zanodemodel extends model
return $menu;
}
/**
* Get service status from ZAgent server.
*
* @param object $node
* @access public
* @return array
*/
public function getServiceStatus($node)
{
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$node->tokenSN")));
if(empty($result->data->ztfStatus) || $result->code != 'success')
{
$result = new stdclass;
$result->data = $this->lang->zanode->init->serviceStatus;
}else{
$result->data = array(
"ZenAgent" => "ready",
"ZTF" => $result->data->ztfStatus,
);
}
return $result->data;
}
/**
* Install service.
*
* @param object $node
* @access public
* @return array
*/
public function installService($node, $name)
{
$param = array(
"name" => $name,
"secret" => $node->secret,
"server" => getWebRoot(true),
);
$result = json_decode(commonModel::http("http://{$node->extranet}:{$node->zap}/api/v1/service/setup", json_encode($param), array(), array("Authorization:$node->tokenSN")));
if(empty($result->data) || $result->code != 'success')
{
$result = new stdclass;
$result->data = $this->lang->zanode->init->serviceStatus;
}
return array(
"ZenAgent" => "ready",
"ZTF" => $result->data->ztfStatus,
);
}
/**
* Get automation by product id.
*
* @param int $productID
* @access public
* @return void
*/
public function getAutomationByProduct($productID = 0)
{
return $this->dao->select('*')->from(TABLE_AUTOMATION)
->where('product')->eq($productID)
->fetch();
}
/**
* Get automation by id.
*
* @param int $id
* @return object
*/
public function getAutomationByID($id)
{
return $this->dao->select('*')->from(TABLE_AUTOMATION)
->where('id')->eq($id)
->fetch();
}
/**
* Set automation setting.
*
@@ -625,4 +713,34 @@ class zanodemodel extends model
if(dao::isError()) return false;
return $this->dao->lastInsertID();
}
/**
* Run ZTFScript.
*
* @access public
* @return void
*/
public function runZTFScript()
{
$params = array(
'cmd' => '',
'ids' => '',
'path' => '',
'task' => '',
'workspace' => ''
);
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/jobs/add", json_encode($params), array(), array("Authorization:$node->tokenSN")));
if(empty($result->data) || $result->code != 'success')
{
$result = new stdclass;
$result->data = $this->lang->zanode->init->serviceStatus;
}
return array(
"ZenAgent" => "ready",
"ZTF" => $result->data->ztfStatus,
);
}
}
+15 -8
View File
@@ -75,20 +75,27 @@
<td class='c-actions'>
<?php
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
$suspendAttr .= $node->status == 'suspend' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$suspendAttr .= $node->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
$resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'";
$resumeAttr .= $node->status == 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
$rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'";
$rebootAttr .= $node->status == 'suspend' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
$rebootAttr .= $node->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
common::printLink('zanode', 'suspend', "zanodeID={$node->id}", "<i class='icon icon-pause'></i> ", '', $suspendAttr);
common::printLink('zanode', 'resume', "zanodeID={$node->id}", "<i class='icon icon-back'></i> ", '', $resumeAttr);
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
common::printLink('zanode', 'createImage', "zanodeID={$node->id}", "<i class='icon icon-plus'></i> ", '', "class='btn iframe' title='{$lang->zanode->createImage}' data-width='50%'", '', true);
common::printIcon('zanode', 'edit', "id={$node->id}", $node, 'list');
common::printLink('zanode', 'delete', "zanodeID={$node->id}", "<i class='icon icon-trash'></i> ", '', "title='{$lang->zanode->destroy}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmDelete}\")==false) return false;'");
if($node->status == "suspend")
{
if(common::hasPriv('zahost', 'resume')) common::printLink('zanode', 'resume', "zanodeID={$node->id}", "<i class='icon icon-back'></i> ", '', $resumeAttr);
}
else
{
if(common::hasPriv('zahost', 'suspend')) common::printLink('zanode', 'suspend', "zanodeID={$node->id}", "<i class='icon icon-pause'></i> ", '', $suspendAttr);
}
if(common::hasPriv('zahost', 'reboot')) common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
if(common::hasPriv('zahost', 'createImage')) common::printLink('zanode', 'createImage', "zanodeID={$node->id}", "<i class='icon icon-plus'></i> ", '', "class='btn iframe' title='{$lang->zanode->createImage}' data-width='50%'", '', true);
if(common::hasPriv('zahost', 'edit')) common::printIcon('zanode', 'edit', "id={$node->id}", $node, 'list');
if(common::hasPriv('zahost', 'delete')) common::printLink('zanode', 'delete', "zanodeID={$node->id}", "<i class='icon icon-trash'></i> ", '', "title='{$lang->zanode->destroy}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmDelete}\")==false) return false;'");
if(common::hasPriv('zahost', 'init')) common::printIcon('zanode', 'init', "hostID={$node->id}", $node, 'list', 'refresh', '', ' init', false, "data-placement='bottom'", $lang->zanode->init->title);
?>
</td>
</tr>
+1 -1
View File
@@ -57,7 +57,7 @@
</div>
<?php if($task):?>
<script>
var setProgress = self.setInterval("getTaskProgress()",1500);
var setProgress = self.setInterval("getTaskProgress()", 1500);
$(function()
{
+10 -9
View File
@@ -1,7 +1,7 @@
<?php
/**
* The view file of zahost module of ZenTaoPMS.
* The view file of zanode module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
@@ -12,21 +12,21 @@
*/
?>
<?php include '../../common/view/header.html.php'; ?>
<?php js::set('hostID', $hostID) ?>
<?php js::set('zahostLang', $lang->zahost); ?>
<?php js::set('nodeID', $nodeID) ?>
<?php js::set('zanodeLang', $lang->zanode); ?>
<div id='mainContent' class='main-content'>
<div class='main-col main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->zahost->initHost->title; ?></h2>
<h2><?php echo $lang->zanode->init->title; ?></h2>
</div>
<div class="host-desc-container">
<h4><?php echo $lang->zahost->initHost->descTitle; ?></h4>
<h4><?php echo $lang->zanode->init->descTitle; ?></h4>
<div>
<span class='dot-symbol'></span>
<span>
<?php echo $lang->zahost->initHost->initDesc . ' ' . $host->secret . ' -z ' . getWebRoot(true); ?>
<span class='zahost-init-desc'>
<?php echo sprintf($lang->zanode->init->initDesc, $node->secret . ' -z ' . getWebRoot(true)); ?>
</span>
</div>
<div id="statusContainer">
@@ -34,10 +34,11 @@
</div>
<div class="text-center host-action">
<button type='button' id='checkServiceStatus' class='btn btn-info margin-top-18'><?php echo $lang->zahost->initHost->checkStatus; ?></button>
<button type='button' id='checkServiceStatus' class='btn btn-info margin-top-18'><?php echo $lang->zanode->init->checkStatus; ?></button>
<?php echo html::backButton('' . $lang->goback, "data-app='{$app->tab}'", 'btn'); ?>
</div>
</div>
</div>
</div>
<?php include 'successmodal.html.php';?>
<?php include '../../common/view/successmodal.html.php';?>
<?php include '../../common/view/footer.html.php'; ?>
@@ -2,7 +2,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<?php echo html::a($this->createLink('zahost', 'browse'), '×', '', 'class="close"');?>
<?php echo html::a($this->createLink('zanode', 'browse'), '×', '', 'class="close"');?>
</div>
<div class="modal-body">
<p>
+14 -3
View File
@@ -42,8 +42,8 @@
<div class="main-row">
<div class="col-4">
<div class="main-row">
<div class="col-4 text-right"><?php echo $lang->zanode->status; ?>:</div>
<div class="col-8"><?php echo zget($lang->zanode->statusList, $zanode->status); ?></div>
<div class="col-4 text-right">IP:</div>
<div class="col-8"><?php echo $zanode->extranet; ?></div>
</div>
</div>
<div class="col-4">
@@ -79,6 +79,17 @@
</div>
</div>
</div>
<div class="main-row">
<div class="col-4">
<div class="main-row">
<div class="col-4 text-right"><?php echo $lang->zanode->status; ?>:</div>
<div class="col-8"><?php echo zget($lang->zanode->statusList, $zanode->status); ?></div>
</div>
</div>
<div class="col-4"></div>
<div class="col-4"></div>
<div class="col-4"></div>
</div>
</div>
</div>
<div class="detail zanode-detail">
@@ -105,7 +116,7 @@
{
common::printLink('zanode', 'resume', "id={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->resume, '', "title='{$lang->zanode->resume}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'");
}
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn iframe'", '', true);
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn iframe " . (common::hasPriv('zahost', 'getVNC') && $zanode->status == 'running' ? '':'disabled') . "'", '', true);
}
?>
<div class='divider'></div>
+17 -15
View File
@@ -94,19 +94,20 @@ class testcaseTest
/**
* Test get cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $browseType
* @param string $auto
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
if(dao::isError()) return dao::getError();
@@ -116,19 +117,20 @@ class testcaseTest
/**
* Test get project cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $browseType
* @param string $auto
* @param string $caseType
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
if(dao::isError()) return dao::getError();
@@ -221,7 +223,7 @@ class testcaseTest
*/
public function getTestCasesTest($productID, $browseType, $queryID, $auto = 'no')
{
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, 'id_desc', null, $auto);
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, '', 'id_desc', null, $auto);
if(dao::isError()) return dao::getError();