diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index 521eb0ceb2..0eeae40a93 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -182,10 +182,10 @@ $lang->project->homeMenu->browse = array('link' => ($config->systemMode == 'new'
/* Scrum menu. */
$lang->scrum->menu = new stdclass();
$lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s");
-$lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s");
+$lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport');
$lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track');
$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s", 'subModule' => 'doc');
-$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport');
+$lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport');
$lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s");
$lang->scrum->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease');
diff --git a/module/execution/control.php b/module/execution/control.php
index 660ac89976..e4020b911f 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -966,6 +966,7 @@ class execution extends control
*/
public function testreport($executionID = 0, $objectType = 'execution', $extra = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
+ if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($this->session->project);
echo $this->fetch('testreport', 'browse', "objectID=$executionID&objectType=$objectType&extra=$extra&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
}
diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php
index 10a7a89016..00b651bb89 100644
--- a/module/execution/view/testtask.html.php
+++ b/module/execution/view/testtask.html.php
@@ -103,7 +103,7 @@
common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link');
if(common::hasPriv('execution', 'testreport'))
{
- echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"');
+ echo html::a($this->createLink('execution', 'testreport', "executionID=$executionID&objctType=execution&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="execution"');
}
common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list');
common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin');
diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php
index 742c9fd007..58a961ce5f 100644
--- a/module/project/view/testtask.html.php
+++ b/module/project/view/testtask.html.php
@@ -60,7 +60,7 @@
testtask->begin);?> |
testtask->end);?> |
statusAB);?> |
- actions;?> |
+ text-center'>actions;?> |
@@ -92,9 +92,9 @@
{
common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap');
common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link');
- if(common::hasPriv('execution', 'testreport'))
+ if(common::hasPriv('execution', 'testreport') and $project->model == 'scrum')
{
- echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"');
+ echo html::a($this->createLink('execution', 'testreport', "executionID=$task->execution&objectType=execution&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="project"');
}
common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list');
common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin');
diff --git a/module/testreport/control.php b/module/testreport/control.php
index e13c21359a..2261c17c24 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -97,9 +97,9 @@ class testreport extends control
$reports = $this->testreport->getList($objectID, $objectType, $extra, $orderBy, $pager);
- if(strpos('project|execution', $objectType) !== false and isset($_POST['taskIdList']))
+ if(strpos('project|execution', $objectType) !== false and ($extra or isset($_POST['taskIdList'])))
{
- $taskIdList = $_POST['taskIdList'];
+ $taskIdList = isset($_POST['taskIdList']) ? $_POST['taskIdList'] : array($extra);
foreach($reports as $reportID => $report)
{
$tasks = explode(',', $report->tasks);
@@ -114,8 +114,8 @@ class testreport extends control
if($objectType == 'product' and $extra) $param = "objectID=$extra&objectType=testtask";
if(($objectType == 'project' or $objectType == 'execution') and ($extra or !empty($_POST['taskIdList'])))
{
- $param = "objectID=$objectID&objectType=$objectType";
- if(isset($_POST['taskIdList'])) $param .= '&extra=' . join(',', $_POST['taskIdList']);
+ $param = "objectID=$objectID&objectType=$objectType";
+ $param .= isset($_POST['taskIdList']) ? '&extra=' . join(',', $_POST['taskIdList']) : '&extra=' . $extra;
}
if($param) $this->locate($this->createLink('testreport', 'create', $param));
}
@@ -196,6 +196,9 @@ class testreport extends control
$productID = $this->commonAction($task->product, 'product');
}
$this->view->taskPairs = $taskPairs;
+
+ if($this->app->openApp == 'execution') $this->execution->setMenu($task->execution);
+ if($this->app->openApp == 'project') $this->project->setMenu($task->project);
}
if(empty($objectID)) die(js::alert($this->lang->testreport->noObjectID) . js::locate('back'));
diff --git a/module/testreport/model.php b/module/testreport/model.php
index 08a686d8f7..c049c38052 100644
--- a/module/testreport/model.php
+++ b/module/testreport/model.php
@@ -115,8 +115,8 @@ class testreportModel extends model
$objectID = (int)$objectID;
return $this->dao->select('*')->from(TABLE_TESTREPORT)
->where('deleted')->eq(0)
- ->beginIF($objectType == 'execution')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('execution')->fi()
- ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->andWhere('objectType')->eq('execution')->fi()
+ ->beginIF($objectType == 'execution')->andWhere('execution')->eq($objectID)->fi()
+ ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->fi()
->beginIF($objectType == 'product' and $extra)->andWhere('objectID')->eq((int)$extra)->andWhere('objectType')->eq('testtask')->fi()
->beginIF($objectType == 'product' and empty($extra))->andWhere('product')->eq($objectID)->fi()
->orderBy($orderBy)