* Code for task #5081.

This commit is contained in:
chenfeiCF
2018-11-19 15:18:56 +08:00
parent 0a1f17db54
commit af1124ab3f
2 changed files with 24 additions and 17 deletions
+3 -8
View File
@@ -33,15 +33,10 @@
<th><?php echo $lang->product->line;?></th>
<td>
<div class='input-group' id='lineIdBox'>
<?php
echo html::select('line', $lines, '', "class='form-control chosen'");
echo "<span class='input-group-addon'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line", '', true), $lang->tree->manageLine, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
echo '&nbsp; ';
echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'");
echo '</span>';
?>
<?php echo html::select('line', $lines, '', "class='form-control chosen'");?>
<span class='input-group-addon'><?php echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line", '', true), $lang->tree->manageLine, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");?></span>
</div>
<div class='hidden'><?php echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'");?></div>
</td>
</tr>
<tr>
+21 -9
View File
@@ -371,19 +371,31 @@ class tree extends control
}
if($returnType == 'html')
{
$changeFunc = '';
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
$field = $fieldID ? "modules[$fieldID]" : 'module';
if($viewType == 'line') $field = 'line';
$output = html::select("$field", $optionMenu, '', "class='form-control' $changeFunc");
if(count($optionMenu) == 1 and $needManage)
//Code for task #5081.
if($viewType == 'line')
{
$output .= "<span class='input-group-addon'>";
$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&currentModuleID=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 .= '&nbsp; ';
$output .= $viewType == 'line' ? html::a("javascript:void(0)", $this->lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'") : html::a("javascript:void(0)", $this->lang->refresh, '', "class='refresh' onclick='loadProductModules($rootID)'");
$output .= '</span>';
}
else
{
$changeFunc = '';
if($viewType == 'task' or $viewType == 'bug' or $viewType == 'case') $changeFunc = "onchange='loadModuleRelated()'";
$field = $fieldID ? "modules[$fieldID]" : 'module';
$output = html::select("$field", $optionMenu, '', "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&currentModuleID=0&branch=$branch", '', true), $this->lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");
$output .= '&nbsp; ';
$output .= html::a("javascript:void(0)", $this->lang->refresh, '', "class='refresh' onclick='loadProductModules($rootID)'");
$output .= '</span>';
}
}
die($output);
}
if($returnType == 'mhtml')