Ignore:
Timestamp:
03/12/10 10:59:32 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Migração das classes do módulo workflow para a nova factory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php

    r2094 r2233  
    2222        function so_userinterface() 
    2323        { 
    24                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID; 
     24                $this->db =& Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 
    2525                $this->db->SetFetchMode(ADODB_FETCH_ASSOC); 
    2626        } 
     
    9393                if (!empty($externalApplicationsID)) 
    9494                { 
    95                         $result = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID->query("SELECT DISTINCT external_application_id, name, address, image, authentication, intranet_only FROM egw_wf_external_application WHERE (external_application_id IN (" . implode(', ', $externalApplicationsID)  . ")) ORDER BY name"); 
     95                        $result = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID->query("SELECT DISTINCT external_application_id, name, address, image, authentication, intranet_only FROM egw_wf_external_application WHERE (external_application_id IN (" . implode(', ', $externalApplicationsID)  . ")) ORDER BY name"); 
    9696                        $preOutput = $result->GetArray(-1); 
    9797 
     
    245245 
    246246                $employees = $result->GetArray(-1); 
    247                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     247                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    248248                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 
    249249                $categoriesCount = array(); 
     
    318318 
    319319                $employees = $result->GetArray(-1); 
    320                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     320                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    321321                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 
    322322                for ($i = 0; $i < count($employees); $i++) 
     
    370370 
    371371                /* searching employees by name in the ldap server */ 
    372                 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(cn=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 
     372                $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(cn=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 
    373373                if ($list === false) 
    374374                        return false; 
     
    466466 
    467467                /* executing it */ 
    468                 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber')); 
     468                $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber')); 
    469469                $entries = ldap_get_entries($ldap, $list); 
    470470 
     
    475475 
    476476                /* we will need to search into database 'cache' for users deleted in ldap */ 
    477                 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
     477                $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 
    478478                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_DATABASE ); 
    479479 
     
    531531 
    532532                /* searching employees by telephoneNumber in the ldap server */ 
    533                 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(telephoneNumber=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 
     533                $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(telephoneNumber=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 
    534534 
    535535                if (!$list) return false; 
     
    652652                $result = $this -> db -> query( "SELECT a.sigla as area, a.titular_funcionario_id as titular, s.funcionario_id as substituto, s.data_inicio, s.data_fim FROM area a INNER JOIN substituicao s ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) WHERE (organizacao_id = ?) ORDER BY area", array( $organizationID ) ); 
    653653 
    654                 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
     654                $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 
    655655                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); 
    656656 
     
    719719 
    720720                $employees = $result -> GetArray( -1 ); 
    721                 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
     721                $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 
    722722                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 
    723723 
     
    791791                $employees = $result -> GetArray( -1 ); 
    792792 
    793                 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
     793                $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 
    794794                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 
    795795 
     
    817817                usort( $employees, create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) ); 
    818818 
    819                 $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 50, $_POST); 
     819                $paging = Factory::newInstance('Paging', 50, $_POST); 
    820820                $employees = $paging->restrictItems( $employees ); 
    821821 
Note: See TracChangeset for help on using the changeset viewer.