diff --git a/module/execution/control.php b/module/execution/control.php index ab17cbe608..e559b948b7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1038,6 +1038,7 @@ class execution extends control public function testtask($executionID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->loadModel('testtask'); + $this->app->loadLang('testreport'); /* Save session. */ $this->session->set('testtaskList', $this->app->getURI(true), 'execution'); diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php index f31541cd0a..6c79854f26 100644 --- a/module/execution/view/testtask.html.php +++ b/module/execution/view/testtask.html.php @@ -39,7 +39,7 @@

testtask->noTesttask;?> - createLink('testtask', 'create', "product=0&execution=$executionID"), " " . $lang->testtask->create, '', "class='btn btn-info'");?> + createLink('testtask', 'create', "product=0&execution=$executionID"), " " . $lang->testtask->create, '', "class='btn btn-info' data-app='execution'");?>

@@ -99,15 +99,14 @@ id", $task, 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); - common::printIcon('testreport', 'browse', "objectID=$task->execution&objectType=execution&extra=$task->id", $task, 'list','flag'); - common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); - if(common::hasPriv('testtask', 'delete', $task)) + 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')) { - $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"taskList\", confirmDelete)", '', '', "class='btn' title='{$lang->testtask->delete}'"); + echo html::a($this->createLink('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id"), '', '', 'class="btn " title="' . $lang->testreport->browse . '" data-app="qa"'); } + common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); + common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'list', 'trash', 'hiddenwin'); } ?> @@ -131,7 +130,7 @@
createLink('testreport', 'browse', "objectID=$executionID&objctType=execution"); + $actionLink = $this->createLink('execution', 'testreport', "objectID=$executionID&objctType=execution"); $misc = common::hasPriv('testreport', 'browse') ? "onclick=\"setFormAction('$actionLink', '', '#testtaskForm')\"" : "disabled='disabled'"; echo html::commonButton($lang->testreport->common, $misc); ?> diff --git a/module/testreport/control.php b/module/testreport/control.php index a0590821b9..85b0f5e7fb 100644 --- a/module/testreport/control.php +++ b/module/testreport/control.php @@ -240,9 +240,9 @@ class testreport extends control $executionID = $this->commonAction($objectID, $objectType); if($executionID != $objectID) die(js::error($this->lang->error->accessDenied) . js::locate('back')); - $execution = $this->execution->getById($executionID); - $tasks = $this->testtask->getExecutionTasks($executionID); - $owners = array(); + $execution = $this->execution->getById($executionID); + $tasks = $this->testtask->getExecutionTasks($executionID); + $owners = array(); $buildIdList = array(); $productIdList = array(); foreach($tasks as $i => $task) diff --git a/module/testreport/js/create.js b/module/testreport/js/create.js index eff1a62f38..6485cca0dc 100644 --- a/module/testreport/js/create.js +++ b/module/testreport/js/create.js @@ -1,6 +1,5 @@ $(function() { - if(objectType == 'project' $('#subNavbar ul li[data-id=qa]').addClass('active'); $('#mainContent .main-header h2 #selectTask').change(function() { var taskID = $(this).val(); diff --git a/module/testreport/model.php b/module/testreport/model.php index b300369be7..2f024b961d 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -147,10 +147,10 @@ class testreportModel extends model { $objectID = (int)$objectID; return $this->dao->select('*')->from(TABLE_TESTREPORT)->where('deleted')->eq(0) - ->beginIF(!empty($extra))->andWhere('objectID')->eq($extra)->fi() - ->beginIF($objectType == 'product')->andWhere('product')->eq($objectID)->fi() - ->beginIF($objectType == 'project')->andWhere('project')->eq($objectID)->fi() - ->beginIF($objectType == 'execution')->andWhere('execution')->eq($objectID)->fi() + ->beginIF($objectType == 'execution')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('execution')->fi() + ->beginIF($objectType == 'project')->andWhere('objectID')->eq($objectID)->andWhere('objectType')->eq('project')->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) ->page($pager) ->fetchAll('id'); diff --git a/module/testreport/view/browse.html.php b/module/testreport/view/browse.html.php index fbb5988b24..84fd3b591b 100644 --- a/module/testreport/view/browse.html.php +++ b/module/testreport/view/browse.html.php @@ -47,8 +47,9 @@ - id"), sprintf('%03d', $report->id));?> - id"), $report->title)?> + id");?> + id), '', "data-app='{$this->app->openApp}'");?> + title, '', "data-app='{$this->app->openApp}'")?> createdBy);?> createdDate, 2);?> execution ? '#' . $report->execution . $executions[$report->execution] : '';?> diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php index 141cc950bd..56c10bfea0 100644 --- a/module/testreport/view/view.html.php +++ b/module/testreport/view/view.html.php @@ -15,8 +15,8 @@