BUG 5785 Fix Bug Validation of the parent and existing department.

This commit is contained in:
Hector Cortez
2012-01-27 17:53:06 -04:00
parent b36d870200
commit 1658b48c09
3 changed files with 45 additions and 19 deletions

View File

@@ -964,7 +964,17 @@ class wsBase
return $result;
}
$department = new department();
$department = new Department();
if ( ($parentUID != '') && !($department->existsDepartment($parentUID)) ) {
$result = new wsCreateDepartmentResponse (26, G::loadTranslation ('ID_PARENT_DEPARTMENT_NOT_EXIST'), $parentUID);
return $result;
}
if ( $department->checkDepartmentName($departmentName, $parentUID ) ) {
$result = new wsCreateDepartmentResponse (27, G::loadTranslation ('ID_DEPARTMENT_EXISTS'), '');
return $result;
}
$row['DEP_TITLE'] = $departmentName;
$row['DEP_PARENT'] = $parentUID;