Merge branch 'tanghucheng_feedback_module'
This commit is contained in:
@@ -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;
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -139,8 +139,13 @@ $closedProductsHtml .= '</ul>';
|
||||
<a class='pull-right toggle-right-col not-list-item'><?php echo $lang->product->closed?><i class='icon icon-angle-right'></i></a>
|
||||
<?php if($this->app->tab == 'feedback'):?>
|
||||
<?php $selected = !$productID ? 'selected' : '';?>
|
||||
<?php if($module == 'feedback'):?>
|
||||
<?php echo html::a(helper::createLink('feedback', 'admin', 'browseType=byProduct¶m=all'), $lang->product->all, '', "class='not-list-item pull-left toggle-left-col $selected'"); ?>
|
||||
<?php endif;?>
|
||||
<?php if($module == 'ticket'):?>
|
||||
<?php echo html::a(helper::createLink('ticket', 'browse', 'browseType=byProduct¶m=all'), $lang->product->all, '', "class='not-list-item pull-left toggle-left-col $selected'"); ?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gray-line" hidden></div>
|
||||
|
||||
@@ -108,7 +108,7 @@ $lang->testtask->summary = '有%s个用例,失败%s个,耗时%s。
|
||||
$lang->testtask->pageSummary = '本页共 <strong>%s</strong> 个测试单。';
|
||||
$lang->testtask->mySummary = '本页共 <strong>%s</strong> 个测试单,待测试测试单 <strong>%s</strong>,测试中测试单 <strong>%s</strong>,被阻塞测试单 <strong>%s</strong>。';
|
||||
$lang->testtask->allSummary = '本页共 <strong>%s</strong> 个测试单,待测试测试单 <strong>%s</strong>,测试中测试单 <strong>%s</strong>,被阻塞测试单 <strong>%s</strong>,已测测试单 <strong>%s</strong>。';
|
||||
$lang->testtask->checkedAllSummary = '共选中 <strong>%total%</strong> 个测试单,待测试测试单 <strong>%wait%</strong>,测试中测试单 <strong>%testing%</strong>,被阻塞测试单 <strong>%blocked%</strong>,,已测测试单 <strong>%done%</strong>。';
|
||||
$lang->testtask->checkedAllSummary = '共选中 <strong>%total%</strong> 个测试单,待测试测试单 <strong>%wait%</strong>,测试中测试单 <strong>%testing%</strong>,被阻塞测试单 <strong>%blocked%</strong>,已测测试单 <strong>%done%</strong>。';
|
||||
|
||||
$lang->testtask->beginAndEnd = '起止时间';
|
||||
$lang->testtask->to = '至';
|
||||
|
||||
@@ -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')
|
||||
|
||||
+19
-4
@@ -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')
|
||||
|
||||
@@ -106,7 +106,9 @@ if($viewType == 'doc' or $viewType == 'api')
|
||||
<?php if($viewType == 'story' and $allProduct and $canBeChanged):?>
|
||||
<div class="panel-actions btn-toolbar"><?php echo html::a('javascript:toggleCopy()', $lang->tree->syncFromProduct, '', "class='btn btn-sm btn-primary'")?></div>
|
||||
<?php elseif($viewType == 'feedback' and common::hasPriv('feedback', 'syncProduct') and !isset($syncConfig[$rootID])):?>
|
||||
<div class="panel-actions btn-toolbar"><?php echo html::a($this->createLink('feedback', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe'");?></div>
|
||||
<div class="panel-actions btn-toolbar"><?php echo html::a($this->createLink('feedback', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe' data-width='40%'");?></div>
|
||||
<?php elseif($viewType == 'ticket' and common::hasPriv('ticket', 'syncProduct') and !isset($syncConfig[$rootID])):?>
|
||||
<div class="panel-actions btn-toolbar"><?php echo html::a($this->createLink('ticket', 'syncProduct', "productID=$rootID", '', true), $lang->tree->syncProductModule, '', "class='btn btn-sm btn-primary iframe' data-width='40%'");?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@@ -229,6 +231,8 @@ $(function()
|
||||
var $toggle = $('<span class="module-name" data-id="' + item.id + '">' + link + '</span>');
|
||||
if(item.type === 'bug') $toggle.append(' <span class="text-muted">[B]</span>');
|
||||
if(item.type === 'case') $toggle.append(' <span class="text-muted">[C]</span>');
|
||||
if(item.type === 'feedback') $toggle.append(' <span class="text-muted">[F]</span>');
|
||||
if(item.type === 'ticket') $toggle.append(' <span class="text-muted">[T]</span>');
|
||||
$li.append($toggle);
|
||||
if(item.nodeType || item.type) $li.addClass('tree-item-' + (item.nodeType || item.type));
|
||||
$li.toggleClass('active', <?php echo $currentModuleID ?> === item.id);
|
||||
|
||||
Reference in New Issue
Block a user