diff --git a/db/update11.6.sql b/db/update11.6.sql index 9bfd776fa2..c6eb221c64 100644 --- a/db/update11.6.sql +++ b/db/update11.6.sql @@ -2,3 +2,12 @@ ALTER TABLE `zt_translation` CHANGE `refer` `referer` text COLLATE 'utf8_general_ci' NOT NULL AFTER `value`, CHANGE `translationTime` `translatedTime` datetime NOT NULL AFTER `translator`, CHANGE `reviewTime` `reviewedTime` datetime NOT NULL AFTER `reviewer`; + +ALTER TABLE `zt_product` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_release` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_story` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_project` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_task` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_bug` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_case` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; +ALTER TABLE `zt_testtask` ADD `subStatus` varchar(30) NOT NULL AFTER `status`; diff --git a/db/zentao.sql b/db/zentao.sql index 870efc0f9b..a4bff7cd52 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -68,6 +68,7 @@ CREATE TABLE IF NOT EXISTS `zt_bug` ( `found` varchar(30) NOT NULL default '', `steps` text NOT NULL, `status` enum('active','resolved','closed') NOT NULL default 'active', + `subStatus` varchar(30) NOT NULL default '', `color` char(7) NOT NULL, `confirmed` tinyint(1) NOT NULL default '0', `activatedCount` smallint(6) NOT NULL, @@ -154,6 +155,7 @@ CREATE TABLE IF NOT EXISTS `zt_case` ( `scriptStatus` varchar(30) NOT NULL, `scriptLocation` varchar(255) NOT NULL, `status` char(30) NOT NULL default '1', + `subStatus` varchar(30) NOT NULL default '', `color` char(7) NOT NULL, `frequency` enum('1','2','3') NOT NULL default '1', `order` tinyint(30) unsigned NOT NULL default '0', @@ -444,6 +446,7 @@ CREATE TABLE IF NOT EXISTS `zt_product` ( `line` mediumint(8) NOT NULL, `type` varchar(30) NOT NULL default 'normal', `status` varchar(30) NOT NULL default '', + `subStatus` varchar(30) NOT NULL default '', `desc` text NOT NULL, `PO` varchar(30) NOT NULL, `QD` varchar(30) NOT NULL, @@ -487,6 +490,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `end` date NOT NULL, `days` smallint(5) unsigned NOT NULL, `status` varchar(10) NOT NULL, + `subStatus` varchar(30) NOT NULL default '', `statge` enum('1','2','3','4','5') NOT NULL default '1', `pri` enum('1','2','3','4') NOT NULL default '1', `desc` text NOT NULL, @@ -544,6 +548,7 @@ CREATE TABLE IF NOT EXISTS `zt_release` ( `leftBugs` text NOT NULL, `desc` text NOT NULL, `status` varchar(20) NOT NULL default 'normal', + `subStatus` varchar(30) NOT NULL default '', `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), @@ -565,6 +570,7 @@ CREATE TABLE IF NOT EXISTS `zt_story` ( `pri` tinyint(3) unsigned NOT NULL default '3', `estimate` float unsigned NOT NULL, `status` enum('','changed','active','draft','closed') NOT NULL default '', + `subStatus` varchar(30) NOT NULL default '', `color` char(7) NOT NULL, `stage` enum('','wait','planned','projected','developing','developed','testing','tested','verified','released', 'closed') NOT NULL DEFAULT 'wait', `stagedBy` char(30) NOT NULL, @@ -634,6 +640,7 @@ CREATE TABLE IF NOT EXISTS `zt_task` ( `left` float unsigned NOT NULL, `deadline` date NOT NULL, `status` enum('wait','doing','done','pause','cancel','closed') NOT NULL default 'wait', + `subStatus` varchar(30) NOT NULL default '', `color` char(7) NOT NULL, `mailto` text, `desc` text NOT NULL, @@ -771,6 +778,7 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` ( `desc` text NOT NULL, `report` text NOT NULL, `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', + `subStatus` varchar(30) NOT NULL default '', `deleted` enum('0','1') NOT NULL default '0', PRIMARY KEY (`id`), KEY `product` (`product`), diff --git a/module/bug/lang/de.php b/module/bug/lang/de.php index 2f40a8e078..3166a5a70e 100644 --- a/module/bug/lang/de.php +++ b/module/bug/lang/de.php @@ -30,6 +30,7 @@ $lang->bug->browser = 'Browser'; $lang->bug->steps = 'Reproduktionsschritte'; $lang->bug->status = 'Status'; $lang->bug->statusAB = 'Status'; +$lang->bug->subStatus = 'Sub Status'; $lang->bug->activatedCount = 'Aktiv'; $lang->bug->activatedCountAB = 'Aktiv'; $lang->bug->activatedDate = 'Aktiv seit'; diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 7b0831dd2e..a5039d2a7c 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -30,6 +30,7 @@ $lang->bug->browser = 'Browser'; $lang->bug->steps = 'Repro Steps'; $lang->bug->status = 'Status'; $lang->bug->statusAB = 'Status'; +$lang->bug->subStatus = 'Sub Status'; $lang->bug->activatedCount = 'Activated Times'; $lang->bug->activatedCountAB = 'Active'; $lang->bug->activatedDate = 'ActivatedDate'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 81f18b16a4..43768c566f 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -30,6 +30,7 @@ $lang->bug->browser = '浏览器'; $lang->bug->steps = '重现步骤'; $lang->bug->status = 'Bug状态'; $lang->bug->statusAB = '状态'; +$lang->bug->subStatus = 'Bug子状态'; $lang->bug->activatedCount = '激活次数'; $lang->bug->activatedCountAB = '激活次数'; $lang->bug->activatedDate = '激活日期'; diff --git a/module/common/model.php b/module/common/model.php index b0af0b2c0e..3460942eb2 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1075,7 +1075,29 @@ EOD; */ public static function createChanges($old, $new) { - global $config; + global $app, $config; + + /** + * 当主状态改变并且未设置子状态的值时把子状态的值置空并记录日志。 + * Change sub status when status is changed and sub status is not set, and record the changes. + */ + if(isset($config->bizVersion)) + { + $oldID = zget($old, 'id', ''); + $oldStatus = zget($old, 'status', ''); + $oldSubStatus = zget($old, 'subStatus', ''); + $newStatus = zget($new, 'status', ''); + $newSubStatus = zget($new, 'subStatus', ''); + + if($oldID && $oldStatus && $oldSubStatus && $newStatus && !$newSubStatus && $oldStatus != $newStatus) + { + $table = zget($config->objectTables, $app->getModuleName()); + $app->dbh->exec("UPDATE $table SET `subStatus` = '' WHERE `id` = $oldID"); + + $new->subStatus = ''; + } + } + $changes = array(); $magicQuote = get_magic_quotes_gpc(); foreach($new as $key => $value) diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index 6e8952895d..f0a271f871 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -49,7 +49,7 @@ $(function()