Changeset 3225 for branches/2.2/workflow/inc/class.so_orgchart.inc.php
- Timestamp:
- 09/09/10 15:56:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.so_orgchart.inc.php
r3212 r3225 1104 1104 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 1105 1105 1106 1107 1106 /* here we need fresh information. Let's access ldap first */ 1108 1107 $employeeEntry = $cachedLDAP->getEntryByID($employeeID); 1109 1108 1110 1109 if ($entry === false) 1111 1110 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 */ 1111 1112 $employeeInfo = $orgchart->getEmployee($employeeID); 1113 $employeeStatusInfo = $orgchart->getEmployeeStatus($employeeInfo['funcionario_status_id']); 1114 $account_id = $_SESSION['phpgw_info']['workflow']['account_id']; 1115 $organization_supervisors = $orgchart->getOrganizationSupervisors($employeeInfo['organizacao_id']); 1116 1117 // Make an array with all supervisors and their substitures 1123 1118 $arr_supervisores = array(); 1124 1119 foreach ($organization_supervisors as $supervisor) { … … 1128 1123 } 1129 1124 } 1130 1125 1131 1126 $mobile = ''; 1132 1127 $homePhone = ''; 1133 1128 1129 /* 1130 * Check if the current user can view the mobile and homePhone of the employee 1131 * This condition is true if the current user is a supervisor or is the same user 1132 * that's being retrieved 1133 */ 1134 1134 if (in_array($account_id,$arr_supervisores) || ($account_id == $employeeID)) { 1135 1135 $mobile = $employeeEntry['mobile']; 1136 1136 $homePhone = $employeeEntry['homephone']; 1137 } 1138 1137 } 1138 1139 1139 $outputInfo[] = array( 1140 1140 'name' => 'Mobile', 1141 1141 'value' => ( ! empty( $mobile ) ? $mobile : '' ) ); 1142 1142 1143 1143 $outputInfo[] = array( 1144 1144 'name' => 'homePhone', … … 1164 1164 'name' => 'UIDNumber', 1165 1165 'value' => $employeeID); 1166 1167 1168 1166 1169 1167 $outputInfo[] = array( … … 1430 1428 * I'm not supose to be here.. (date validations speaking) 1431 1429 * move me to some validation class! 1432 */ 1430 */ 1433 1431 1434 1432 /* validating dates */ … … 1505 1503 $result = $this -> db -> query( $query, array( $areaID, $substituteID, $date_start, $date_end ) ); 1506 1504 $this->_checkError( $result ); 1507 1505 1508 1506 return ( ( $result === false ) ? false : true ); 1509 1507 } … … 1533 1531 $result = $this -> db -> query( $query, array( $substituteID, $date_start, $date_end, $substitutionID ) ); 1534 1532 $this->_checkError( $result ); 1535 1533 1536 1534 return ( ( $result === false ) ? false : true ); 1537 1535 } … … 1575 1573 * @param int $organizationID Organization's ID 1576 1574 * @param int $telephoneID Substitution's ID 1577 * @return bool 1575 * @return bool 1578 1576 * @access public 1579 1577 */
Note: See TracChangeset
for help on using the changeset viewer.