Ignore:
Timestamp:
08/03/09 09:52:13 (15 years ago)
Author:
rodsouza
Message:

Ticket #589 - itens (doc. anexo ao ticket) 1, 2, 3, 4 e 5 integralmente e item 6 parcialmente.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.so_userinterface.inc.php

    r795 r1245  
    426426                return $output; 
    427427        } 
     428 
     429        /** 
     430         * Get useful phones list 
     431         * @param int $organizationID The organization ID 
     432         * @return array Useful phones list 
     433         * @access public 
     434         */ 
     435        function getUsefulPhones( $organizationID ) 
     436        { 
     437                $result = $this -> db -> query( "SELECT descricao, numero FROM telefone WHERE (organizacao_id = ?) ORDER BY descricao", array( $organizationID ) ); 
     438 
     439                $output = $result->GetArray(-1); 
     440                for ($i = 0; $i < count($output); $i++) 
     441                        for ($j = 0; $j < $result->_numOfFields; $j++) 
     442                                unset($output[$i][$j]); 
     443 
     444                return $output; 
     445        } 
     446 
     447        /** 
     448         * Get areas with substitute boss 
     449         * @param int $organizationID The organization ID 
     450         * @return array areas with substitute boss 
     451         * @access public 
     452         */ 
     453        function getAreaWithSubtituteBoss( $organizationID ) 
     454        { 
     455                $result = $this -> db -> query( "SELECT sigla as area, titular_funcionario_id as titular, substituto_funcionario_id as substituto FROM area WHERE (organizacao_id = ?) and substituto_funcionario_id is not null ORDER BY area", array( $organizationID ) ); 
     456 
     457                $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
     458                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); 
     459 
     460                $output = $result->GetArray(-1); 
     461                for ( $i = 0; $i < count($output); $i++ ) 
     462                { 
     463                        for ($j = 0; $j < $result->_numOfFields; $j++) 
     464                                unset($output[$i][$j]); 
     465 
     466                        $entry = $cachedLDAP -> getEntryByID( $output[ $i ][ 'titular' ] ); 
     467                        if ( $entry && ( ! is_null( $entry[ 'cn' ] ) ) ) 
     468                                $output[ $i ][ 'titular' ] = $entry[ 'cn' ]; 
     469 
     470                        $entry = $cachedLDAP -> getEntryByID( $output[ $i ][ 'substituto' ] ); 
     471                        if ( $entry && ( ! is_null( $entry[ 'cn' ] ) ) ) 
     472                                $output[ $i ][ 'substituto' ] = $entry[ 'cn' ]; 
     473                } 
     474 
     475                return $output; 
     476        } 
    428477} 
    429478?> 
Note: See TracChangeset for help on using the changeset viewer.