Ignore:
Timestamp:
03/11/10 15:42:15 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Iniciando a migração do workflow para a nova factory.

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

Legend:

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

    r2107 r2223  
    4545                $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['workflow']['title']; 
    4646                $GLOBALS['phpgw_info']['flags'] = array('noheader' => false, 'nonavbar' => false, 'currentapp' => 'workflow'); 
    47                 $smarty = CreateObject('workflow.workflow_smarty'); 
     47                //$smarty = CreateObject('workflow.workflow_smarty'); 
     48                $smarty = Factory::getInstance('workflow_smarty'); 
    4849 
    4950                // Check if workflow config is ok 
  • sandbox/workflow/branches/609/inc/common.inc.php

    r2222 r2223  
    1212 
    1313/** 
    14  * Server base path. This constant must be defined by expresso itself. 
    15  * Anyway, there are cases that we access Workflow directly; therefore 
    16  * it must be defined somewhere... 
    17  * @name PHPGW_SERVER_ROOT 
     14 * Server base path. This constant is somewhat simililar to 
     15 * 'PHPGW_SERVER_ROOT'. Nevertheless, there are cases that we 
     16 * access Workflow directly and it must be defined somewhere. 
     17 * @name EGW_SERVER_ROOT 
    1818 */ 
    19 if (!defined('PHPGW_SERVER_ROOT')) 
    20         define('PHPGW_SERVER_ROOT', $HTTP_SERVER_VARS['DOCUMENT_ROOT']); 
     19define('EGW_SERVER_ROOT', $HTTP_SERVER_VARS['DOCUMENT_ROOT']); 
    2120 
    2221/** 
     
    2423 * @name WF_SERVER_ROOT 
    2524 */ 
    26 define('WF_SERVER_ROOT', PHPGW_SERVER_ROOT.'/workflow/'); 
     25define('WF_SERVER_ROOT', EGW_SERVER_ROOT.'/workflow/'); 
    2726 
    2827/** 
     
    3938 
    4039 
    41 if (file_exists(PHPGW_SERVER_ROOT . '/header.session.inc.php')) { 
    42         require_once PHPGW_SERVER_ROOT . '/header.session.inc.php'; 
     40if (file_exists(EGW_SERVER_ROOT . '/header.session.inc.php')) { 
     41        require_once EGW_SERVER_ROOT . '/header.session.inc.php'; 
    4342} 
    4443 
     
    5453/* including common classes */ 
    5554require_once WF_LIB_ROOT . 'security/Security.php'; 
    56 //require_once WF_LIB_ROOT . 'factory/Factory.php'; 
     55require_once WF_LIB_ROOT . 'factory/Factory.php'; 
    5756require_once WF_LIB_ROOT . 'factory/BaseFactory.php'; 
    5857require_once WF_LIB_ROOT . 'factory/WorkflowFactory.php'; 
    5958require_once WF_LIB_ROOT . 'factory/ProcessFactory.php'; 
    6059 
    61  
    62 /* TODO - here we will still using that old and ugly factory */ 
    63 /* in a near future we should do things right.. */ 
    64 require_once WF_INC_ROOT . 'class.factory.inc.php'; 
    65 $GLOBALS['workflow']['factory'] = new Factory(); 
    66 $GLOBALS['workflow']['workflowObjects'] = $GLOBALS['workflow']['factory']->newInstance('WorkflowObjects'); 
    67  
    68 //$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects', 'asd', 123); 
     60$GLOBALS['workflow']['workflowObjects'] = Factory::getInstance('WorkflowObjects'); 
    6961?> 
  • sandbox/workflow/branches/609/lib/factory/Factory.php

    r2222 r2223  
    7474 
    7575                        $args = func_get_args(); 
    76                         call_user_func_array(array(self::$_securedFactory, "getInstance"), $args); 
     76                        return call_user_func_array(array(self::$_securedFactory, "getInstance"), $args); 
    7777 
    7878                } 
     
    8585 
    8686                        $args = func_get_args(); 
    87                         call_user_func_array(array(self::$_unsecuredFactory, "getInstance"), $args); 
     87                        return call_user_func_array(array(self::$_unsecuredFactory, "getInstance"), $args); 
    8888                } 
    89  
    9089        } 
    9190 
  • sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php

    r2222 r2223  
    4949                /* registering allowed classes */ 
    5050                $this->registerFileInfo('WorkflowObjects', 'class.WorkflowObjects.inc.php', 'inc'); 
     51                $this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc'); 
     52                $this->registerFileInfo('workflow_smarty', 'class.workflow_smarty.inc.php', 'inc'); 
    5153 
    52                 $this->registerFileInfo('db', 'x', 'inc', PHPGW_API_INC); 
     54                /* registering egw class example */ 
     55                //$this->registerFileInfo('db', 'x', 'inc', PHPGW_API_INC); 
    5356 
    5457                /* ok. no more instances of this class.. */ 
  • sandbox/workflow/branches/609/templateFile.php

    r1468 r2223  
    1212if (empty($_SESSION)) 
    1313        exit(0); 
    14 $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->redirect(); 
     14//$GLOBALS['workflow']['factory']->getInstance('TemplateServer')->redirect(); 
     15Factory::getInstance('TemplateServer')->redirect(); 
    1516?> 
Note: See TracChangeset for help on using the changeset viewer.