Ignore:
Timestamp:
09/09/10 15:56:47 (14 years ago)
Author:
viani
Message:

Ticket #1186 - Correção no array de atributos Ldap retornados pela pesquisa de employee

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/local/classes/class.wf_orgchart.php

    r3212 r3225  
    157157                return $output; 
    158158        } 
    159          
     159 
    160160        /** 
    161161         * Searches for all the supervisors of an organization. 
    162162         * 
    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. 
    164164         * @param int $organizationID the ID of the Organization. 
    165165         * @return array Uma array seqüencial contendo as áreas de uma organização e seus titulares e substitutos. Cada linha do array conterá: 
     
    170170         */ 
    171171        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, 
    175175                                                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 
    179179                                                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 
    185185                                                a.titular_funcionario_id, 
    186                                                 s.funcionario_id,  
     186                                                s.funcionario_id, 
    187187                                                a.area_id"; 
    188188                $result = $this->db->query($query, array($organizationID)); 
     
    518518                return $output; 
    519519        } 
    520          
     520 
    521521        /** 
    522522         * Return all areas that the employee is a supervisor. 
    523          *  
     523         * 
    524524         * Search in the organization for all areas that the employee is a supervisor. 
    525525         * @param int $employeeID The ID of employee 
     
    533533                } 
    534534 
    535                 $query = "SELECT  
     535                $query = "SELECT 
    536536                                                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 
    543543                                                s.funcionario_id = ? 
    544544                                        GROUP BY 
    545545                                                a.area_id"; 
    546                  
     546 
    547547                $result = $this->db->query($query, array($employeeID,$employeeID)); 
    548548                if (!$result) 
    549549                        return false; 
    550                  
     550 
    551551                $output = $result->GetArray(-1); 
    552552                return $output; 
Note: See TracChangeset for help on using the changeset viewer.