Changeset 3212 for branches/2.2/workflow/inc/class.so_orgchart.inc.php
- Timestamp:
- 09/02/10 16:04:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.so_orgchart.inc.php
r3167 r3212 1102 1102 1103 1103 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1104 1104 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 1105 1106 1105 1107 /* here we need fresh information. Let's access ldap first */ 1106 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE);1107 1108 $employeeEntry = $cachedLDAP->getEntryByID($employeeID); 1108 1109 1109 1110 if ($entry === false) 1110 1111 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 1111 1147 1112 1148 $outputInfo[] = array( … … 1129 1165 'value' => $employeeID); 1130 1166 1131 $employeeInfo = $orgchart->getEmployee($employeeID); 1132 $employeeStatusInfo = $orgchart->getEmployeeStatus($employeeInfo['funcionario_status_id']); 1167 1133 1168 1134 1169 $outputInfo[] = array(
Note: See TracChangeset
for help on using the changeset viewer.