Release note v16.0
------------------ ### Features * Advanced Employee Management Module is now included in IceHrm Open Source Edition * LDAP Module which was only available in IceHrm Enterprise is now included in open source also * Initial implementation of icehrm REST Api for reading employee details * Improvements to data filtering * Multiple tabs for settings module * Overtime reports - now its possible to calculate overtime for employees.compatible with US overtime rules * Logout the user if tried accessing an unauthorized module * Setting for updating module names ### Fixes * Fix issue: classes should be loaded even the module is disabled * Deleting the only Admin user is not allowed * Fixes for handling non UTF-8 * Fix for non-mandatory select boxes are shown as mandatory
This commit is contained in:
@@ -56,6 +56,37 @@ if (!class_exists('CompanyStructure')) {
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,"");
|
||||
}
|
||||
|
||||
public static function getAllChildCompanyStructures($companyStructureId){
|
||||
$structures = array();
|
||||
$companyStructure = new CompanyStructure();
|
||||
$companyStructure->Load("id = ?",array($companyStructureId));
|
||||
|
||||
if($companyStructure->id != $companyStructureId || empty($companyStructure->id)){
|
||||
return new IceResponse(IceResponse::ERROR, array());
|
||||
}
|
||||
|
||||
self::getChildCompanyStructures($companyStructure, $structures);
|
||||
|
||||
$structures[$companyStructure->id] = $companyStructure;
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, array_values($structures));
|
||||
|
||||
}
|
||||
|
||||
private static function getChildCompanyStructures($companyStructure, &$structures){
|
||||
$child = new CompanyStructure();
|
||||
$children = $child->Find("parent = ?",array($companyStructure->id));
|
||||
if(!empty($children)){
|
||||
foreach($children as $c){
|
||||
if(isset($structures[$c->id])){
|
||||
continue;
|
||||
}
|
||||
$structures[$c->id] = $c;
|
||||
self::getChildCompanyStructures($c, $structures);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user