From 8a8f7715ac60951f5ef7f6cc507472276cae8cdf Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 12 Apr 2016 13:40:30 +0800 Subject: [PATCH] * fix error on add department to root. --- module/dept/control.php | 4 ---- module/dept/view/browse.html.php | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) 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')