Changeset 2292 for sandbox/workflow


Ignore:
Timestamp:
03/18/10 08:32:36 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Substituindo instanciações diretas (new) pela nova factory.

Location:
sandbox/workflow/branches/609/inc
Files:
7 edited

Legend:

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

    r2233 r2292  
    194194        Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 
    195195 
    196         $job = new JobScheduler(); 
     196        $job = Factory::newInstance('JobScheduler'); 
    197197        $job->run(); 
    198198} 
  • sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php

    r2291 r2292  
    1212require_once('class.so_userinterface.inc.php'); 
    1313require_once('class.bo_ajaxinterface.inc.php'); 
    14 require_once('class.Paging.inc.php'); 
    1514 
    1615require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'); 
     
    148147                $itemsPerPage = isset($preferences['ui_items_per_page']) ? $preferences['ui_items_per_page'] : 15; 
    149148                $lightVersion = ((isset($preferences['use_light_interface']) ? $preferences['use_light_interface'] : 0) == 1); 
    150                 $paging = new Paging($itemsPerPage, $_POST); 
     149                $paging = Factory::newInstance('Paging', $itemsPerPage, $_POST); 
    151150 
    152151                /* define the sorting */ 
     
    726725                        /* paginate the result */ 
    727726                        $itemsPerPage = isset($_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page']) ? $_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page'] : 15; 
    728                         $paging = new Paging($itemsPerPage, $_POST); 
     727                        $paging = Factory::newInstance('Paging', $itemsPerPage, $_POST); 
    729728                        $output['instances'] = $paging->restrictItems($output['instances']); 
    730729                        $output['paging_links'] = $paging->commonLinks(); 
  • sandbox/workflow/branches/609/inc/class.ui_adminsource.inc.php

    r2233 r2292  
    1717 */ 
    1818require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'; 
    19 require_once dirname(__FILE__) . SEP . 'class.workflow_acl.inc.php'; 
    2019require_once 'engine' . SEP . 'config.ajax.inc.php'; 
    2120 
     
    4342        function ui_adminsource() 
    4443        { 
    45                 $this->workflow_acl = new workflow_acl(); 
     44                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    4645                $denyAccess = true; 
    4746                if ($this->workflow_acl->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id'])) 
  • sandbox/workflow/branches/609/inc/class.ui_ajaxinterface.inc.php

    r2233 r2292  
    1111\**************************************************************************/ 
    1212 
    13 require_once 'class.workflow_acl.inc.php'; 
    1413require_once 'common.inc.php'; 
    1514require_once 'engine/class.ajax_config.inc.php'; 
     
    5049        function set_wf_session() 
    5150        { 
    52                 $acl = new workflow_acl(); 
     51                $acl = Factory::getInstance('workflow_acl'); 
    5352                $_SESSION['phpgw_info']['workflow']['server_root'] = PHPGW_SERVER_ROOT; 
    5453                $_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = PHPGW_API_INC; 
  • sandbox/workflow/branches/609/inc/class.ui_monitors.inc.php

    r2253 r2292  
    1212 
    1313require_once(dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'); 
    14 require_once(dirname(__FILE__) . SEP . 'class.workflow_acl.inc.php'); 
    1514/** 
    1615 * @package Workflow 
     
    3736        { 
    3837                $this->set_wf_session(); 
    39                 $this->workflow_acl = new workflow_acl(); 
     38                $this->workflow_acl = Factory::getInstance('workflow_acl'); 
    4039 
    4140                if (!($this->workflow_acl->checkUserGroupAccessToType('MON', $_SESSION['phpgw_info']['workflow']['account_id']) || ($this->workflow_acl->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id'])))) 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_engine.php

    r2253 r2292  
    9090        function continueInstance($activityID, $instanceID) 
    9191        { 
    92                 require_once 'class.wf_instance.php'; 
    93                 $WFInstance = new wf_instance(); 
     92                $WFInstance = &Factory::getInstance('wf_instance'); 
    9493                return $WFInstance->continueInstance($activityID, $instanceID); 
    9594        } 
     
    104103        function abortInstance($instanceID) 
    105104        { 
    106                 require_once 'class.wf_instance.php'; 
    107                 $WFInstance = new wf_instance(); 
     105                $WFInstance = &Factory::getInstance('wf_instance'); 
    108106                return $WFInstance->abort($instanceID); 
    109107        } 
     
    119117        function setInstanceName($instanceID, $name) 
    120118        { 
    121                 require_once 'class.wf_instance.php'; 
    122                 $WFInstance = new wf_instance(); 
     119                $WFInstance = &Factory::getInstance('wf_instance'); 
    123120                return $WFInstance->setName($instanceID, $name); 
    124121        } 
     
    134131        function setInstancePriority($instanceID, $priority) 
    135132        { 
    136                 require_once 'class.wf_instance.php'; 
    137                 $WFInstance = new wf_instance(); 
     133                $WFInstance = &Factory::getInstance('wf_instance'); 
    138134                return $WFInstance->setPriority($instanceID, $priority); 
    139135        } 
     
    149145        function getIdleInstances($numberOfDays, $activities = null) 
    150146        { 
    151                 require_once 'class.wf_instance.php'; 
    152                 $WFInstance = new wf_instance(); 
     147                $WFInstance = &Factory::getInstance('wf_instance'); 
    153148                return $WFInstance->getIdle($numberOfDays, $activities); 
    154149        } 
     
    175170        function getInstancesByName($name) 
    176171        { 
    177                 require_once 'class.wf_instance.php'; 
    178                 $WFInstance = new wf_instance(); 
     172                $WFInstance = &Factory::getInstance('wf_instance'); 
    179173                $preOutput = $WFInstance->getByName($name); 
    180174                $output = array(); 
     
    197191        function getChildInstances($instanceID = null, $activityID = null) 
    198192        { 
    199                 require_once 'class.wf_instance.php'; 
    200                 $WFInstance = new wf_instance(); 
     193                $WFInstance = Factory::getInstance('wf_instance'); 
    201194                $preOutput = $WFInstance->getChildren($instanceID, $activityID); 
    202195                $output = array(); 
     
    217210        function getInstanceProperties($instanceID) 
    218211        { 
    219                 require_once 'class.wf_instance.php'; 
    220                 $WFInstance = new wf_instance(); 
     212                $WFInstance = &Factory::getInstance('wf_instance'); 
    221213                return $WFInstance->getProperties($instanceID); 
    222214        } 
     
    231223        function getChildInstanceProperties($instanceID) 
    232224        { 
    233                 require_once 'class.wf_instance.php'; 
    234                 $WFInstance = new wf_instance(); 
     225                $WFInstance = &Factory::getInstance('wf_instance'); 
    235226                return $WFInstance->getProperties($instanceID); 
    236227        } 
     
    346337        function getUserInstances($users, $activities = null, $status = null) 
    347338        { 
    348                 require_once 'class.wf_instance.php'; 
    349                 $WFInstance = new wf_instance(); 
     339                $WFInstance = &Factory::getInstance('wf_instance'); 
    350340                return $WFInstance->getByUser($users, $activities, $status); 
    351341        } 
     
    360350        function setInstanceProperty($instanceID, $nameProperty, $value) 
    361351        { 
    362                 require_once 'class.wf_instance.php'; 
    363                 $WFInstance = new wf_instance(); 
     352                $WFInstance = &Factory::getInstance('wf_instance'); 
    364353                return $WFInstance->setProperty($instanceID, $nameProperty, $value); 
    365354        } 
     
    377366        function checkUserAccessToInstance($userID, $instanceID, $activityID, $writeAccess = true) 
    378367        { 
    379                 require_once 'class.wf_instance.php'; 
    380                 $WFInstance = new wf_instance(); 
     368                $WFInstance = &Factory::getInstance('wf_instance'); 
    381369                return $WFInstance->checkUserAccess($userID, $instanceID, $activityID, $writeAccess); 
    382370        } 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_instance.php

    r2253 r2292  
    456456                if ($userID !== '*') 
    457457                { 
    458                         require_once dirname(__FILE__) . '/class.wf_role.php'; 
    459                         require_once dirname(__FILE__) . '/class.wf_engine.php'; 
    460  
    461                         $wfRole = new wf_role(); 
    462                         $engine = new wf_engine(); 
     458                        $wfRole = Factory::getInstance('wf_role'); 
     459                        $engine = Factory::getInstance('wf_engine'); 
    463460                        /* get information about the activity */ 
    464461                        if (($activityInfo = $engine->getActivityInformationByID($activityID)) === false) 
     
    529526 
    530527                /* try to get the role id */ 
    531                 require_once dirname(__FILE__) . '/class.wf_role.php'; 
    532                 $wfRole = new wf_role(); 
     528                $wfRole = Factory::getInstance('wf_role'); 
    533529                if (($roleID = $wfRole->getRoleIdByName($roleName)) === false) 
    534530                        return false; 
Note: See TracChangeset for help on using the changeset viewer.