* Finish task #58552.
This commit is contained in:
@@ -1807,7 +1807,7 @@ EOD;
|
||||
|
||||
if(empty($class)) $class = 'btn';
|
||||
$title = $lang->goback . $lang->backShortcutKey;
|
||||
echo html::a($backLink, '<i class="icon-goback icon-back"></i> ' . $lang->goback, '', "id='back' class='{$class}' title={$title}");
|
||||
echo html::a($backLink, '<i class="icon-goback icon-back"></i> ' . $lang->goback, '', "id='back' class='{$class}' title={$title} data-app='{$app->tab}'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 .= "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentTesttask' title='{$testtask->name}'><span class='text'>{$testtask->name}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
|
||||
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
|
||||
$output .= "</div></div>";
|
||||
}
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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}'");
|
||||
|
||||
Reference in New Issue
Block a user