* fix error on add department to root.

This commit is contained in:
Catouse
2016-04-12 13:40:30 +08:00
parent 430c9359fe
commit 8a8f7715ac
2 changed files with 2 additions and 6 deletions
-4
View File
@@ -37,10 +37,6 @@ class dept extends control
$parentDepts = $this->dept->getParents($deptID);
$this->view->title = $this->lang->dept->manage . $this->lang->colon . $this->app->company->name;
$this->view->position[] = $this->lang->dept->manage;
$this->view->deptID = $deptID;
$this->view->depts = $this->dept->getTreeMenu($rootDeptID = 0, array('deptmodel', 'createManageLink'));
$this->view->parentDepts = $parentDepts;
$this->view->sons = $this->dept->getSons($deptID);
$this->view->tree = $this->dept->getFullTree(0);
$this->display();
}
+2 -2
View File
@@ -109,8 +109,8 @@ $(function()
else if(action.type === 'add')
{
var $modal = $('#addChildModal');
$modal.find('input[name="parentDeptID"]').val(item.id);
$modal.find('.dept-name').text(item.name);
$modal.find('input[name="parentDeptID"]').val(item ? item.id : 0);
$modal.find('.dept-name').text(item ? item.name : '<?php echo $this->app->company->name ?>');
$modal.modal('show');
}
else if(action.type === 'sort')