Ignore:
Timestamp:
08/07/09 16:06:07 (15 years ago)
Author:
gbisotto
Message:

Ticket #609 - Modificada a classe Factory e ProcessFactory? para automatizaro acesso ao objetos

Location:
sandbox/workflow/2.0/inc/local/classes
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/2.0/inc/local/classes/class.JobBase.php

    r795 r1293  
    8989        { 
    9090                require_once 'common.inc.php'; 
    91                 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment(); 
     91                Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 
    9292                $this->jobID = $jobID; 
    9393                $this->processID = $processID; 
    9494                $this->currentDate = $currentDate; 
    95                 $this->jobManager = &$GLOBALS['workflow']['factory']->getInstance('WorkflowJobManager'); 
     95                $this->jobManager = &Factory::getInstance('WorkflowJobManager'); 
    9696                $this->testMode = $testMode; 
    9797                $this->maximumExecutionTime = $maximumExecutionTime; 
     
    148148        final private function prepareEnvironment() 
    149149        { 
    150                 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareProcessEnvironment($this->processID); 
     150                Factory::getInstance('WorkflowMacro')->prepareProcessEnvironment($this->processID); 
    151151 
    152152                require_once PHPGW_SERVER_ROOT . '/workflow/inc/class.process_factory.inc.php'; 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_engine.php

    r795 r1293  
    291291                /* build the SQL query */ 
    292292                $query = "SELECT wf_activity_id, wf_name, wf_normalized_name, wf_type, wf_description FROM egw_wf_activities WHERE (wf_activity_id = ?) AND (wf_p_id = ?)"; 
    293                 $db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     293                $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    294294                $resultSet = $db->query($query, array($activityID, $processID)); 
    295295 
     
    319319                /* build the SQL query */ 
    320320                $query = "SELECT wf_activity_id, wf_name, wf_normalized_name, wf_type, wf_description FROM egw_wf_activities WHERE (wf_name = ?) AND (wf_p_id = ?)"; 
    321                 $db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     321                $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    322322                $resultSet = $db->query($query, array($activityName, $processID)); 
    323323 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_instance.php

    r795 r1293  
    9292        { 
    9393                /* load the DB */ 
    94                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     94                $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    9595 
    9696                /* load the process ID from the runtime */ 
     
    420420                /* load the required instance (for the required user) */ 
    421421                require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'; 
    422                 $GUI = new GUI($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     422                $GUI = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    423423                $userInstance = $GUI->gui_list_user_instances($userID, 0, -1, '', '', "(ga.wf_is_interactive = 'y') AND (gia.wf_activity_id = {$activityID}) AND (gia.wf_instance_id = {$instanceID})", false, $this->processID, true, false, true, false, false, false); 
    424424                $userInstance = $userInstance['data']; 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_ldap.php

    r1067 r1293  
    4141        function wf_ldap() 
    4242        { 
    43                 $tmpLDAP = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     43                $tmpLDAP =& Factory::getInstance('WorkflowLDAP'); 
    4444                $this->user_context  = $tmpLDAP->getUserContext(); 
    4545                $this->group_context = $tmpLDAP->getGroupContext(); 
    4646 
    47                 $this->ds = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     47                $this->ds =& Factory::getInstance('WorkflowObjects')->getLDAP(); 
    4848 
    4949                $this->cachedLDAP = new wf_cached_ldap(); 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_location.php

    r795 r1293  
    3636        function initialize() 
    3737        { 
    38                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID; 
     38                $this->db = &Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID; 
    3939                $this->db->setFetchMode(ADODB_FETCH_ASSOC); 
    4040                $this->cityInfo = array(); 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_orgchart.php

    r1131 r1293  
    2424        function wf_orgchart() 
    2525        { 
    26                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID; 
     26                $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 
    2727                $this->db->setFetchMode(ADODB_FETCH_ASSOC); 
    2828        } 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_role.php

    r1048 r1293  
    5757                        $this->processID = (int) $GLOBALS['workflow']['job']['processID']; 
    5858 
    59                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     59                $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    6060                $this->roleManager = CreateObject('workflow.workflow_rolemanager'); 
    6161                $this->activityManager = CreateObject('workflow.workflow_activitymanager'); 
     
    186186                        $users = array((int) $users); 
    187187                $roleID = $this->roleManager->get_role_id($this->processID, $roleName); 
    188                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     188                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    189189                foreach ($users as $user) 
    190190                { 
     
    212212                $users = $this->roleManager->list_mapped_users($this->processID, false, array('wf_role_name' => $roleName)); 
    213213 
    214                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     214                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    215215                $output = array(); 
    216216                foreach ($users as $id => $login) 
     
    367367 
    368368                /* get the roles */ 
    369                 $userGroups = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserGroups($userID); 
     369                $userGroups = Factory::getInstance('WorkflowLDAP')->getUserGroups($userID); 
    370370                $query = 'SELECT DISTINCT role.wf_role_id, role.wf_name, role.wf_description FROM egw_wf_roles role, egw_wf_user_roles user_role WHERE (user_role.wf_role_id = role.wf_role_id) AND (role.wf_p_id = ?) AND (role.wf_role_id = ANY (?))'; 
    371371                $query .= ' AND (((user_role.wf_user = ?) AND (user_role.wf_account_type = ?))'; 
  • sandbox/workflow/2.0/inc/local/classes/class.wf_workitem.php

    r795 r1293  
    2929        public function wf_workitem() 
    3030        { 
    31                 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     31                $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    3232                $this->processID = (int) $GLOBALS['workflow']['wf_runtime']->activity->getProcessId(); 
    3333        } 
Note: See TracChangeset for help on using the changeset viewer.