- Timestamp:
- 03/29/10 14:46:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/trunk/inc/class.so_userinterface.inc.php
r2094 r2372 1 1 <?php 2 require_once($_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] . '/class.config.inc.php');3 2 4 3 /** … … 22 21 function so_userinterface() 23 22 { 24 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID;23 $this->db =& Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 25 24 $this->db->SetFetchMode(ADODB_FETCH_ASSOC); 26 25 } … … 61 60 $oldDB = $GLOBALS['phpgw']->db; 62 61 $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 63 $config = new config('workflow');62 $config = &Factory::getInstance('config', 'workflow'); 64 63 $configValues = $config->read_repository(); 65 64 $submasksString = $configValues['intranet_subnetworks']; … … 93 92 if (!empty($externalApplicationsID)) 94 93 { 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");94 $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"); 96 95 $preOutput = $result->GetArray(-1); 97 96 … … 245 244 246 245 $employees = $result->GetArray(-1); 247 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');246 $cachedLDAP = Factory::newInstance('CachedLDAP'); 248 247 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 249 248 $categoriesCount = array(); … … 318 317 319 318 $employees = $result->GetArray(-1); 320 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');319 $cachedLDAP = Factory::newInstance('CachedLDAP'); 321 320 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 322 321 for ($i = 0; $i < count($employees); $i++) … … 370 369 371 370 /* 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'));371 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(cn=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 373 372 if ($list === false) 374 373 return false; … … 466 465 467 466 /* executing it */ 468 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber'));467 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber')); 469 468 $entries = ldap_get_entries($ldap, $list); 470 469 … … 475 474 476 475 /* we will need to search into database 'cache' for users deleted in ldap */ 477 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );476 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 478 477 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_DATABASE ); 479 478 … … 531 530 532 531 /* 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'));532 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(telephoneNumber=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 534 533 535 534 if (!$list) return false; … … 594 593 function getEmployeeInfo($employeeID, $organizationID) 595 594 { 596 require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 597 598 $SOOrgchart = new so_orgchart(); 595 $SOOrgchart = &Factory::getInstance('so_orgchart'); 599 596 $SOOrgchart->setExternalCalls(true); 600 597 $output = $SOOrgchart->getEmployeeInfo($employeeID, $organizationID); … … 614 611 function getAreaInfo($areaID, $organizationID) 615 612 { 616 require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 617 618 $SOOrgchart = new so_orgchart(); 613 $SOOrgchart = &Factory::getInstance('so_orgchart'); 619 614 $SOOrgchart->setExternalCalls(true); 620 615 $output = $SOOrgchart->getAreaInfo($areaID, $organizationID); … … 652 647 $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 ) ); 653 648 654 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );649 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 655 650 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); 656 651 … … 719 714 720 715 $employees = $result -> GetArray( -1 ); 721 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );716 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 722 717 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 723 718 … … 791 786 $employees = $result -> GetArray( -1 ); 792 787 793 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );788 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 794 789 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 795 790 … … 817 812 usort( $employees, create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) ); 818 813 819 $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 50, $_POST);814 $paging = Factory::newInstance('Paging', 50, $_POST); 820 815 $employees = $paging->restrictItems( $employees ); 821 816
Note: See TracChangeset
for help on using the changeset viewer.