- testcase: remove unused method.
This commit is contained in:
@@ -2650,80 +2650,6 @@ class testcase extends control
|
||||
die($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get option menu.
|
||||
*
|
||||
* @param int $rootID
|
||||
* @param string $viewType
|
||||
* @param int $branch
|
||||
* @param int $rootModuleID
|
||||
* @param string $returnType
|
||||
* @param string $fieldID
|
||||
* @param bool $needManage
|
||||
* @param string $extra
|
||||
* @param int $currentModuleID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetOptionMenu($rootID, $viewType = 'story', $branch = 0, $rootModuleID = 0, $returnType = 'html', $fieldID = '', $needManage = false, $extra = '', $currentModuleID = 0)
|
||||
{
|
||||
$this->loadModel('tree');
|
||||
|
||||
if($viewType == 'task')
|
||||
{
|
||||
$optionMenu = $this->tree->getTaskOptionMenu($rootID, 0, 0, $extra);
|
||||
}
|
||||
else
|
||||
{
|
||||
$optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch);
|
||||
}
|
||||
|
||||
if($returnType == 'html')
|
||||
{
|
||||
if($viewType == 'line')
|
||||
{
|
||||
$lineID = $this->dao->select('id')->from(TABLE_MODULE)->where('type')->eq('line')->andWhere('deleted')->eq(0)->orderBy('id_desc')->limit(1)->fetch('id');
|
||||
$output = html::select("line", $optionMenu, $lineID, "class='form-control'");
|
||||
$output .= "<span class='input-group-addon' style='border-radius: 0px 2px 2px 0px; border-right-width: 1px;'>";
|
||||
$output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $viewType == 'line' ? $this->lang->tree->manageLine : $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
$output .= '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$changeFunc = '';
|
||||
if($viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelatedNew()'";
|
||||
if($viewType == 'task') $changeFunc = "";
|
||||
$field = $fieldID ? "modules[$fieldID]" : 'module';
|
||||
|
||||
$currentModule = $this->tree->getById($currentModuleID);
|
||||
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;
|
||||
|
||||
$output = html::select("$field", $optionMenu, $currentModuleID, "class='form-control' $changeFunc");
|
||||
if(count($optionMenu) == 1 and $needManage)
|
||||
{
|
||||
$output .= "<span class='input-group-addon'>";
|
||||
$output .= html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=$viewType¤tModuleID=0&branch=$branch", '', true), $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
|
||||
$output .= ' ';
|
||||
$output .= html::a("javascript:void(0)", $this->lang->refreshIcon, '', "class='refresh' onclick='loadProductModulesNew($rootID)'");
|
||||
$output .= '</span>';
|
||||
}
|
||||
}
|
||||
die($output);
|
||||
}
|
||||
|
||||
if($returnType == 'mhtml')
|
||||
{
|
||||
$changeFunc = '';
|
||||
if($viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelatedNew()'";
|
||||
if($viewType == 'task') $changeFunc = "";
|
||||
$field = $fieldID ? "modules[$fieldID]" : 'module';
|
||||
$output = html::select("$field", $optionMenu, '', "class='input' $changeFunc");
|
||||
die($output);
|
||||
}
|
||||
|
||||
if($returnType == 'json') die(json_encode($optionMenu));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get scenes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user