* Set as working as only test.

This commit is contained in:
daitingting
2017-05-05 12:09:19 +08:00
parent 868227856f
commit ce174f973c
31 changed files with 420 additions and 186 deletions
+5 -1
View File
@@ -40,6 +40,11 @@ class router extends baseRouter
$productProject = false;
if($this->dbh and !empty($this->config->db->name))
{
global $config;
if(!isset($config->global)) $config->global = new stdclass();
$flow = $this->dbh->query('SELECT value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND `module`='common' AND `key`='flow'")->fetch();
$config->global->flow = $flow->value;
try
{
$productProject = $this->dbh->query('SELECT value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND `module`='custom' AND `key`='productProject'")->fetch();
@@ -53,7 +58,6 @@ class router extends baseRouter
$message = $exception->getMessage();
if(strpos($repairCode, "|$errorCode|") !== false or ($errorCode == '1016' and strpos($errorMsg, 'errno: 145') !== false) or strpos($message, 'repair') !== false)
{
global $config;
if(isset($config->framework->autoRepairTable) and $config->framework->autoRepairTable)
{
header("location: " . $config->webRoot . 'checktable.php');
+7 -9
View File
@@ -49,13 +49,10 @@ class block extends control
if(!common::hasPriv($moduleKey, 'index')) unset($modules[$moduleKey]);
}
if($this->config->global->flow != 'full')
{
unset($modules['todo']);
unset($modules['qa']);
}
if($this->config->global->flow == 'onlyStory') unset($modules['project']);
if($this->config->global->flow == 'onlyTask') unset($modules['product']);
if($this->config->global->flow != 'full') unset($modules['todo']);
if($this->config->global->flow == 'onlyTask' or $this->config->global->flow == 'onlyStory') unset($modules['qa']);
if($this->config->global->flow == 'onlyTask' or $this->config->global->flow == 'onlyTest') unset($modules['product']);
if($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest') unset($modules['project']);
$closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : '';
if(strpos(",$closedBlock,", ",|dynamic,") === false) $modules['dynamic'] = $this->lang->block->dynamic;
@@ -213,8 +210,9 @@ class block extends control
foreach($blocks as $key => $block)
{
if($this->config->global->flow == 'onlyStory' and strpos(',product,story,', ',' . $block->source . ',') === false and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyTask' and strpos(',project,task,', ',' . $block->source . ',') === false and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyStory' and $block->source != 'product' and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyTask' and $block->source != 'project' and $block->block != 'dynamic') unset($blocks[$key]);
if($this->config->global->flow == 'onlyTest' and $block->source != 'qa' and $block->block != 'dynamic') unset($blocks[$key]);
$block->params = json_decode($block->params);
$blockID = $block->block;
+8 -3
View File
@@ -22,6 +22,8 @@ $config->bug->list->allFields = 'id, module, project, story, task,
case,
lastEditedBy,
lastEditedDate';
if($config->global->flow == 'onlyTest') $config->bug->list->allFields = str_replace(array('project, ', 'task,'), '', $config->bug->list->allFields);
$config->bug->list->defaultFields = 'id,severity,pri,title,openedBy,assignedTo,resolvedBy,resolution';
$config->bug->list->exportFields = 'id, product, branch, module, project, story, task,
@@ -71,7 +73,7 @@ $config->bug->search['fields']['product'] = $lang->bug->product;
$config->bug->search['fields']['branch'] = '';
$config->bug->search['fields']['plan'] = $lang->bug->productplan;
$config->bug->search['fields']['module'] = $lang->bug->module;
$config->bug->search['fields']['project'] = $lang->bug->project;
if($config->global->flow != 'onlyTest') $config->bug->search['fields']['project'] = $lang->bug->project;
$config->bug->search['fields']['severity'] = $lang->bug->severity;
$config->bug->search['fields']['pri'] = $lang->bug->pri;
@@ -82,8 +84,11 @@ $config->bug->search['fields']['resolution'] = $lang->bug->resolution;
$config->bug->search['fields']['activatedCount'] = $lang->bug->activatedCount;
$config->bug->search['fields']['toTask'] = $lang->bug->toTask;
$config->bug->search['fields']['toStory'] = $lang->bug->toStory;
if($config->global->flow != 'onlyTest')
{
$config->bug->search['fields']['toTask'] = $lang->bug->toTask;
$config->bug->search['fields']['toStory'] = $lang->bug->toStory;
}
$config->bug->search['fields']['openedBy'] = $lang->bug->openedBy;
$config->bug->search['fields']['closedBy'] = $lang->bug->closedBy;
+1
View File
@@ -33,6 +33,7 @@ js::set('bugBrowseType', ($browseType == 'bymodule' and $this->session->bugBrows
</li>
<?php foreach(customModel::getFeatureMenu($this->moduleName, $this->methodName) as $menuItem):?>
<?php if(isset($menuItem->hidden)) continue;?>
<?php if($this->config->global->flow == 'onlyTest' and $menuItem->name == 'needconfirm') continue;?>
<?php if(strpos($menuItem->name, 'QUERY') === 0):?>
<?php $queryID = (int)substr($menuItem->name, 5);?>
<li id='<?php echo $menuItem->name?>Tab'><?php echo html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=bySearch&param=$queryID"), $menuItem->text)?></li>
+3 -1
View File
@@ -60,6 +60,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
</td>
<td></td>
</tr>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php $showProject = strpos(",$showFields,", ',project,') !== false;?>
<tr>
<th><?php echo ($showProject) ? $lang->bug->project : $lang->bug->openedBuild;?></th>
@@ -77,6 +78,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
</div>
</td>
</tr>
<?php endif;?>
<tr>
<th><nobr><?php echo $lang->bug->lblAssignedTo;?></nobr></th>
<td>
@@ -212,7 +214,7 @@ js::set('confirmDeleteTemplate', $lang->bug->confirmDeleteTemplate);
$showStory = strpos(",$showFields,", ',story,') !== false;
$showTask = strpos(",$showFields,", ',task,') !== false;
?>
<?php if($showStory or $showTask):?>
<?php if(($showStory or $showTask) and $this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo ($showStory) ? $lang->bug->story : $lang->bug->task;?></th>
<?php if($showStory):?>
+4
View File
@@ -102,12 +102,14 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
</div>
</td>
</tr>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->bug->productplan;?></th>
<td>
<span id="planIdBox"><?php echo html::select('plan', $plans, $bug->plan, "class='form-control chosen'");?></span>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->bug->type;?></th>
<td>
@@ -166,6 +168,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
</table>
</fieldset>
<?php if($this->config->global->flow != 'onlyTest'):?>
<fieldset>
<legend><?php echo $lang->bug->legendPrjStoryTask;?></legend>
<table class='table table-form'>
@@ -184,6 +187,7 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
</tr>
</table>
</fieldset>
<?php endif;?>
<fieldset>
<legend><?php echo $lang->bug->legendLife;?></legend>
+3 -1
View File
@@ -36,7 +36,7 @@
common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true);
common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true);
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']);
if($this->config->global->flow != 'onlyTest') common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']);
common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap');
echo '</div>';
@@ -316,6 +316,7 @@
</td>
</tr>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php if($bug->toStory != 0):?>
<tr>
<th><?php echo $lang->bug->toStory;?></th>
@@ -328,6 +329,7 @@
<td><?php echo html::a($this->createLink('task', 'view', "taskID=$bug->toTask"), "#$bug->toTask $bug->toTaskTitle", '_blank');?></td>
</tr>
<?php endif;?>
<?php endif;?>
</table>
</div>
</div>
+114 -59
View File
@@ -31,32 +31,50 @@ class build extends control
/* Load these models. */
$this->loadModel('project');
$this->loadModel('user');
if($this->config->global->flow == 'onlyTest')
{
$product = $this->loadModel('product')->getByID($projectID);
$products = $this->product->getPairs();
$this->product->setMenu($products, $projectID);
/* Set menu. */
$this->project->setMenu($this->project->getPairs(), $projectID);
$productGroups = array();
$product->branch = 0;
foreach($products as $productID => $name) $productGroups[$productID]['branch'] = 0;
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
$this->view->title = $this->lang->build->create;
$this->view->product = $product;
$this->view->branches = ($product and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($projectID);
}
else
{
/* Set menu. */
$this->project->setMenu($this->project->getPairs(), $projectID);
/* Assign. */
$project = $this->loadModel('project')->getById($projectID);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
$productGroups = $this->project->getProducts($projectID);
$productID = key($productGroups);
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
/* Assign. */
$project = $this->loadModel('project')->getById($projectID);
$productGroups = $this->project->getProducts($projectID);
$productID = key($productGroups);
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
$this->view->title = $project->name . $this->lang->colon . $this->lang->build->create;
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->build->create;
$this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : '';
$this->view->branches = (isset($productGroups[$productID]) and $productGroups[$productID]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID);
$this->view->projectID = $projectID;
$this->view->orderBy = $orderBy;
}
$this->view->title = $project->name . $this->lang->colon . $this->lang->build->create;
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$projectID"), $project->name);
$this->view->position[] = $this->lang->build->create;
$this->view->productGroups = $productGroups;
$this->view->products = $products;
$this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : '';
$this->view->branches = (isset($productGroups[$productID]) and $productGroups[$productID]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($productID);
$this->view->projectID = $projectID;
$this->view->lastBuild = $this->build->getLast($projectID);
$this->view->productGroups = $productGroups;
$this->view->users = $this->user->getPairs('nodeleted');
$this->view->orderBy = $orderBy;
$this->display();
}
@@ -85,43 +103,64 @@ class build extends control
die(js::locate(inlink('view', "buildID=$buildID"), 'parent'));
}
$this->loadModel('project');
/* Set menu. */
$build = $this->build->getById((int)$buildID);
$this->project->setMenu($this->project->getPairs(), $build->project);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
/* Assign. */
$project = $this->loadModel('project')->getById($build->project);
if(empty($project))
if($this->config->global->flow == 'onlyTest')
{
$project = new stdclass();
$project->name = '';
$product = $this->loadModel('product')->getById($build->product);
$products = $this->product->getPairs();
$this->product->setMenu($products, $build->product);
$productGroups = array();
$product->branch = 0;
foreach($products as $productID => $name) $productGroups[$productID]['branch'] = 0;
$this->view->title = $this->lang->build->edit;
$this->view->position[] = $this->lang->build->edit;
$this->view->product = $product;
$this->view->branches = ($product and $product->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($build->product);
}
else
{
$this->loadModel('project');
/* Set menu. */
$this->project->setMenu($this->project->getPairs(), $build->project);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
/* Assign. */
$project = $this->loadModel('project')->getById($build->project);
if(empty($project))
{
$project = new stdclass();
$project->name = '';
}
$productGroups = $this->project->getProducts($build->project);
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
if(empty($productGroups) and $build->product)
{
$product = $this->loadModel('product')->getById($build->product);
$products[$product->id] = $product->name;
}
$this->view->title = $project->name . $this->lang->colon . $this->lang->build->edit;
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $project->name);
$this->view->position[] = $this->lang->build->edit;
$this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : '';
$this->view->branches = (isset($productGroups[$build->product]) and $productGroups[$build->product]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($build->product);
$this->view->orderBy = $orderBy;
$this->display();
}
$productGroups = $this->project->getProducts($build->project);
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
if(empty($productGroups) and $build->product)
{
$product = $this->loadModel('product')->getById($build->product);
$products[$product->id] = $product->name;
}
$this->view->title = $project->name . $this->lang->colon . $this->lang->build->edit;
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $project->name);
$this->view->position[] = $this->lang->build->edit;
$this->view->productGroups = $productGroups;
$this->view->products = $products;
$this->view->product = isset($productGroups[$build->product]) ? $productGroups[$build->product] : '';
$this->view->branches = (isset($productGroups[$build->product]) and $productGroups[$build->product]->type == 'normal') ? array() : $this->loadModel('branch')->getPairs($build->product);
$this->view->users = $this->loadModel('user')->getPairs();
$this->view->build = $build;
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', $build->builder);
$this->view->orderBy = $orderBy;
$this->display();
}
@@ -147,25 +186,39 @@ class build extends control
$product = $this->loadModel('product')->getById($build->product);
if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)->fetchAll('id');
$stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage');
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->andWhere('deleted')->eq(0)->fetchAll();
$this->loadModel('project')->setMenu($this->project->getPairs(), $build->project);
if($this->config->global->flow == 'onlyTest')
{
$products = $this->loadModel('product')->getPairs();
$this->product->setMenu($products, $build->product);
$this->view->title = "BUILD #$build->id $build->name - " . $build->productName;
$this->view->position[] = html::a($this->createLink('product', 'build', "productID=$build->product"), $build->productName);
$this->view->position[] = $this->lang->build->view;
}
else
{
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->andWhere('deleted')->eq(0)->fetchAll('id');
$stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage');
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
$this->loadModel('project')->setMenu($this->project->getPairs(), $build->project);
$projects = $this->project->getPairs('empty');
$this->view->title = "BUILD #$build->id $build->name - " . $projects[$build->project];
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]);
$this->view->position[] = $this->lang->build->view;
$this->view->stories = $stories;
$this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, 'status_desc,id_desc', null);
$this->view->bugs = $bugs;
$this->view->type = $type;
}
/* Assign. */
$projects = $this->project->getPairs('empty');
$this->view->title = "BUILD #$build->id $build->name - " . $projects[$build->project];
$this->view->position[] = html::a($this->createLink('project', 'task', "projectID=$build->project"), $projects[$build->project]);
$this->view->position[] = $this->lang->build->view;
$this->view->generatedBugs = $this->bug->getProjectBugs($build->project, $build->id, '', 0, 'status_desc,id_desc', null);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->build = $build;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->actions = $this->loadModel('action')->getList('build', $buildID);
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch);
@@ -206,6 +259,8 @@ class build extends control
}
$this->send($response);
}
if($this->config->global->flow == 'onlyTest') die(js::locate($this->createLink('project', 'build', "productID=$build->product"), 'parent'));
die(js::locate($this->createLink('project', 'build', "projectID=$build->project"), 'parent'));
}
}
+2 -2
View File
@@ -24,7 +24,7 @@
<table class='table table-form'>
<tr>
<th class='w-110px'><?php echo $lang->build->product;?></th>
<?php if($products):?>
<?php if($products or $this->config->global->flow == 'onlyTest'):?>
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $product->id, "onchange='loadBranches(this.value);' class='form-control chosen'");?>
@@ -32,7 +32,7 @@
if($product->type != 'normal')
{
if($product->branch) $branches = array($product->branch => $branches[$product->branch]);
echo html::select('branch', $branches, $product->branch, "class='form-control' style='width:100px'");
echo html::select('branch', $branches, $product->branch, "class='form-control' style='width:100px; display:inline-block;'");
}
?>
</div>
+1 -1
View File
@@ -66,7 +66,7 @@
<th><?php echo $lang->build->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', htmlspecialchars($build->desc), "rows='10' class='form-control'");?></td>
</tr>
<tr><td></td><td colspan='2'><?php echo html::submitButton() . html::backButton() .html::hidden('project', $build->project);?></td></tr>
<tr><td></td><td colspan='2'><?php echo html::submitButton() . html::backButton() . $this->config->global->flow != 'onlyTest' ? html::hidden('project', $build->project) : '';?></td></tr>
</table>
</form>
</div>
+33 -4
View File
@@ -37,10 +37,13 @@ tfoot tr td .table-actions .btn{display:none;}
$browseLink = $this->session->buildList ? $this->session->buildList : $this->createLink('project', 'build', "projectID=$build->project");
if(!$build->deleted)
{
echo "<div class='btn-group'>";
if(common::hasPriv('build', 'linkStory')) echo html::a(inlink('view', "buildID=$build->id&type=story&link=true"), '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn'");
if(common::hasPriv('build', 'linkBug')) echo html::a(inlink('view', "buildID=$build->id&type=bug&link=true"), '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn'");
echo '</div>';
if($this->config->global->flow != 'onlyTest')
{
echo "<div class='btn-group'>";
if(common::hasPriv('build', 'linkStory')) echo html::a(inlink('view', "buildID=$build->id&type=story&link=true"), '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn'");
if(common::hasPriv('build', 'linkBug')) echo html::a(inlink('view', "buildID=$build->id&type=bug&link=true"), '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn'");
echo '</div>';
}
echo "<div class='btn-group'>";
common::printIcon('build', 'edit', "buildID=$build->id");
common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin');
@@ -53,6 +56,25 @@ tfoot tr td .table-actions .btn{display:none;}
<div class='row-table'>
<div class='col-main'>
<div class='main'>
<?php if($this->config->global->flow == 'onlyTest'):?>
<fieldset>
<legend><?php echo $lang->build->desc;?></legend>
<div class='article-content'><?php echo $build->desc;?></div>
</fieldset>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<div class='actions'>
<?php
$browseLink = $this->session->buildList ? $this->session->buildList : $this->createLink('product', 'build', "productID=$build->product");
if(!$build->deleted)
{
common::printIcon('build', 'edit', "buildID=$build->id");
common::printIcon('build', 'delete', "buildID=$build->id", '', 'button', '', 'hiddenwin');
}
echo common::printRPN($browseLink);
?>
</div>
<?php else:?>
<div class='tabs'>
<?php $countStories = count($stories); $countBugs = count($bugs); $countNewBugs = count($generatedBugs);?>
<ul class='nav nav-tabs'>
@@ -218,14 +240,17 @@ tfoot tr td .table-actions .btn{display:none;}
</div>
</div>
</div>
<?php endif;?>
</div>
</div>
<div class='col-side'>
<div class='main-side main'>
<?php if($this->config->global->flow != 'onlyTest'):?>
<fieldset>
<legend><?php echo $lang->build->desc;?></legend>
<div class='article-content'><?php echo $build->desc;?></div>
</fieldset>
<?php endif;?>
<fieldset>
<legend><?php echo $lang->build->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
@@ -261,13 +286,17 @@ tfoot tr td .table-actions .btn{display:none;}
</tr>
</table>
</fieldset>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<?php endif;?>
</div>
</div>
</div>
<?php if($this->config->global->flow != 'onlyTest'):?>
<?php js::set('param', helper::safe64Decode($param))?>
<?php js::set('link', $link)?>
<?php js::set('buildID', $build->id)?>
<?php js::set('type', $type)?>
<?php endif;?>
<?php include '../../common/view/footer.html.php';?>
+174
View File
@@ -553,3 +553,177 @@ $lang->icons['unlock'] = 'unlock-alt';
$lang->icons['confirmStoryChange'] = 'search';
include (dirname(__FILE__) . '/menuOrder.php');
global $config;
if($config->global->flow == 'onlyStory')
{
/* Remove project, report and qa module. */
unset($lang->menu->project);
unset($lang->menu->report);
unset($lang->menu->qa);
unset($lang->menuOrder[15]);
unset($lang->menuOrder[20]);
unset($lang->menuOrder[30]);
/* Adjust sub menu of my dashboard. */
unset($lang->my->menu->bug);
unset($lang->my->menu->todo);
unset($lang->my->menu->testtask);
unset($lang->my->menu->task);
unset($lang->my->menu->myProject);
/* Adjust sub menu of product module. */
unset($lang->product->menu->project);
/* Rename product module. */
$lang->menu->product = '产品|product|index';
/* Adjust search items. */
unset($lang->searchObjects['bug']);
unset($lang->searchObjects['task']);
unset($lang->searchObjects['testcase']);
unset($lang->searchObjects['project']);
unset($lang->searchObjects['build']);
unset($lang->searchObjects['testtask']);
}
if($config->global->flow == 'onlyTask')
{
/* Remove product, report and qa module. */
unset($lang->menu->product);
unset($lang->menu->report);
unset($lang->menu->qa);
unset($lang->menuOrder[10]);
unset($lang->menuOrder[20]);
unset($lang->menuOrder[30]);
/* Adjust sub menu of my dashboard. */
unset($lang->my->menu->bug);
unset($lang->my->menu->todo);
unset($lang->my->menu->testtask);
unset($lang->my->menu->story);
/* Adjust sub menu of project module. */
unset($lang->project->menu->story);
unset($lang->project->menu->build);
unset($lang->project->menu->bug);
unset($lang->project->menu->testtask);
unset($lang->project->menu->product);
/* Remove sub menu of product module. */
unset($lang->product->menu);
unset($lang->product->menuOrder);
$lang->project->menu->task['subModule'] = 'task';
$lang->project->menu->task['alias'] = 'grouptask,importtask';
unset($lang->searchObjects['bug']);
unset($lang->searchObjects['story']);
unset($lang->searchObjects['product']);
unset($lang->searchObjects['testcase']);
unset($lang->searchObjects['build']);
unset($lang->searchObjects['release']);
unset($lang->searchObjects['productplan']);
unset($lang->searchObjects['testtask']);
}
if($config->global->flow == 'onlyTest')
{
/* Remove project and test module. */
unset($lang->menu->project);
unset($lang->menu->qa);
unset($lang->menu->report);
unset($lang->menuOrder[15]);
unset($lang->menuOrder[20]);
unset($lang->menuOrder[30]);
/* Rename product module. */
$lang->menu->product = '产品|product|index';
/* Adjust sub menu of my dashboard. */
unset($lang->my->menu->task);
unset($lang->my->menu->myProject);
unset($lang->my->menu->story);
unset($lang->my->menu->todo);
/* Remove sub menu of project module. */
unset($lang->project->menu);
unset($lang->project->menuOrder);
/* 增加缺陷管理、用例管理和测试任务视图 */
$lang->menu->bug = 'Bug|bug|index';
$lang->menu->testcase = '用例|testcase|index';
$lang->menu->testtask = '测试|testtask|index';
$lang->menuOrder[6] = 'bug';
$lang->menuOrder[7] = 'testcase';
$lang->menuOrder[8] = 'testtask';
/* 调整缺陷管理的二级菜单 */
$lang->bug->menu = new stdclass();
$lang->bug->menu->product = '%s';
$lang->bug->menu->browse = array('link' => '浏览Bug|bug|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
$lang->bug->menu->create = array('link' => '提Bug|bug|create|productID=%s');
$lang->bug->menuOrder[5] = 'product';
$lang->bug->menuOrder[10] = 'browse';
$lang->bug->menuOrder[15] = 'create';
/* 调整用例管理的二级菜单 */
$lang->testcase->menu = new stdclass();
$lang->testcase->menu->product = '%s';
$lang->testcase->menu->browse = array('link' => '浏览用例|testcase|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
$lang->testcase->menu->create = array('link' => '创建用例|testcase|create|productID=%s');
$lang->testcase->menuOrder[5] = 'product';
$lang->testcase->menuOrder[10] = 'browse';
$lang->testcase->menuOrder[15] = 'create';
/* 调整测试任务的二级菜单 */
$lang->testtask->menu = new stdclass();
$lang->testtask->menu->product = '%s';
$lang->testtask->menu->browse = array('link' => '浏览版本|testtask|browse|productID=%s', 'alias' => 'viewedit,resolve,close,activate,report', 'subModule' => 'tree');
$lang->testtask->menu->create = array('link' => '提交测试|testtask|create|productID=%s');
$lang->testtask->menuOrder[5] = 'product';
$lang->testtask->menuOrder[10] = 'browse';
$lang->testtask->menuOrder[15] = 'create';
/* 调整产品视图的二级菜单 */
unset($lang->product->menu->story);
unset($lang->product->menu->project);
unset($lang->product->menu->release);
unset($lang->product->menu->dynamic);
unset($lang->product->menu->plan);
unset($lang->product->menu->roadmap);
unset($lang->product->menu->doc);
unset($lang->product->menu->module);
$lang->product->menu->build = array('link' => '版本|product|build', 'subModule' => 'build');
$lang->product->menuOrder[5] = 'build';
$lang->product->menuOrder[10] = 'view';
$lang->product->menuOrder[15] = 'order';
$lang->build->menu = $lang->product->menu;
$lang->build->menuOrder = $lang->product->menuOrder;
/* 调整菜单分组 */
$lang->menugroup->bug = 'bug';
$lang->menugroup->testcase = 'testcase';
$lang->menugroup->testtask = 'testtask';
/* 调整搜索项 */
unset($lang->searchObjects['story']);
unset($lang->searchObjects['task']);
unset($lang->searchObjects['release']);
unset($lang->searchObjects['productplan']);
$lang->zentaoPMS = '禅道测试管理';
}
-22
View File
@@ -393,28 +393,6 @@ class commonModel extends model
$methodName = $app->getMethodName();
$searchObject = $moduleName;
if($config->global->flow == 'onlyStory')
{
/* Adjust search items. */
unset($lang->searchObjects['bug']);
unset($lang->searchObjects['task']);
unset($lang->searchObjects['testcase']);
unset($lang->searchObjects['project']);
unset($lang->searchObjects['build']);
unset($lang->searchObjects['testtask']);
}
elseif($config->global->flow == 'onlyTask')
{
unset($lang->searchObjects['bug']);
unset($lang->searchObjects['story']);
unset($lang->searchObjects['product']);
unset($lang->searchObjects['testcase']);
unset($lang->searchObjects['build']);
unset($lang->searchObjects['release']);
unset($lang->searchObjects['productplan']);
unset($lang->searchObjects['testtask']);
}
if($moduleName == 'product')
{
if($methodName == 'browse') $searchObject = 'story';
+1 -1
View File
@@ -27,7 +27,7 @@ var browseType = '<?php echo $browseType;?>';
echo '<li id="all">' . html::a(inlink('dynamic', "browseType=all"), $lang->action->dynamic->all) . '</li>';
echo "<li id='account'>" . html::select('account', $users, $account, 'onchange=changeUser(this.value) class="form-control chosen"') . '</li>';
echo "<li id='product'>" . html::select('product', $products, $product, 'onchange=changeProduct(this.value) class="form-control chosen"') . '</li>';
echo "<li id='project' style='margin-right: 10px;'>" . html::select('project', $projects, $project, 'onchange=changeProject(this.value) class="form-control chosen"') . '</li>';
if($this->config->global->flow != 'onlyTest') echo "<li id='project' style='margin-right: 10px;'>" . html::select('project', $projects, $project, 'onchange=changeProject(this.value) class="form-control chosen"') . '</li>';
echo "<li id='bysearchTab'>" . html::a('#', '<i class="icon-search icon"></i>&nbsp;' . $lang->action->dynamic->search) . "</li>";
?>
</ul>
-59
View File
@@ -279,65 +279,6 @@ class customModel extends model
if(empty($module)) $module = 'main';
global $app, $lang, $config;
if($config->global->flow == 'onlyStory')
{
/* Remove project, report and qa module. */
unset($lang->menu->project);
unset($lang->menu->report);
unset($lang->menu->qa);
unset($lang->menuOrder[15]);
unset($lang->menuOrder[20]);
unset($lang->menuOrder[30]);
/* Adjust sub menu of my dashboard. */
unset($lang->my->menu->bug);
unset($lang->my->menu->todo);
unset($lang->my->menu->testtask);
unset($lang->my->menu->task);
unset($lang->my->menu->myProject);
/* Adjust sub menu of product module. */
unset($lang->product->menu->project);
/* Rename product module. */
$clientLang = $app->getClientLang();
$lang->menu->product = $config->productCommonList[$clientLang][0] . '|product|index';
}
elseif($config->global->flow == 'onlyTask')
{
/* Remove product, report and qa module. */
unset($lang->menu->product);
unset($lang->menu->report);
unset($lang->menu->qa);
unset($lang->menuOrder[10]);
unset($lang->menuOrder[20]);
unset($lang->menuOrder[30]);
/* Adjust sub menu of my dashboard. */
unset($lang->my->menu->bug);
unset($lang->my->menu->todo);
unset($lang->my->menu->testtask);
unset($lang->my->menu->story);
/* Adjust sub menu of project module. */
unset($lang->project->menu->story);
unset($lang->project->menu->build);
unset($lang->project->menu->bug);
unset($lang->project->menu->testtask);
unset($lang->project->menu->product);
/* Remove sub menu of product module. */
unset($lang->product->menu);
unset($lang->product->menuOrder);
$lang->project->menu->task['subModule'] = 'task';
$lang->project->menu->task['alias'] = 'grouptask,importtask';
}
$allMenu = $module == 'main' ? $lang->menu : (isset($lang->$module->menu) ? $lang->$module->menu : $lang->my->menu);
if($module == 'product' and isset($allMenu->branch)) $allMenu->branch = str_replace('@branch@', $lang->custom->branch, $allMenu->branch);
+2 -2
View File
@@ -83,8 +83,8 @@ $lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['project'] = $lang->projectCommon;
global $config;
if($config->global->flow == 'onlyStory') unset($lang->doc->systemLibs['project']);
if($config->global->flow == 'onlyStory') unset($lang->doc->libTypeList['project']);
if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') unset($lang->doc->systemLibs['project']);
if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') unset($lang->doc->libTypeList['project']);
if($config->global->flow == 'onlyTask') unset($lang->doc->systemLibs['product']);
if($config->global->flow == 'onlyTask') unset($lang->doc->libTypeList['product']);
+5 -5
View File
@@ -70,7 +70,7 @@ class docModel extends model
$selectHtml .= "<div id='libMenuHeading'><input id='searchLib' type='search' placeholder='{$this->lang->doc->searchDoc}' class='form-control'></div>";
$selectHtml .= "<div id='libMenuGroups' class='clearfix'>";
if($this->config->global->flow != 'onlyTask') $selectHtml .= "<div class='lib-menu-group' id='libMenuProductGroup'><div class='lib-menu-list-heading' data-type='product'>{$this->lang->doc->libTypeList['product']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
if($this->config->global->flow != 'onlyStory') $selectHtml .= "<div class='lib-menu-group' id='libMenuProjectGroup'><div class='lib-menu-list-heading' data-type='project'>{$this->lang->doc->libTypeList['project']}<i class='icon icon-remove'></i></div><div class='lib-menu-project-done'>{$this->lang->project->statusList['done']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
if($this->config->global->flow != 'onlyStory' and $this->config->global->flow != 'onlyTest') $selectHtml .= "<div class='lib-menu-group' id='libMenuProjectGroup'><div class='lib-menu-list-heading' data-type='project'>{$this->lang->doc->libTypeList['project']}<i class='icon icon-remove'></i></div><div class='lib-menu-project-done'>{$this->lang->project->statusList['done']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
$selectHtml .= "<div class='lib-menu-group' id='libMenuCustomGroup'><div class='lib-menu-list-heading' data-type='custom'>{$this->lang->doc->libTypeList['custom']}<i class='icon icon-remove'></i></div><div class='lib-menu-list clearfix'></div></div>";
$selectHtml .= "</div></div></div>";
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml);
@@ -705,7 +705,7 @@ class docModel extends model
}
$productIdList = array_keys($productLibs);
$products = $this->dao->select('id,name,status')->from(TABLE_PRODUCT)->where('id')->in($productIdList)->andWhere('deleted')->eq('0')->orderBy('`order`_desc')->fetchAll();
if($this->config->global->flow == 'onlyStory')
if($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest')
{
$hasProject = array();
}
@@ -764,7 +764,7 @@ class docModel extends model
*/
public function getLimitLibs($type, $limit = 4)
{
if($type == 'project' and $this->config->global->flow == 'onlyStory') return array();
if($type == 'project' and ($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest')) return array();
if($type == 'product' and $this->config->global->flow == 'onlyTask') return array();
if($type == 'product' or $type == 'project')
@@ -814,7 +814,7 @@ class docModel extends model
$libGroups = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->in($idList)->orderBy('`order`, id')->fetchGroup($type, 'id');
if($type == 'product')
{
if($this->config->global->flow == 'onlyStory')
if($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest')
{
$hasProject = array();
}
@@ -856,7 +856,7 @@ class docModel extends model
$objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('`order`, id')->fetchAll('id');
if($type == 'product')
{
if($this->config->global->flow == 'onlyStory')
if($this->config->global->flow == 'onlyStory' or $this->config->global->flow == 'onlyTest')
{
$hasProject = array();
}
+29 -1
View File
@@ -61,7 +61,8 @@ class product extends control
$homepage = $this->config->product->homepage;
if($homepage == 'browse' and $locate == 'auto') $locate = 'yes';
if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse'));
if($locate == 'yes' and $this->config->global->flow == 'onlyTest') $this->locate($this->createLink($this->moduleName, 'build'));
if($locate == 'yes' and $this->config->global->flow != 'onlyTest') $this->locate($this->createLink($this->moduleName, 'browse'));
if($this->app->getViewType() != 'mhtml') unset($this->lang->product->menu->index);
$productID = $this->product->saveState($productID, $this->products);
@@ -660,4 +661,31 @@ class product extends control
{
$this->locate($this->createLink('doc', 'objectLibs', "type=product&objectID=$productID&from=product"));
}
public function build($productID = 0)
{
$this->app->loadLang('build');
$this->session->set('productList', $this->app->getURI(true));
/* Get all product list. Locate to the create product page if there is no product. */
$this->products = $this->product->getPairs();
if(empty($this->products) and strpos('create|view', $this->methodName) === false) $this->locate($this->createLink('product', 'create'));
/* Get current product. */
$productID = $this->product->saveState($productID, $this->products);
$product = $this->product->getById($productID);
$this->product->setMenu($this->products, $productID);
/* Set menu.*/
$this->session->set('buildList', $this->app->getURI(true));
$this->view->title = $product->name . $this->lang->colon . $this->lang->product->build;
$this->view->position[] = $this->lang->product->build;
$this->view->products = $this->products;
$this->view->product = $product;
$this->view->builds = $this->dao->select('*')->from(TABLE_BUILD)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->fetchAll();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
}
+1 -1
View File
@@ -5,5 +5,5 @@ function setWhite(acl)
$(document).ready(function()
{
if(onlyStory) $('#aclprivate').parents('.radio').remove();
if(noProject) $('#aclprivate').parents('.radio').remove();
})
+1
View File
@@ -40,6 +40,7 @@ $lang->product->builds = 'BUILD数';
$lang->product->roadmap = '路线图';
$lang->product->doc = '文档列表';
$lang->product->project = $lang->projectCommon . '列表';
$lang->product->build = '版本列表';
$lang->product->confirmDelete = " 您确定删除该{$lang->productCommon}吗?";
+1 -1
View File
@@ -12,7 +12,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('onlyStory', $config->global->flow == 'onlyStory' ? true : false);?>
<?php js::set('noProject', ($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') ? true : false);?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
+1 -1
View File
@@ -12,7 +12,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('onlyStory', $config->global->flow == 'onlyStory' ? true : false);?>
<?php js::set('noProject', ($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') ? true : false);?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
+2
View File
@@ -114,6 +114,7 @@
<?php endif;?>
</table>
</fieldset>
<?php if($this->config->global->flow != 'onlyTest'):?>
<fieldset>
<legend><?php echo $lang->product->otherInfo?></legend>
<table class='table table-data table-condensed table-borderless'>
@@ -163,6 +164,7 @@
</tr>
</table>
</fieldset>
<?php endif;?>
</div>
</div>
</div>
+1
View File
@@ -23,6 +23,7 @@
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if(!$config->testcase->needReview and $menuType == 'wait') continue;
if($this->config->global->flow == 'onlyTest' and $menuType == 'needconfirm') continue;
if($hasBrowsePriv and strpos($menuType, 'QUERY') === 0)
{
$queryID = (int)substr($menuType, 5);
+1 -1
View File
@@ -63,7 +63,7 @@
</td>
<?php endif;?>
</tr>
<?php if(strpos(",$showFields,", ',story,') !== false):?>
<?php if(strpos(",$showFields,", ',story,') !== false and $this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->testcase->lblStory;?></th>
<td colspan='2'>
+1 -1
View File
@@ -178,7 +178,7 @@
</td>
</tr>
<?php endif;?>
<?php if(!$isLibCase):?>
<?php if(!$isLibCase and $this->config->global->flow != 'onlyTest'):?>
<tr>
<th><?php echo $lang->testcase->story;?></th>
<td class='text-left'><div id='storyIdBox'><?php echo html::select('story', $stories, $case->story, 'class=form-control chosen');?></div>
+1 -1
View File
@@ -168,7 +168,7 @@
?>
</td>
</tr>
<?php if(!$isLibCase):?>
<?php if(!$isLibCase and $this->config->global->flow != 'onlyTest'):?>
<tr class='nofixed'>
<th><?php echo $lang->testcase->story;?></th>
<td>
+5 -2
View File
@@ -34,13 +34,16 @@
<td class='w-p25-f'><?php echo html::input('product', $productID, "class='form-control'");?></td><td></td>
</tr>
<?php endif;?>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-90px'><?php echo $lang->testtask->project;?></th>
<td class='w-p25-f'><?php echo html::select('project', $projects, '', "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testtask->build;?></th>
<td><span id='buildBox'><?php echo html::select('build', $builds, '', "class='form-control chosen'");?></span></td>
<th class='w-90px'><?php echo $lang->testtask->build;?></th>
<td class='w-p25-f'><span id='buildBox'><?php echo html::select('build', $builds, '', "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
+7 -4
View File
@@ -23,16 +23,19 @@
</div>
<form class='form-condensed' method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<?php if($this->config->global->flow != 'onlyTest'):?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->project;?></th>
<td class='w-p35-f'>
<?php echo html::select('project', $projects, $task->project, "class='form-control chosen' onchange='loadProjectRelated(this.value)'");?>
</td>
<td><?php echo html::hidden('product', $task->product)?></td>
<td></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testtask->build;?></th>
<td><span id='buildBox'><?php echo html::select('build', $builds, $task->build, "class='form-control chosen'");?></span></td>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'><span id='buildBox'><?php echo html::select('build', $builds, $task->build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
@@ -76,7 +79,7 @@
</td>
</tr>
<tr>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton();?> </td>
<td></td><td colspan='2'><?php echo html::submitButton() . html::backButton() . html::hidden('product', $task->product);?></td>
</tr>
</table>
</form>
+5 -2
View File
@@ -80,7 +80,8 @@ class tree extends control
$this->loadModel('bug')->setMenu($this->product->getPairs(), $rootID);
$this->lang->tree->menu = $this->lang->bug->menu;
$this->lang->tree->menuOrder = $this->lang->bug->menuOrder;
$this->lang->set('menugroup.tree', 'qa');
if($this->config->global->flow == 'onlyTest') $this->lang->set('menugroup.tree', 'bug');
if($this->config->global->flow != 'onlyTest') $this->lang->set('menugroup.tree', 'qa');
$title = $product->name . $this->lang->colon . $this->lang->tree->manageBug;
$position[] = html::a($this->createLink('bug', 'browse', "product=$rootID"), $product->name);
@@ -91,7 +92,9 @@ class tree extends control
$this->loadModel('testcase')->setMenu($this->product->getPairs(), $rootID);
$this->lang->tree->menu = $this->lang->testcase->menu;
$this->lang->tree->menuOrder = $this->lang->testcase->menuOrder;
$this->lang->set('menugroup.tree', 'qa');
if($this->config->global->flow == 'onlyTest') $this->lang->set('menugroup.tree', 'testcase');
if($this->config->global->flow != 'onlyTest') $this->lang->set('menugroup.tree', 'qa');
$title = $product->name . $this->lang->colon . $this->lang->tree->manageCase;
$position[] = html::a($this->createLink('testcase', 'browse', "product=$rootID"), $product->name);
+1 -1
View File
@@ -12,7 +12,7 @@
echo "<li id='todoTab'>"; common::printLink('user', 'todo', "account=$account", $lang->user->todo); echo '</li>';
}
if($config->global->flow != 'onlyTask')
if($config->global->flow != 'onlyTask' and $config->global->flow != 'onlyTest')
{
echo "<li id='storyTab'>"; common::printLink('user', 'story', "account=$account", $lang->user->story); echo '</li>';
}