*Fix bug#18295.

This commit is contained in:
孙华伟
2022-04-14 08:32:47 +08:00
parent f9e8a8d69f
commit 93beba2f03
5 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -385,10 +385,11 @@ class tree extends control
* @return void
*/
public function manageChild($rootID, $viewType)
{
if(!empty($_POST))
{
$moduleIDList = $this->tree->manageChild($rootID, $viewType);
if(dao::isError()) return print(js::error(dao::getError()));
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'idList' => $moduleIDList));
if(($viewType == 'doc' || $viewType == 'api') and isonlybody()) die(js::reload('parent.parent'));
+4
View File
@@ -71,3 +71,7 @@ $lang->tree->short = 'Abbr.';
$lang->tree->all = 'All Modules';
$lang->tree->executionDoc = "{$lang->executionCommon} Document";
$lang->tree->product = $lang->productCommon;
$this->lang->module = new stdclass();
$this->lang->module->name = '名称';
$this->lang->module->short = '简称';
+4
View File
@@ -71,3 +71,7 @@ $lang->tree->short = '简称';
$lang->tree->all = '所有模块';
$lang->tree->executionDoc = "{$lang->executionCommon}文档";
$lang->tree->product = "所属{$lang->productCommon}";
$this->lang->module = new stdclass();
$this->lang->module->name = '名称';
$this->lang->module->short = '简称';
+7 -1
View File
@@ -1638,7 +1638,13 @@ class treeModel extends model
$short = $shorts[$moduleID];
$order = $orders[$moduleID];
$moduleID = str_replace('id', '', $moduleID);
$this->dao->update(TABLE_MODULE)->set('name')->eq(strip_tags(trim($moduleName)))->set('short')->eq($short)->set('order')->eq($order)->where('id')->eq($moduleID)->limit(1)->exec();
$data = new stdClass();
$data->name = strip_tags(trim($moduleName));
$data->short = $short;
$data->order = $order;
$this->dao->update(TABLE_MODULE)->data($data)->autoCheck()->where('id')->eq($moduleID)->limit(1)->exec();
}
}
+1 -1
View File
@@ -222,7 +222,7 @@ $(function()
},
itemCreator: function($li, item)
{
var link = (item.id !== undefined && item.type != 'line') ? ('<a href="' + createLink('tree', 'browse', 'rootID=<?php echo $rootID ?>&viewType=<?php echo $viewType ?>&moduleID={0}&branch={1}&from=<?php echo $from;?>&projectID=<?php echo isset($projectID) ? $projectID : 0; ?>'.format(item.id, branch)) + '" data-app="' + tab + '">' + item.name + '</a>') : ('<span class="tree-toggle">' + item.name + '</span>');
var link = (item.id !== undefined && item.type != 'line') ? ('<a href="' + createLink('tree', 'browse', 'rootID=<?php echo $rootID ?>&viewType=<?php echo $viewType ?>&moduleID={0}&branch={1}&from=<?php echo $from;?>&projectID=<?php echo isset($projectID) ? $projectID : 0; ?>'.format(item.id, branch)) + '" data-app="' + tab + '" title="' + item.name + '">' + item.name + '</a>') : ('<span class="tree-toggle">' + item.name + '</span>');
var $toggle = $('<span class="module-name" data-id="' + item.id + '">' + link + '</span>');
if(item.type === 'bug') $toggle.append('&nbsp; <span class="text-muted">[B]</span>');
if(item.type === 'case') $toggle.append('&nbsp; <span class="text-muted">[C]</span>');