diff --git a/module/common/model.php b/module/common/model.php index fa01a28794..bd2c824dc7 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1807,7 +1807,7 @@ EOD; if(empty($class)) $class = 'btn'; $title = $lang->goback . $lang->backShortcutKey; - echo html::a($backLink, ' ' . $lang->goback, '', "id='back' class='{$class}' title={$title}"); + echo html::a($backLink, ' ' . $lang->goback, '', "id='back' class='{$class}' title={$title} data-app='{$app->tab}'"); } /** diff --git a/module/testtask/control.php b/module/testtask/control.php index 5c6ff693ec..ce61d12c53 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -318,10 +318,12 @@ class testtask extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($task->project); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'project', $task->project); } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($task->execution); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'execution', $task->execution); } elseif($this->app->tab == 'qa') { @@ -481,10 +483,12 @@ class testtask extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($task->project); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'project', $task->project); } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($task->execution); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'execution', $task->execution); } else { @@ -612,10 +616,12 @@ class testtask extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($task->project); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'project', $task->project); } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($task->execution); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'execution', $task->execution); } else { @@ -676,10 +682,12 @@ class testtask extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($this->session->project); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'project', $task->project); } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($task->execution); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'execution', $task->execution); } else { @@ -1062,10 +1070,12 @@ class testtask extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($task->project); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'project', $task->project); } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($task->execution); + $this->lang->modulePageNav = $this->testtask->select($productID, $taskID, 'execution', $task->execution); } else { @@ -1534,12 +1544,17 @@ class testtask extends control * @param int $productID * @param int $branch * @param int $taskID + * @param string $module + * @param string $method + * @param string $objectType + * @param int $objectID * @access public * @return void */ - public function ajaxGetDropMenu($productID, $branch, $taskID, $module, $method) + public function ajaxGetDropMenu($productID, $branch, $taskID, $module, $method, $objectType = '', $objectID = 0) { - $testtasks = $this->testtask->getProductTasks($productID, $branch, 'id_desc', null, array('local', 'totalStatus')); + $status = empty($objectType) ? 'local' : 'totalStatus'; + $testtasks = $this->testtask->getProductTasks($productID, $branch, 'id_desc', null, array($status, 'totalStatus')); $namePairs = array_column($testtasks, 'name'); $this->view->currentTaskID = $taskID; @@ -1548,6 +1563,8 @@ class testtask extends control $this->view->method = $method; $this->view->productID = $productID; $this->view->branch = $branch; + $this->view->objectType = $objectType; + $this->view->objectID = $objectID; $this->view->testtasksPinyin = common::convert2Pinyin($namePairs); $this->display(); diff --git a/module/testtask/model.php b/module/testtask/model.php index 3edea977cd..32a87984d9 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -2328,4 +2328,32 @@ class testtaskModel extends model $this->lang->switcherMenu = $selectHtml; common::setMenuVars('qa', $productID); } + + /** + * Create the select code of testtasks. + * + * @param int $productID + * @param int $testtaskID + * @param string $objectType execution|project + * @param int $objectID + * @access public + * @return string + */ + public function select($productID, $testtaskID, $objectType = '', $objectID = 0) + { + $output = ''; + $currentModule = $this->app->rawModule; + $currentMethod = $this->app->rawMethod; + if($testtaskID and $this->app->viewType != 'mhtml') + { + $dropMenuLink = helper::createLink('testtask', 'ajaxGetDropMenu', "productID=$productID&branch=&taskID=$testtaskID&module=$currentModule&method=$currentMethod&objectType=$objectType&objectID=$objectID"); + $testtask = $this->getById($testtaskID); + + $output .= "
"; + } + $output .= '
'; + return $output; + } } diff --git a/module/testtask/view/ajaxgetdropmenu.html.php b/module/testtask/view/ajaxgetdropmenu.html.php index bed4246785..8bc053923c 100644 --- a/module/testtask/view/ajaxgetdropmenu.html.php +++ b/module/testtask/view/ajaxgetdropmenu.html.php @@ -19,6 +19,9 @@ $selectHtml = ''; foreach($testtasks as $testtaskID => $testtask) { + if($objectType == 'project' and $testtask->project != $objectID) continue; + if($objectType == 'execution' and $testtask->execution != $objectID) continue; + $selected = (string)$testtaskID == $currentTaskID ? 'selected' : ''; $param = $method == 'report' ? "productID=$productID&taskID=$testtaskID&browseType=all&branch=$branch" : "taskID=$testtaskID"; $selectHtml .= html::a($this->createLink($module, $method, $param), $testtask->name, '', "class='$selected' data-key='{$testtasksPinyin[$testtask->name]}' data-app='{$this->app->tab}' title='{$testtask->name}'");