diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php
index e766a394ae..e3aa0d7034 100644
--- a/module/product/view/create.html.php
+++ b/module/product/view/create.html.php
@@ -33,15 +33,10 @@
product->line;?> |
- ";
- 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 ' ';
- echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductLines($rootID)'");
- echo '';
- ?>
+
+ createLink('tree', 'browse', "rootID=$rootID&view=line", '', true), $lang->tree->manageLine, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");?>
+ refresh, '', "class='refresh' onclick='loadProductLines($rootID)'");?>
|
diff --git a/module/tree/control.php b/module/tree/control.php
index e7c00ca8d7..cd2a732c34 100644
--- a/module/tree/control.php
+++ b/module/tree/control.php
@@ -355,19 +355,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 .= "";
+ $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 .= "";
$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 .= ' ';
- $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 .= '';
}
+ 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 .= "";
+ $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->refresh, '', "class='refresh' onclick='loadProductModules($rootID)'");
+ $output .= '';
+ }
+ }
+
die($output);
}
if($returnType == 'mhtml')