Ignore:
Timestamp:
09/02/10 16:04:25 (14 years ago)
Author:
pereira.jair
Message:

Ticket #1186 - Organograma - Adicionado mobile e homePhone no cartão do funcionario

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/class.so_orgchart.inc.php

    r3167 r3212  
    11021102 
    11031103                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    1104  
     1104                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
     1105 
     1106                 
    11051107                /* here we need fresh information. Let's access ldap first */ 
    1106                 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 
    11071108                $employeeEntry = $cachedLDAP->getEntryByID($employeeID); 
    1108  
     1109                 
    11091110                if ($entry === false) 
    11101111                        return array('error' => 'Funcionário não encontrado.'); 
     1112                 
     1113                $employeeInfo                           = $orgchart->getEmployee($employeeID); 
     1114                $employeeStatusInfo             = $orgchart->getEmployeeStatus($employeeInfo['funcionario_status_id']); 
     1115                $account_id                             = $_SESSION['phpgw_info']['workflow']['account_id']; 
     1116                $organization_supervisors       = $orgchart->getOrganizationSupervisors($employeeInfo['organizacao_id']); 
     1117                 
     1118                /*  
     1119                 * Verify the supervisor of the organization 
     1120                 * if the logged user is the supervisor of the selected user 
     1121                 * then will show the mobile and homePhone number. 
     1122                 */  
     1123                $arr_supervisores = array(); 
     1124                foreach ($organization_supervisors as $supervisor) { 
     1125                        array_push($arr_supervisores,$supervisor['titular_funcionario_id']); 
     1126                        if ($supervisor['substituto_funcionario_id']) { 
     1127                                array_push($arr_supervisores,$supervisor['substituto_funcionario_id']); 
     1128                        } 
     1129                } 
     1130                 
     1131                $mobile         = ''; 
     1132                $homePhone  = ''; 
     1133                 
     1134                if (in_array($account_id,$arr_supervisores) || ($account_id == $employeeID)) { 
     1135                        $mobile         = $employeeEntry['mobile']; 
     1136                        $homePhone      = $employeeEntry['homephone']; 
     1137                }  
     1138                 
     1139                $outputInfo[] = array( 
     1140                        'name' => 'Mobile', 
     1141                        'value' => ( ! empty( $mobile ) ? $mobile : '' ) ); 
     1142                         
     1143                $outputInfo[] = array( 
     1144                        'name' => 'homePhone', 
     1145                        'value' => ( ! empty( $homePhone ) ? $homePhone : '' ) ); 
     1146 
    11111147 
    11121148                $outputInfo[] = array( 
     
    11291165                        'value' => $employeeID); 
    11301166 
    1131                 $employeeInfo = $orgchart->getEmployee($employeeID); 
    1132                 $employeeStatusInfo = $orgchart->getEmployeeStatus($employeeInfo['funcionario_status_id']); 
     1167                 
    11331168 
    11341169                $outputInfo[] = array( 
Note: See TracChangeset for help on using the changeset viewer.