Ignore:
Timestamp:
07/15/10 17:30:07 (14 years ago)
Author:
viani
Message:

Ticket #950 - Merged 2838:3056 /trunk/workflow em /sandbox/workflow/trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/trunk/inc/local/classes/class.wf_orgchart.php

    r2466 r3060  
    480480                return $output; 
    481481        } 
     482         
     483        /** 
     484         * Return all areas that the employee is a supervisor. 
     485         *  
     486         * Search in the organization for all areas that the employee is a supervisor. 
     487         * @param int $employeeID The ID of employee 
     488         * @return array Array containing all the areas that the employeee is a supervisor. 
     489         * @access public 
     490         */ 
     491        function getSupervisorAreas($employeeID) { 
     492 
     493                if (!$employeeID) { 
     494                        return false; 
     495                } 
     496 
     497                $query = "SELECT  
     498                                                a.area_id 
     499                                        FROM  
     500                                                area a  
     501                                                LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id)  
     502                                                AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim))  
     503                                        WHERE  
     504                                                a.titular_funcionario_id = ? OR  
     505                                                s.funcionario_id = ? 
     506                                        GROUP BY 
     507                                                a.area_id"; 
     508                 
     509                $result = $this->db->query($query, array($employeeID,$employeeID)); 
     510                if (!$result) 
     511                        return false; 
     512                 
     513                $output = $result->GetArray(-1); 
     514                return $output; 
     515        } 
    482516 
    483517        /** 
Note: See TracChangeset for help on using the changeset viewer.