- Timestamp:
- 09/09/10 15:56:47 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/local/classes/class.wf_orgchart.php
r3212 r3225 157 157 return $output; 158 158 } 159 159 160 160 /** 161 161 * Searches for all the supervisors of an organization. 162 162 * 163 * This method will search in table areas for all the supervisors and replacement in the organization. , todas as áreas que pertencem à organização solicitada.163 * This method will search in table areas for all the supervisors and replacement in the organization. 164 164 * @param int $organizationID the ID of the Organization. 165 165 * @return array Uma array seqüencial contendo as áreas de uma organização e seus titulares e substitutos. Cada linha do array conterá: … … 170 170 */ 171 171 function getOrganizationSupervisors($organizationID) { 172 $query = " SELECT 173 a.titular_funcionario_id, 174 s.funcionario_id as substituto_funcionario_id, 172 $query = " SELECT 173 a.titular_funcionario_id, 174 s.funcionario_id as substituto_funcionario_id, 175 175 a.area_id 176 FROM 177 area a 178 LEFT OUTER JOIN substituicao s 176 FROM 177 area a 178 LEFT OUTER JOIN substituicao s 179 179 ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) 180 WHERE 181 a.titular_funcionario_id is not null 182 and a.ativa = 'S' 183 AND organizacao_id = ?184 GROUP BY 180 WHERE 181 a.titular_funcionario_id is not null 182 and a.ativa = 'S' 183 AND a.organizacao_id = ? 184 GROUP BY 185 185 a.titular_funcionario_id, 186 s.funcionario_id, 186 s.funcionario_id, 187 187 a.area_id"; 188 188 $result = $this->db->query($query, array($organizationID)); … … 518 518 return $output; 519 519 } 520 520 521 521 /** 522 522 * Return all areas that the employee is a supervisor. 523 * 523 * 524 524 * Search in the organization for all areas that the employee is a supervisor. 525 525 * @param int $employeeID The ID of employee … … 533 533 } 534 534 535 $query = "SELECT 535 $query = "SELECT 536 536 a.area_id 537 FROM 538 area a 539 LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id) 540 AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) 541 WHERE 542 a.titular_funcionario_id = ? OR 537 FROM 538 area a 539 LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id) 540 AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) 541 WHERE 542 a.titular_funcionario_id = ? OR 543 543 s.funcionario_id = ? 544 544 GROUP BY 545 545 a.area_id"; 546 546 547 547 $result = $this->db->query($query, array($employeeID,$employeeID)); 548 548 if (!$result) 549 549 return false; 550 550 551 551 $output = $result->GetArray(-1); 552 552 return $output;
Note: See TracChangeset
for help on using the changeset viewer.