diff --git a/db/update17.6.2.sql b/db/update17.6.2.sql index 1205c3989a..a7a22f7872 100644 --- a/db/update17.6.2.sql +++ b/db/update17.6.2.sql @@ -69,6 +69,8 @@ ALTER TABLE `zt_project` ADD `colWidth` smallint(4) NOT NULL DEFAULT '264' AFTER ALTER TABLE `zt_project` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '180' AFTER `colWidth`; ALTER TABLE `zt_project` ADD `maxColWidth` smallint(4) NOT NULL DEFAULT '384' AFTER `minColWidth`; +REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'syncProduct', '{"feedback":{},"ticket":{}}'); + ALTER TABLE `zt_feedback` ADD `pri` tinyint unsigned NOT NULL DEFAULT 2; ALTER TABLE `zt_feedback` ADD `source` varchar(255) NOT NULL; ALTER TABLE `zt_feedback` CHANGE `pri` `pri` tinyint unsigned NOT NULL DEFAULT 2; diff --git a/db/zentao.sql b/db/zentao.sql index f82efc8be9..49725315db 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6309,7 +6309,7 @@ INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES (' INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'unitList', 'CNY,USD'); INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'defaultCurrency', 'CNY'); INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'story', '', 'reviewRules', 'allpass'); -INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'syncProductFeedback', '{}'); +INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'syncProduct', '{"feedback":{},"ticket":{}}'); -- DROP TABLE IF EXISTS `zt_im_chat`; CREATE TABLE IF NOT EXISTS `zt_im_chat` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, diff --git a/module/product/model.php b/module/product/model.php index bac3985956..3f79ead694 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -2315,6 +2315,10 @@ class productModel extends model { return helper::createLink('feedback', 'admin', "browseType=byProduct&productID=%s"); } + elseif($module == 'ticket') + { + return helper::createLink('ticket', 'browse', "browseType=byProduct&productID=%s"); + } return $link; } diff --git a/module/product/view/ajaxgetdropmenu.html.php b/module/product/view/ajaxgetdropmenu.html.php index eeddfd93c2..e6d20e7f80 100644 --- a/module/product/view/ajaxgetdropmenu.html.php +++ b/module/product/view/ajaxgetdropmenu.html.php @@ -139,8 +139,13 @@ $closedProductsHtml .= ''; product->closed?> app->tab == 'feedback'):?> + product->all, '', "class='not-list-item pull-left toggle-left-col $selected'"); ?> + + product->all, '', "class='not-list-item pull-left toggle-left-col $selected'"); ?> + + diff --git a/module/testtask/lang/zh-cn.php b/module/testtask/lang/zh-cn.php index 89383c248e..a2712d8935 100644 --- a/module/testtask/lang/zh-cn.php +++ b/module/testtask/lang/zh-cn.php @@ -108,7 +108,7 @@ $lang->testtask->summary = '有%s个用例,失败%s个,耗时%s。 $lang->testtask->pageSummary = '本页共 %s 个测试单。'; $lang->testtask->mySummary = '本页共 %s 个测试单,待测试测试单 %s,测试中测试单 %s,被阻塞测试单 %s。'; $lang->testtask->allSummary = '本页共 %s 个测试单,待测试测试单 %s,测试中测试单 %s,被阻塞测试单 %s,已测测试单 %s。'; -$lang->testtask->checkedAllSummary = '共选中 %total% 个测试单,待测试测试单 %wait%,测试中测试单 %testing%,被阻塞测试单 %blocked%,,已测测试单 %done%。'; +$lang->testtask->checkedAllSummary = '共选中 %total% 个测试单,待测试测试单 %wait%,测试中测试单 %testing%,被阻塞测试单 %blocked%,已测测试单 %done%。'; $lang->testtask->beginAndEnd = '起止时间'; $lang->testtask->to = '至'; diff --git a/module/tree/control.php b/module/tree/control.php index 2cb3028419..e874172f05 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -45,7 +45,7 @@ class tree extends control $products = $this->product->getProducts($this->session->project, 'all', '', false); if($viewType == 'case') $this->lang->modulePageNav = $this->product->select($products, $rootID, 'tree', 'browse', 'case', $branch); } - else if($this->app->tab == 'feedback') + else if($this->app->tab == 'feedback' or $this->app->tab == 'ticket') { $products = $this->loadModel('feedback')->getGrantProducts(); if(!$rootID) $rootID = key($products); @@ -133,7 +133,7 @@ class tree extends control $position[] = html::a($this->createLink('bug', 'browse', "product=$rootID"), $product->name); $position[] = $this->lang->tree->manageBug; } - elseif($viewType == 'feedback') + elseif($viewType == 'feedback' or $viewType == 'ticket') { $this->app->loadLang('feedback'); $this->lang->tree->menu = $this->lang->feedback->menu; @@ -141,9 +141,10 @@ class tree extends control $root = new stdclass(); $root->name = !empty($rootID) ? $productItem->name : $this->lang->feedback->common; $this->view->root = $root; - $this->view->syncConfig = json_decode($this->config->global->syncProductFeedback, true); + $syncConfig = json_decode($this->config->global->syncProduct, true); + $this->view->syncConfig = isset($syncConfig[$viewType]) ? $syncConfig[$viewType] : array(); - $title = $this->lang->tree->manageFeedback; + $title = $this->lang->tree->{$viewType == 'feedback' ? 'manageFeedback' : 'manageTicket'}; $position[] = html::a($this->createLink('feedback', 'admin'), $this->lang->tree->manageFeedback); } elseif($viewType == 'case') diff --git a/module/tree/model.php b/module/tree/model.php index 53bcaa06aa..574008eff8 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -82,8 +82,9 @@ class treeModel extends model } /* If feedback module is merge add story module.*/ - $syncConfig = json_decode($this->config->global->syncProductFeedback, true); - if($type == 'feedback' and strpos($param, 'noproduct') === false and isset($syncConfig[$rootID])) $type = 'story,' . $type; + $syncConfig = json_decode($this->config->global->syncProduct, true); + $syncConfig = isset($syncConfig[$type]) ? $syncConfig[$type] : array(); + if(($type == 'feedback' or $type == 'ticket') and strpos($param, 'noproduct') === false and isset($syncConfig[$rootID])) $type = 'story,' . $type; if($this->isMergeModule($rootID, $type)) { return $this->dao->select('*')->from(TABLE_MODULE) @@ -1312,6 +1313,19 @@ class treeModel extends model return html::a(helper::createLink('feedback', $this->app->methodName, "type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); } + /** + * Create link of ticket. + * + * @param string $type + * @param object $module + * @access public + * @return string + */ + public function createTicketLink($type, $module) + { + return html::a(helper::createLink('ticket', $this->app->methodName, "type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' title='{$module->name}'"); + } + /** * Create link of trainskill. * @@ -1382,8 +1396,9 @@ class treeModel extends model { if($type == 'line') $rootID = 0; - $syncConfig = json_decode($this->config->global->syncProductFeedback, true); - if($type == 'feedback' and isset($syncConfig[$rootID])) $type = "$type,story"; + $syncConfig = json_decode($this->config->global->syncProduct, true); + $syncConfig = isset($syncConfig[$type]) ? $syncConfig[$type] : array(); + if(($type == 'feedback' or $type == 'ticket') and isset($syncConfig[$rootID])) $type = "$type,story"; /* if createVersion <= 4.1 or type == 'story', only get modules of its type. */ if(!$this->isMergeModule($rootID, $type) or $type == 'story') diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index fa224c9778..84a5815426 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -106,7 +106,9 @@ if($viewType == 'doc' or $viewType == 'api')
tree->syncFromProduct, '', "class='btn btn-sm btn-primary'")?>
-
createLink('feedback', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe'");?>
+
createLink('feedback', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe' data-width='40%'");?>
+ +
createLink('ticket', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe' data-width='40%'");?>
@@ -229,6 +231,8 @@ $(function() var $toggle = $('' + link + ''); if(item.type === 'bug') $toggle.append('  [B]'); if(item.type === 'case') $toggle.append('  [C]'); + if(item.type === 'feedback') $toggle.append('  [F]'); + if(item.type === 'ticket') $toggle.append('  [T]'); $li.append($toggle); if(item.nodeType || item.type) $li.addClass('tree-item-' + (item.nodeType || item.type)); $li.toggleClass('active', === item.id);