Ignore:
Timestamp:
03/15/10 14:41:49 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Adaptando os processos do workflow para utilizar o nova factory.

Location:
sandbox/workflow/branches/609/inc
Files:
2 deleted
5 edited

Legend:

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

    r2235 r2249  
    1313        require_once(dirname(__FILE__) . SEP . 'class.basecontroller.inc.php' ); /* module controller            */ 
    1414        require_once(dirname(__FILE__) . SEP . 'class.basemodel.inc.php'      ); /* module logic                 */ 
    15         require_once(dirname(__FILE__) . SEP . 'class.process_factory.inc.php'); /* module process factory class */ 
     15        //require_once(dirname(__FILE__) . SEP . 'class.process_factory.inc.php'); /* module process factory class */ 
    1616        require_once(dirname(__FILE__) . SEP . 'class.utils.security.php'     ); /* sanitizes input data         */ 
    1717 
     
    301301                        $this->process_version  = $this->process->getVersion(); 
    302302                        $this->activity_name    = $activity->getName(); 
    303                         $this->user_name        = Factory::getForeignInstance('phpgwapi', 'phpgw')->accounts->id2name($GLOBALS['user']); 
     303                        $this->user_name                = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']); 
    304304                        $this->view_activity    = $this->GUI->gui_get_process_view_activity($this->process_id); 
    305305 
     
    440440                        $security             =& new SecurityUtils();              //input sanitizer class 
    441441                        $env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client 
    442                         $env['factory']       =& new ProcessFactory();             //instantiation controller class 
     442                        //$env['factory']       =& new ProcessFactory();             //instantiation controller class 
     443                        $env['factory']       =& Factory::getInstance('ProcessWrapperFactory');  //instantiation controller class 
    443444                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
    444445                        /* END WORKFLOW MVC SETTINGS */ 
     
    473474                        /* activate the security policy */ 
    474475                        Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 
     476 
     477                        /** 
     478                         * XXX 
     479                         * here we are going to use our new Security static class. 
     480                         * From now, the factory frontend (static) will forward 
     481                         * the messages for the process factory instead of Workflow 
     482                         * factory. 
     483                         * XXX 
     484                        */ 
     485                        Security::enable(); 
    475486 
    476487                        /* include the files */ 
     
    701712                        $security             =& new SecurityUtils();              //input sanitizer class 
    702713                        $env['request']       =& $security->process($_REQUEST); //sanitizes input data from client 
    703                         $env['factory']       =& new ProcessFactory();                     //instantiation controller class 
     714                        //$env['factory']       =& new ProcessFactory();                           //instantiation controller class 
     715                        $env['factory']       =& Factory::newInstance('ProcessWrapperFactory');  //instantiation controller class 
    704716                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
    705717                        /* END WORKFLOW MVC SETTINGS */ 
     
    713725                        /* activate the security policy */ 
    714726                        Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 
     727 
     728                        /** 
     729                         * XXX 
     730                         * here we are going to use our new Security static class. 
     731                         * From now, the factory frontend (static) will forward 
     732                         * the messages for the process factory instead of Workflow 
     733                         * factory. Note that this is the same comment as the previous 
     734                         * function... boooring.. =} 
     735                         * XXX 
     736                        */ 
     737                        Security::enable(); 
    715738 
    716739                        $GLOBALS['workflow_env'] = &$env; 
  • sandbox/workflow/branches/609/inc/local/classes/class.JobBase.php

    r1437 r2249  
    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); 
    151  
    152                 require_once PHPGW_SERVER_ROOT . '/workflow/inc/class.process_factory.inc.php'; 
     150                Factory::getInstance('WorkflowMacro')->prepareProcessEnvironment($this->processID); 
    153151 
    154152                $this->environment = array(); 
    155                 $this->environment['factory']  = &new ProcessFactory(); 
     153                $this->environment['factory']  = &Factory::newInstance('ProcessWrapperFactory'); 
    156154        } 
    157155 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_ldap.php

    r1067 r2249  
    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(); 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_role.php

    r1048 r2249  
    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/branches/609/inc/smarty/wf_plugins/function.wf_redir_menu.php

    r2233 r2249  
    5454 
    5555        $user_is_admin = Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 
    56         $phpgw =& Factory::getForeignInstance('phpgwapi','phpgw'); 
    57         if ($user_is_admin || ($phpgw->acl->check('admin_workflow',1,'workflow'))) { 
     56        if ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))) { 
    5857                $select_tag .= "<option value=\"ad\">Administração</option>"; 
    5958        } 
    60         if ($user_is_admin ||  ($phpgw->acl->check('monitor_workflow',1,'workflow'))) { 
     59        if ($user_is_admin ||  ($GLOBALS['phpgw']->acl->check('monitor_workflow',1,'workflow'))) { 
    6160                $select_tag .= "<option value=\"mo\">Monitoramento</option>"; 
    6261        } 
Note: See TracChangeset for help on using the changeset viewer.