* fix error on add department to root.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user