* adjust code for task #1660.

This commit is contained in:
wyd621
2013-08-02 08:45:29 +08:00
parent 40f30c489a
commit 48ba3c94c6
+6 -5
View File
@@ -84,13 +84,14 @@ class dept extends control
*/
public function delete($deptID, $confirm = 'no')
{
/* Check this dept when delete. */
$sons = $this->dept->getSons($deptID);
$users = $this->dept->getUsers($deptID);
if($sons) die(js::alert($this->lang->dept->error->hasSons));
if($users) die(js::alert($this->lang->dept->error->hasUsers));
if($confirm == 'no')
{
$sons = $this->dept->getSons($deptID);
$users = $this->dept->getUsers($deptID);
if($sons) die(js::alert($this->lang->dept->error->hasSons));
if($users) die(js::alert($this->lang->dept->error->hasUsers));
die(js::confirm($this->lang->dept->confirmDelete, $this->createLink('dept', 'delete', "deptID=$deptID&confirm=yes")));
}
else