Changeset 2440 for sandbox/workflow


Ignore:
Timestamp:
04/07/10 11:02:26 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Últimas modificações e retirada da WorkflowObjects? da GLOBALS.

Location:
sandbox/workflow/branches/609
Files:
17 edited

Legend:

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

    r2311 r2440  
    6565                require_once PHPGW_SERVER_ROOT . '/workflow/inc/local/functions/local.functions.php'; 
    6666 
    67                 $runtime = &Factory::getInstance('WfRuntime', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     67                $runtime = &Factory::getInstance('WfRuntime'); 
    6868                $runtime->loadProcess($processID); 
    6969 
  • sandbox/workflow/branches/609/inc/class.run_activity.inc.php

    r2355 r2440  
    168168                var $agents = Array(); 
    169169 
    170                 /* CELEPAR */ 
    171170                /** 
    172171                 * @var object $smarty holds a Smarty instance 
     
    194193         */ 
    195194                var $isChildInstance = false; 
    196  
     195                /** 
     196                 * @var object Stores a 'workflow_smarty' object 
     197         * @access private 
     198         */ 
    197199                private $workflowSmarty = null; 
    198                 /* CELEPAR */ 
     200 
    199201                /** 
    200202                 * Constructor 
     
    212214                        $this->runtime                  = &Factory::newInstance('workflow_wfruntime'); 
    213215                        $this->runtime->setDebug(_DEBUG); 
    214                         //$this->base_activity  = Factory::getInstance('workflow_baseactivity'); 
    215                         //$this->process                = Factory::getInstance('workflow_process'); 
    216216                        $this->GUI                              = &Factory::getInstance('workflow_gui'); 
    217217                        $this->categories               = &Factory::getInstance('categories'); 
    218218 
    219219                        $this->workflowSmarty   = &Factory::getInstance('workflow_smarty', false); 
     220 
    220221                        // TODO: open a new connection to the database under a different username to allow privilege handling on tables 
    221                         /* CELEPAR */ 
    222222                        unset($this->db); 
    223223                } 
     
    335335                        $wf =& $GLOBALS['workflow']; 
    336336 
    337                         /* CELEPAR */ 
    338337                        /* path to the local functions developed by Celepar */ 
    339338                        $functions = PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'local' . SEP . 'functions' . SEP . 'local.functions.php'; 
     
    341340                        /* activate local functions */ 
    342341                        require_once($functions); 
    343                         /* CELEPAR */ 
    344342 
    345343                        //get configuration options with default values if no init was done before 
     
    401399                                $this->download_mode = get_var('download_mode', array('POST','GET'), false); 
    402400 
    403                                 /* #celepar# smarty code*/ 
    404  
    405401                                $smarty = Factory::getInstance('process_smarty'); 
    406402 
     
    423419                                $smarty->assign('wf_back_link',$GLOBALS['workflow']['wf_back_link']); 
    424420                                $smarty->assign('wf_activity_url',$GLOBALS['workflow']['wf_activity_url']); 
    425                                  
     421 
    426422                                /* register the prefilter smarty plugin wf_default_template */ 
    427423                                $smarty->load_filter('pre', 'wf_default_template'); 
     
    444440                        $security             =& Factory::newInstance('SecurityUtils');              //input sanitizer class 
    445441                        $env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client 
    446                         //$env['factory']       =& new ProcessFactory();             //instantiation controller class 
    447442                        $env['factory']       =& Factory::getInstance('ProcessWrapperFactory');  //instantiation controller class 
    448443                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     
    450445 
    451446                        $GLOBALS['workflow_env'] = &$env; 
    452                         //echo "<br><br><br><br><br>Including $source <br>In request: <pre>";print_r($_REQUEST);echo "</pre>"; 
    453                         //[__leave_activity] is setted if needed in the xxx_pre code or by the user in his code 
    454                         // HERE the user code is 'executed'. Note that we do not use include_once or require_once because 
    455                         //it could the same code several times with automatic activities looping in the graph and it still 
    456                         //need to be executed 
     447 
     448                        /** 
     449                         * [__leave_activity] is setted if needed in the xxx_pre code or by the user in his code 
     450                         * HERE the user code is 'executed'. Note that we do not use include_once or require_once because 
     451                         * it could the same code several times with automatic activities looping in the graph and it still 
     452                         * need to be executed 
     453                         */ 
    457454                        $_engineProcessCodeDirectory = GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'; 
    458455                        $_engineCompilerDirectory = GALAXIA_LIBRARY . SEP . 'compiler'; 
     
    480477 
    481478                        /** 
    482                          * XXX 
    483                          * here we are going to use our new Security static class. 
     479                         * Here we are going to use our new Security static class. 
    484480                         * From now, the factory frontend (static) will forward 
    485481                         * the messages for the process factory instead of Workflow 
    486482                         * factory. 
    487                          * XXX 
    488483                        */ 
    489484                        Security::enable(); 
     
    688683                                unset($GLOBALS['workflow']['wf_instance_url']); 
    689684 
    690                         /* CELEPAR */ 
    691685                        /* activate local functions */ 
    692686                        require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'local' . SEP . 'functions' . SEP . 'local.functions.php'); 
    693                         /* CELEPAR */ 
    694687 
    695688                        //get configuration options with default values if no init was done before 
     
    716709                        $security             =& Factory::newInstance('SecurityUtils'); //input sanitizer class 
    717710                        $env['request']       =& $security->process($_REQUEST); //sanitizes input data from client 
    718                         //$env['factory']       =& new ProcessFactory();                           //instantiation controller class 
    719711                        $env['factory']       =& Factory::newInstance('ProcessWrapperFactory');  //instantiation controller class 
    720712                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     
    731723 
    732724                        /** 
    733                          * XXX 
    734725                         * here we are going to use our new Security static class. 
    735726                         * From now, the factory frontend (static) will forward 
     
    737728                         * factory. Note that this is the same comment as the previous 
    738729                         * function... boooring.. =} 
    739                          * XXX 
    740                         */ 
     730                         */ 
    741731                        Security::enable(); 
    742732 
  • sandbox/workflow/branches/609/inc/class.so_move_instances.inc.php

    r2311 r2440  
    111111                                $where[] = 'wf_p_id IS NULL'; 
    112112                } 
    113                 $processManager = &Factory::getInstance('ProcessManager', $this->db); 
     113                $processManager = &Factory::getInstance('ProcessManager'); 
    114114 
    115115                /* workaround to sort the result using two columns */ 
  • sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php

    r2323 r2440  
    351351        { 
    352352                /* get ldap connection */ 
    353                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     353                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    354354 
    355355                $searchTermExploded = explode(" ", $searchTerm); 
     
    431431        { 
    432432                /* get ldap connection */ 
    433                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     433                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    434434 
    435435                /* makes no sense search for an area if the string has more than one word */ 
     
    527527 
    528528                /* get ldap connection */ 
    529                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     529                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    530530 
    531531                /* searching employees by telephoneNumber in the ldap server */ 
  • sandbox/workflow/branches/609/inc/class.ui_adminprocesses.inc.php

    r2338 r2440  
    11<?php 
    2 require_once 'common.inc.php'; 
    32require_once(dirname(__FILE__) . SEP . 'class.bo_workflow_forms.inc.php'); 
    43require_once('engine' . SEP . 'config.egw.inc.php'); 
  • sandbox/workflow/branches/609/inc/common.inc.php

    r2338 r2440  
    7070require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; 
    7171require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; 
    72  
    73 $GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
    7472?> 
  • sandbox/workflow/branches/609/inc/engine/src/API/Instance.php

    r2311 r2440  
    11701170     
    11711171    //lock rows and ensure access is granted 
    1172     if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity', $this->db); 
     1172    if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); 
    11731173    if (!($this->security->checkUserAction($activityId,$this->instanceId,'complete'))) 
    11741174    { 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ActivityManager.php

    r2311 r2440  
    11951195    elseif ( (!($result=='*')) && $performAccessCheck) 
    11961196    { 
    1197       $wf_security = &Factory::getInstance('WfSecurity', $this->db); 
     1197      $wf_security = &Factory::getInstance('WfSecurity'); 
    11981198      // perform the check 
    11991199      if (!($wf_security->checkUserAccess($result,$activityId))) 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_engine.php

    r2311 r2440  
    282282                /* build the SQL query */ 
    283283                $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 = ?)"; 
    284                 $db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     284                $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    285285                $resultSet = $db->query($query, array($activityID, $processID)); 
    286286 
     
    310310                /* build the SQL query */ 
    311311                $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 = ?)"; 
    312                 $db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID; 
     312                $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    313313                $resultSet = $db->query($query, array($activityName, $processID)); 
    314314 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_instance.php

    r2311 r2440  
    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 */ 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_ldap.php

    r2311 r2440  
    4444                $this->group_context = $tmpLDAP->getGroupContext(); 
    4545 
    46                 $this->ds = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     46                $this->ds = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    4747 
    4848                $this->cachedLDAP = &Factory::getInstance('wf_cached_ldap'); 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_location.php

    r2160 r2440  
    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/branches/609/inc/local/classes/class.wf_orgchart.php

    r2056 r2440  
    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/branches/609/inc/local/classes/class.wf_role.php

    r2253 r2440  
    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 = Factory::getInstance('workflow_rolemanager'); 
    6161                $this->activityManager = Factory::getInstance('workflow_activitymanager'); 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_workitem.php

    r795 r2440  
    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        } 
  • sandbox/workflow/branches/609/inc/natural/class.natural.php

    r795 r2440  
    196196                        try 
    197197                        { 
    198                                 $str = new PosString(new NatType); 
     198                                $str = Factory::newInstance('PosString', Factory::newInstance('NatType')); 
    199199                                $this->strInputParameter = $str->mountString(array_merge($this->obj->input, $this->obj->output), $inputParams); 
    200200 
     
    409409                if (!empty($this->resultSet)) 
    410410                        unset($this->resultSet); 
    411                 $this->resultSet = new NaturalResultSet($result); 
     411                $this->resultSet = &Factory::newInstance('NaturalResultSet', $result); 
    412412         } 
    413413} 
  • sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php

    r2338 r2440  
    134134                $this->registerFileInfo('NanoSanitizer', 'NanoSanitizer.class.php', 'inc/nano'); 
    135135 
     136                /* natural classes */ 
     137                $this->registerFileInfo('PosString', 'pos_string.php', 'inc/natural'); 
     138                $this->registerFileInfo('NatType', 'nat_types.php', 'inc/natural'); 
     139                $this->registerFileInfo('NaturalResultSet', 'class.natural_resultset.php', 'inc/natural'); 
     140 
    136141                /* registering egw external classes */ 
    137142                $this->registerFileInfo('db', 'class.db.inc.php', '', EGW_INC_ROOT); 
Note: See TracChangeset for help on using the changeset viewer.