Changeset 2533


Ignore:
Timestamp:
04/14/10 16:08:15 (14 years ago)
Author:
pedroerp
Message:

Ticket #993 - Merged 2377:2466 /sandbox/workflow/trunk/ em /sandbox/workflow/branches/993

Location:
sandbox/workflow/branches/993
Files:
20 edited

Legend:

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

    r2492 r2533  
    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/993/inc/class.run_activity.inc.php

    r2492 r2533  
    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 
     
    405403                                $this->download_mode = get_var('download_mode', array('POST','GET'), false); 
    406404 
    407                                 /* #celepar# smarty code*/ 
    408  
    409405                                $smarty = Factory::getInstance('process_smarty'); 
    410406 
     
    427423                                $smarty->assign('wf_back_link',$GLOBALS['workflow']['wf_back_link']); 
    428424                                $smarty->assign('wf_activity_url',$GLOBALS['workflow']['wf_activity_url']); 
    429                                  
     425 
    430426                                /* register the prefilter smarty plugin wf_default_template */ 
    431427                                $smarty->load_filter('pre', 'wf_default_template'); 
     
    448444                        $security             =& Factory::newInstance('SecurityUtils');              //input sanitizer class 
    449445                        $env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client 
    450                         //$env['factory']       =& new ProcessFactory();             //instantiation controller class 
    451446                        $env['factory']       =& Factory::getInstance('ProcessWrapperFactory');  //instantiation controller class 
    452447                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     
    454449 
    455450                        $GLOBALS['workflow_env'] = &$env; 
    456                         //echo "<br><br><br><br><br>Including $source <br>In request: <pre>";print_r($_REQUEST);echo "</pre>"; 
    457                         //[__leave_activity] is setted if needed in the xxx_pre code or by the user in his code 
    458                         // HERE the user code is 'executed'. Note that we do not use include_once or require_once because 
    459                         //it could the same code several times with automatic activities looping in the graph and it still 
    460                         //need to be executed 
     451 
     452                        /** 
     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 
     457                         */ 
    461458                        $_engineProcessCodeDirectory = GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'; 
    462459                        $_engineCompilerDirectory = GALAXIA_LIBRARY . SEP . 'compiler'; 
     
    484481 
    485482                        /** 
    486                          * XXX 
    487                          * here we are going to use our new Security static class. 
     483                         * Here we are going to use our new Security static class. 
    488484                         * From now, the factory frontend (static) will forward 
    489485                         * the messages for the process factory instead of Workflow 
    490486                         * factory. 
    491                          * XXX 
    492487                        */ 
    493488                        Security::enable(); 
     
    692687                                unset($GLOBALS['workflow']['wf_instance_url']); 
    693688 
    694                         /* CELEPAR */ 
    695689                        /* activate local functions */ 
    696690                        require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'local' . SEP . 'functions' . SEP . 'local.functions.php'); 
    697                         /* CELEPAR */ 
    698691 
    699692                        //get configuration options with default values if no init was done before 
     
    720713                        $security             =& Factory::newInstance('SecurityUtils'); //input sanitizer class 
    721714                        $env['request']       =& $security->process($_REQUEST); //sanitizes input data from client 
    722                         //$env['factory']       =& new ProcessFactory();                           //instantiation controller class 
    723715                        $env['factory']       =& Factory::newInstance('ProcessWrapperFactory');  //instantiation controller class 
    724716                        $env['natural']           =& wf_create_object('wf_natural');   //data access object instance for mainframe 
     
    735727 
    736728                        /** 
    737                          * XXX 
    738729                         * here we are going to use our new Security static class. 
    739730                         * From now, the factory frontend (static) will forward 
     
    741732                         * factory. Note that this is the same comment as the previous 
    742733                         * function... boooring.. =} 
    743                          * XXX 
    744                         */ 
     734                         */ 
    745735                        Security::enable(); 
    746736 
  • sandbox/workflow/branches/993/inc/class.so_move_instances.inc.php

    r2372 r2533  
    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/993/inc/class.so_userinterface.inc.php

    r2418 r2533  
    349349        { 
    350350                /* get ldap connection */ 
    351                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     351                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    352352 
    353353                $searchTermExploded = explode(" ", $searchTerm); 
     
    429429        { 
    430430                /* get ldap connection */ 
    431                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     431                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    432432 
    433433                /* makes no sense search for an area if the string has more than one word */ 
     
    525525 
    526526                /* get ldap connection */ 
    527                 $ldap = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
     527                $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 
    528528 
    529529                /* searching employees by telephoneNumber in the ldap server */ 
  • sandbox/workflow/branches/993/inc/class.ui_adminprocesses.inc.php

    r2492 r2533  
    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/993/inc/common.inc.php

    r2492 r2533  
    101101 */ 
    102102define('WF_BASE_URL', EGW_BASE_URL . "/workflow/"); 
    103  
    104  
    105 $GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
    106103?> 
  • sandbox/workflow/branches/993/inc/engine/src/API/Instance.php

    r2372 r2533  
    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/993/inc/engine/src/ProcessManager/ActivityManager.php

    r2372 r2533  
    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/993/inc/local/classes/class.wf_engine.php

    r2372 r2533  
    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/993/inc/local/classes/class.wf_instance.php

    r2372 r2533  
    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/993/inc/local/classes/class.wf_ldap.php

    r2372 r2533  
    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/993/inc/local/classes/class.wf_location.php

    r2160 r2533  
    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/993/inc/local/classes/class.wf_orgchart.php

    r2371 r2533  
    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/993/inc/local/classes/class.wf_role.php

    r2372 r2533  
    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/993/inc/local/classes/class.wf_workitem.php

    r795 r2533  
    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/993/inc/nano/NanoController.class.php

    r2372 r2533  
    5959    function __construct() 
    6060    { 
    61         $this->_mObjJsonConverter = &Factory::newInstance('NanoJsonConverter'); 
    62         $this->_mObjJson          = &Factory::newInstance('Services_JSON'); 
     61        $this->_mObjJsonConverter = new NanoJsonConverter(); 
     62        $this->_mObjJson          = new Services_JSON(); 
    6363    } 
    6464 
     
    130130    public function iterateOverVirtualRequests() 
    131131    { 
    132         $this->_mObjNanoRequest = &Factory::newInstance('NanoRequest', $this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix ); 
     132        $this->_mObjNanoRequest = new NanoRequest( $this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix ); 
    133133        $return_data            = array(); 
    134134 
  • sandbox/workflow/branches/993/inc/nano/NanoGuardian.class.php

    r2372 r2533  
    3232    public function __construct() 
    3333    { 
    34         $this->_mObjNanoSanitizer = &Factory::newInstance('NanoSanitizer', new DummyLogger); 
     34        $this->_mObjNanoSanitizer = new NanoSanitizer(new DummyLogger); 
    3535    } 
    3636 
  • sandbox/workflow/branches/993/inc/nano/NanoJsonConverter.class.php

    r2372 r2533  
    118118        // initialize JSON object 
    119119        $this->_mObjJson = ( strtolower($return_type) != 'object' ) 
    120                                 ? Factory::getInstance('Services_JSON', SERVICES_JSON_LOOSE_TYPE ) 
    121                                 : Factory::getInstance('Services_JSON'); 
     120                                ? new Services_JSON( SERVICES_JSON_LOOSE_TYPE ) 
     121                                : new Services_JSON(); 
    122122    } 
    123123 
  • sandbox/workflow/branches/993/inc/natural/class.natural.php

    r795 r2533  
    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/993/lib/factory/WorkflowFactory.php

    r2372 r2533  
    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.