diff --git a/module/dept/control.php b/module/dept/control.php index 7ade562193..5994ca7dc9 100644 --- a/module/dept/control.php +++ b/module/dept/control.php @@ -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(); } diff --git a/module/dept/view/browse.html.php b/module/dept/view/browse.html.php index b2c3dee661..fe3815779e 100644 --- a/module/dept/view/browse.html.php +++ b/module/dept/view/browse.html.php @@ -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 : 'app->company->name ?>'); $modal.modal('show'); } else if(action.type === 'sort')