Changeset 2311 for sandbox/workflow/branches
- Timestamp:
- 03/19/10 17:22:08 (14 years ago)
- Location:
- sandbox/workflow/branches/609
- Files:
-
- 57 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/branches/609/inc/class.JobRunner.inc.php
r2233 r2311 96 96 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 97 97 98 $jobRunner = new JobRunner($argv[1]);98 $jobRunner = &Factory::newInstance('JobRunner', $argv[1]); 99 99 $jobRunner->run(); 100 100 ?> -
sandbox/workflow/branches/609/inc/class.JobScheduler.inc.php
r2292 r2311 11 11 12 12 require_once 'jobs/class.JobEnum.inc.php'; 13 require_once 'jobs/class.AbsoluteDate.inc.php';14 require_once 'jobs/class.WeekDate.inc.php';15 require_once 'jobs/class.RelativeDate.inc.php';16 13 17 14 /** … … 76 73 { 77 74 case DateType::ABSOLUTE_DATE: 78 $object = new AbsoluteDate($startDate, $interval);75 $object = &Factory::getInstance('AbsoluteDate', $startDate, $interval); 79 76 break; 80 77 81 78 case DateType::WEEK_DATE: 82 $object = new WeekDate($startDate, $interval);79 $object = &Factory::getInstance('WeekDate', $startDate, $interval); 83 80 $object->setWeekDays($record['week_days']); 84 81 break; 85 82 86 83 case DateType::RELATIVE_DATE: 87 $object = new RelativeDate($startDate, $interval);84 $object = &Factory::getInstance('RelativeDate', $startDate, $interval); 88 85 $object->setOffset($record['month_offset']); 89 86 break; -
sandbox/workflow/branches/609/inc/class.WorkflowMacro.inc.php
r2233 r2311 48 48 require_once PHPGW_API_INC . '/functions.inc.php'; 49 49 require_once 'engine/class.ajax_config.inc.php'; 50 require_once 'engine/class.ajax_ldap.inc.php';51 50 require_once 'engine/config.ajax.inc.php'; 52 $GLOBALS['ajax']->ldap = new ajax_ldap();51 $GLOBALS['ajax']->ldap = &Factory::getInstance('ajax_ldap'); 53 52 54 53 /* definição de algumas constantes */ … … 64 63 public function prepareProcessEnvironment($processID) 65 64 { 66 require_once GALAXIA_LIBRARY . '/src/common/WfRuntime.php';67 65 require_once PHPGW_SERVER_ROOT . '/workflow/inc/local/functions/local.functions.php'; 68 66 69 $runtime = new WfRuntime(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);67 $runtime = &Factory::getInstance('WfRuntime', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 70 68 $runtime->loadProcess($processID); 71 69 -
sandbox/workflow/branches/609/inc/class.bo_adminaccess.inc.php
r2233 r2311 11 11 12 12 require_once('class.bo_ajaxinterface.inc.php'); 13 require_once('class.so_adminaccess.inc.php');14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');15 13 require_once(PHPGW_API_INC . SEP . 'common_functions.inc.php'); 16 require_once(PHPGW_API_INC . SEP . 'class.acl.inc.php');17 14 18 15 /** … … 46 43 exit(serialize(array('error' => 'Você não tem permissão para executar esta operação.'))); 47 44 48 $this->so = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);45 $this->so = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 49 46 } 50 47 … … 57 54 function get_all_processes() 58 55 { 59 $proc_mng = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);56 $proc_mng = &Factory::newInstance('ProcessManager'); 60 57 $proc_list = $proc_mng->list_processes(0,-1,'wf_name__ASC'); 61 58 … … 315 312 { 316 313 $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 317 $acl = new ACL();314 $acl = &Factory::getInstance('acl'); 318 315 $output = $this->so->getUserNames($acl->get_ids_for_location('admin_workflow', 1, 'workflow')); 319 316 unset($GLOBALS['phpgw']->db); … … 332 329 $ids = explode('.', str_replace('g', '', str_replace('u', '', $params['user_ids']))); 333 330 $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 334 $acl = new ACL();331 $acl = &Factory::getInstance('acl'); 335 332 foreach ($ids as $id) 336 333 $acl->add_repository('workflow', 'admin_workflow', $id, 1); … … 350 347 { 351 348 $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 352 $acl = new ACL();349 $acl = &Factory::getInstance('acl'); 353 350 $acl->delete_repository('workflow', 'admin_workflow', (int) $params['admin_id']); 354 351 unset($GLOBALS['phpgw']->db); -
sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php
r2233 r2311 11 11 12 12 require_once 'class.bo_ajaxinterface.inc.php'; 13 require_once 'class.so_adminjobs.inc.php';14 13 require_once 'nano/JSON.php'; 15 14 … … 36 35 { 37 36 parent::bo_ajaxinterface(); 38 $this->so = new so_adminjobs();37 $this->so = &Factory::getInstance('so_adminjobs'); 39 38 } 40 39 -
sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php
r2233 r2311 12 12 require_once('class.bo_ajaxinterface.inc.php'); 13 13 14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'RoleManager.php');16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');17 14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Process.php'); 18 15 … … 103 100 { 104 101 105 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);102 $process_manager = &Factory::newInstance('ProcessManager'); 106 103 $proc_info = $process_manager->get_process($p['proc_id']); 107 104 … … 228 225 function get_php_files($p) 229 226 { 230 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);227 $process_manager = &Factory::newInstance('ProcessManager'); 231 228 $proc_info = $process_manager->get_process($p['proc_id']); 232 $activity_manager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);229 $activity_manager = &Factory::newInstance('ActivityManager'); 233 230 $process_activities = $activity_manager->list_activities($p['proc_id'], 0, -1, 'wf_name__asc', '','',false); 234 231 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'activities' . SEP; … … 293 290 if ((strpos($p['file_name'],'/') !== false) || (strpos($p['file_name'],'/') !== false)) 294 291 return 'Não foi possível executar a operação solicitada'; 295 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);292 $process_manager = &Factory::newInstance('ProcessManager'); 296 293 $proc_info = $process_manager->get_process($p['proc_id']); 297 294 $file_name = $p['file_name']; … … 351 348 function create_file($p) 352 349 { 353 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);350 $process_manager = &Factory::newInstance('ProcessManager'); 354 351 $proc_info = $process_manager->get_process($p['proc_id']); 355 352 $file_name = $p['file_name']; … … 432 429 function get_include_files($p) 433 430 { 434 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);431 $process_manager = &Factory::newInstance('ProcessManager'); 435 432 $proc_info = $process_manager->get_process($p['proc_id']); 436 433 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code'; … … 494 491 function get_template_files($p) 495 492 { 496 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);493 $process_manager = &Factory::newInstance('ProcessManager'); 497 494 $proc_info = $process_manager->get_process($p['proc_id']); 498 495 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'templates'; … … 555 552 function upload_resource($p) 556 553 { 557 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);554 $process_manager = &Factory::newInstance('ProcessManager'); 558 555 $proc_info = $process_manager->get_process($p['proc_id']); 559 556 $file_name = basename($_FILES['resource_file']['name']); … … 587 584 if (strpos($_REQUEST['file_name'],'/') !== false) 588 585 return 'Não foi possível executar a operação solicitada'; 589 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);586 $process_manager = &Factory::newInstance('ProcessManager'); 590 587 $proc_info = $process_manager->get_process($_REQUEST['proc_id']); 591 588 … … 630 627 function get_resource_files($p) 631 628 { 632 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);629 $process_manager = &Factory::newInstance('ProcessManager'); 633 630 $proc_info = $process_manager->get_process($p['proc_id']); 634 631 -
sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php
r2233 r2311 37 37 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'common.inc.php'); 38 38 require_once(PHPGW_API_INC . SEP . 'class.db.inc.php'); 39 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_ldap.inc.php');40 39 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_config.inc.php'); 41 40 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'config.ajax.inc.php'); 42 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'class.so_adminaccess.inc.php');43 41 44 42 /** … … 66 64 if (isset($_SESSION['phpgw_info']['workflow']['account_id'])) 67 65 { 68 $GLOBALS['ajax']->ldap = new ajax_ldap();66 $GLOBALS['ajax']->ldap = &Factory::getInstance('ajax_ldap'); 69 67 $GLOBALS['ajax']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 70 68 $GLOBALS['ajax']->db->Halt_On_Error = 'no'; … … 74 72 75 73 $GLOBALS['phpgw']->ADOdb = &$GLOBALS['ajax']->db->Link_ID; 76 $GLOBALS['ajax']->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);74 $GLOBALS['ajax']->acl = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 77 75 } 78 76 else -
sandbox/workflow/branches/609/inc/class.bo_editor.inc.php
r795 r2311 11 11 12 12 require_once('class.bo_ajaxinterface.inc.php'); 13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');14 13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 15 14 /** … … 234 233 if ($p['tipo_codigo'] != 'include') 235 234 { 236 $activity_manager = new ActivityManager($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);235 $activity_manager = &Factory::newInstance('ActivityManager'); 237 236 238 237 if ($this->check_process($p['proc_id'], &$activity_manager, &$error_str) == 'n') -
sandbox/workflow/branches/609/inc/class.bo_external_applications.inc.php
r795 r2311 11 11 \**************************************************************************/ 12 12 13 require_once('class.so_external_applications.inc.php');14 13 require_once('class.bo_ajaxinterface.inc.php'); 15 14 /** … … 34 33 { 35 34 parent::bo_ajaxinterface(); 36 $this->so = new so_external_applications();35 $this->so = &Factory::getInstance('so_external_applications'); 37 36 } 38 37 -
sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php
r2264 r2311 12 12 require_once('class.bo_ajaxinterface.inc.php'); 13 13 14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'); 15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 17 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'InstanceManager.php'); 18 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'RoleManager.php'); 19 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessMonitor' . SEP . 'ProcessMonitor.php'); 20 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Instance.php'); 21 require_once('class.workflow_acl.inc.php'); 14 require_once('class.workflow_acl.inc.php'); /* can we remove this? */ 22 15 require_once('class.bo_adminaccess.inc.php'); 23 16 require_once('class.powergraphic.inc.php'); … … 134 127 { 135 128 parent::bo_ajaxinterface(); 136 $GLOBALS['ajax']->gui = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);129 $GLOBALS['ajax']->gui = &Factory::newInstance('GUI'); 137 130 $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 138 131 $this->isWorkflowAdmin = $GLOBALS['ajax']->acl->checkWorkflowAdmin($this->userID); 139 $this->processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);140 $this->activityManager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);141 $this->instanceManager = new InstanceManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);142 $this->roleManager = new RoleManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);143 $this->processMonitor = new ProcessMonitor(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);132 $this->processManager = &Factory::newInstance('ProcessManager'); 133 $this->activityManager = &Factory::newInstance('ActivityManager'); 134 $this->instanceManager = &Factory::newInstance('InstanceManager'); 135 $this->roleManager = &Factory::newInstance('RoleManager'); 136 $this->processMonitor = &Factory::newInstance('ProcessMonitor'); 144 137 } 145 138 … … 169 162 private function convertFiltersToSQL($filters) 170 163 { 171 require_once 'nano/JSON.php';172 164 173 165 /* desserializa os dados */ 174 $JSON = new Services_JSON();166 $JSON = &Factory::newInstance('Services_JSON'); 175 167 /* desserializa a array principal, depois desserializa cada elemento desta array e, por fim, converte os elementos (que estão em forma de objeto) para array associativa */ 176 168 $filters = array_map('get_object_vars', array_map(array($JSON, 'decode'), $JSON->decode($filters))); … … 648 640 if ($params['ns'] == 'aborted') 649 641 { 650 $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);642 $realInstance = &Factory::newInstance('Instance'); 651 643 $realInstance->getInstance($params['iid']); 652 644 if (!empty($realInstance->instanceId)) … … 684 676 685 677 /* use next user or * for the new instance */ 686 $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);678 $realInstance = &Factory::newInstance('Instance'); 687 679 $realInstance->getInstance($params['iid'], false, false); 688 680 $user = $realInstance->getNextUser($params['aid']); … … 751 743 752 744 $maximumDisplaySize = 100; 753 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);745 $instance = &Factory::newInstance('Instance'); 754 746 $instance->getInstance($params['iid']); 755 747 … … 783 775 return "Você não tem permissão para executar este procedimento!"; 784 776 785 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);777 $instance = &Factory::newInstance('Instance'); 786 778 $instance->getInstance($params['iid']); 787 779 $output = $params; … … 804 796 $maximumDisplaySize = 100; 805 797 806 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);798 $instance = &Factory::newInstance('Instance'); 807 799 $instance->getInstance($params['iid']); 808 800 $instance->set($params['name'], $params['value']); … … 835 827 return "Você não tem permissão para executar este procedimento!"; 836 828 837 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);829 $instance = &Factory::newInstance('Instance'); 838 830 $instance->getInstance($params['iid']); 839 831 $instance->clear($params['name']); … … 858 850 $output = array(); 859 851 $urlPrefix = 'workflow/inc/class.powergraphic.inc.php?'; 860 $powergraphic = new powergraphic;852 $powergraphic = &Factory::getInstance('powergraphic'); 861 853 $powergraphic->graphic_1 = $params['pid']; 862 854 $powergraphic->skin = 1; -
sandbox/workflow/branches/609/inc/class.bo_move_instances.inc.php
r795 r2311 12 12 13 13 require_once('class.bo_ajaxinterface.inc.php'); 14 require_once('class.so_move_instances.inc.php');15 require_once('nano/JSON.php');16 14 17 15 … … 39 37 { 40 38 parent::bo_ajaxinterface(); 41 $this->so = new so_move_instances();39 $this->so = &Factory::getInstance('so_move_instances'); 42 40 } 43 41 … … 79 77 function moveInstances($params) 80 78 { 81 $JSON = new Services_JSON();79 $JSON = &Factory::newInstance('Services_JSON'); 82 80 83 81 /* convert the mappgin element to array */ -
sandbox/workflow/branches/609/inc/class.bo_orgchart.inc.php
r2042 r2311 10 10 \**************************************************************************/ 11 11 12 require_once('class.so_orgchart.inc.php');13 12 require_once('class.bo_ajaxinterface.inc.php'); 14 13 /** … … 47 46 { 48 47 parent::bo_ajaxinterface(); 49 $this->so = new so_orgchart();48 $this->so = &Factory:::getInstance('so_orgchart'); 50 49 } 51 50 -
sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php
r2292 r2311 10 10 \**************************************************************************/ 11 11 12 require_once('class.so_userinterface.inc.php');13 12 require_once('class.bo_ajaxinterface.inc.php'); 14 13 15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php');16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');17 14 /** 18 15 * @package Workflow … … 43 40 { 44 41 parent::bo_ajaxinterface(); 45 $this->so = new so_userinterface();46 $GLOBALS['ajax']->gui = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);42 $this->so = &Factory::getInstance('so_userinterface'); 43 $GLOBALS['ajax']->gui = &Factory::newInstance('GUI'); 47 44 } 48 45 … … 120 117 $result = array(); 121 118 122 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);119 $process = &Factory::newInstance('Process'); 123 120 $process->getProcess($pid); 124 121 $result['wf_procname'] = $process->name; … … 126 123 $result['wf_description'] = $process->description; 127 124 128 $activ_manager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);125 $activ_manager = &Factory::newInstance('ActivityManager'); 129 126 $result['wf_activities'] = $activ_manager->get_process_activities($pid); 130 127 … … 494 491 } 495 492 496 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);493 $instance = &Factory::newInstance('Instance'); 497 494 $instance->getInstance($instanceID); 498 495 499 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);496 $process = &Factory::newInstance('Process'); 500 497 $process->getProcess($instance->pId); 501 498 -
sandbox/workflow/branches/609/inc/class.bo_utils.inc.php
r2233 r2311 88 88 $ret_name = empty($params['name']) ? 'cn' : $params['name']; 89 89 90 $ajaxConfig = new ajax_config('contactcenter');90 $ajaxConfig = &Factory::getInstance('ajax_config', 'contactcenter'); 91 91 $config = $ajaxConfig->read_repository(); 92 92 -
sandbox/workflow/branches/609/inc/class.external_bridge.inc.php
r2233 r2311 13 13 require_once 'common.inc.php'; 14 14 require_once 'engine/config.egw.inc.php'; 15 require_once 'class.so_adminaccess.inc.php';16 15 17 16 /** … … 53 52 { 54 53 $this->db = Factory::getInstance('WorkflowObjects')->getDBGalaxia(); 55 $this->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);54 $this->acl = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 56 55 } 57 56 /** -
sandbox/workflow/branches/609/inc/class.powergraphic.inc.php
r795 r2311 141 141 142 142 143 $PowerGraphic = new powergraphic;143 $PowerGraphic = &Factory::newInstance('powergraphic'); 144 144 145 145 $PowerGraphic->start(); -
sandbox/workflow/branches/609/inc/class.run_activity.inc.php
r2264 r2311 14 14 require_once(dirname(__FILE__) . SEP . 'class.basecontroller.inc.php' ); /* module controller */ 15 15 require_once(dirname(__FILE__) . SEP . 'class.basemodel.inc.php' ); /* module logic */ 16 require_once(dirname(__FILE__) . SEP . 'class.utils.security.php' ); /* sanitizes input data */17 16 18 17 /** … … 438 437 $env['instance'] =& $instance; //process manager instance 439 438 $env['activity'] =& $activity; //activity manager instance 440 $security =& new SecurityUtils(); //input sanitizer class439 $security =& Factory::newInstance('SecurityUtils'); //input sanitizer class 441 440 $env['request'] =& $security->process($_REQUEST); //sanitizes input data from client 442 441 //$env['factory'] =& new ProcessFactory(); //instantiation controller class … … 710 709 $env['instance'] =& $instance; //process manager instance 711 710 $env['activity'] =& $activity; //activity manager instance 712 $security =& new SecurityUtils();//input sanitizer class711 $security =& Factory::newInstance('SecurityUtils'); //input sanitizer class 713 712 $env['request'] =& $security->process($_REQUEST); //sanitizes input data from client 714 713 //$env['factory'] =& new ProcessFactory(); //instantiation controller class … … 738 737 739 738 $GLOBALS['workflow_env'] = &$env; 740 $nc = new NanoController();739 $nc = &Factory::newInstance('NanoController'); 741 740 $nc->setClassPath(GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'); 742 741 $nc->iterateOverVirtualRequests(); -
sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php
r2233 r2311 11 11 12 12 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'; 13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'JobManager.php';14 13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'; 15 14 … … 97 96 $this->acl = &$GLOBALS['ajax']->acl; 98 97 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 99 $this->jobManager = new JobManager(&$this->db);98 $this->jobManager = &Factory::newInstance('JobManager'); 100 99 } 101 100 -
sandbox/workflow/branches/609/inc/class.so_move_instances.inc.php
r2233 r2311 11 11 \**************************************************************************/ 12 12 13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');15 13 16 14 /** … … 113 111 $where[] = 'wf_p_id IS NULL'; 114 112 } 115 $processManager = new ProcessManager($this->db);113 $processManager = &Factory::getInstance('ProcessManager', $this->db); 116 114 117 115 /* workaround to sort the result using two columns */ … … 137 135 $this->_checkAccess($processID); 138 136 139 $activityManager = new ActivityManager($this->db);137 $activityManager = &Factory::newInstance('ActivityManager'); 140 138 $activities = $activityManager->list_activities($processID, 0, -1, 'wf_name__ASC', '', 'wf_type <> \'standalone\' AND wf_type <> \'view\''); 141 139 $output = array(); -
sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php
r2233 r2311 1 1 <?php 2 require_once($_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] . '/class.config.inc.php');3 2 4 3 /** … … 61 60 $oldDB = $GLOBALS['phpgw']->db; 62 61 $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 63 $config = new config('workflow');62 $config = &Factory::getInstance('config', 'workflow'); 64 63 $configValues = $config->read_repository(); 65 64 $submasksString = $configValues['intranet_subnetworks']; … … 596 595 require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 597 596 598 $SOOrgchart = new so_orgchart();597 $SOOrgchart = &Factory::getInstance('so_orgchart'); 599 598 $SOOrgchart->setExternalCalls(true); 600 599 $output = $SOOrgchart->getEmployeeInfo($employeeID, $organizationID); … … 616 615 require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 617 616 618 $SOOrgchart = new so_orgchart();617 $SOOrgchart = &Factory::getInstance('so_orgchart'); 619 618 $SOOrgchart->setExternalCalls(true); 620 619 $output = $SOOrgchart->getAreaInfo($areaID, $organizationID); -
sandbox/workflow/branches/609/inc/class.ui_adminactivities.inc.php
r2253 r2311 2 2 3 3 require_once dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php'; 4 require_once dirname(__FILE__) . SEP . 'class.fsutils.inc.php'; /* toolkit for filesystem handling */5 4 require_once 'engine' . SEP . 'config.egw.inc.php'; 6 5 /** … … 109 108 $this->activity_manager = Factory::getInstance('workflow_activitymanager'); 110 109 $this->role_manager = Factory::getInstance('workflow_rolemanager'); 111 $this->fs = new FsUtils(); /* gets instance */110 $this->fs = &Factory::newInstance('FsUtils'); /* gets instance */ 112 111 113 112 } -
sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php
r2264 r2311 103 103 else 104 104 die(); 105 106 require_once(dirname(__FILE__) . SEP . 'engine' . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'GraphViz.php');107 105 108 106 $config_values = Factory::getInstance('config', 'workflow'); … … 122 120 $attributes['ranksep'] = '1.5 equally'; 123 121 $attributes['rankdir'] = 'LR'; 124 $graph = new Process_GraphViz(true, $attributes);122 $graph = &Factory::getInstance('Process_GraphViz', true, $attributes); 125 123 126 124 -
sandbox/workflow/branches/609/inc/class.ui_phpeditor.inc.php
r2253 r2311 11 11 12 12 require_once dirname(__FILE__) . SEP . 'engine' . SEP . 'config.ajax.inc.php'; 13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php';14 13 require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'; 15 14 /** … … 63 62 { 64 63 $smarty = Factory::getInstance('workflow_smarty', false); 65 $processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);64 $processManager = &Factory::newInstance('ProcessManager'); 66 65 $proccessInfo = $processManager->get_process($_GET['proc_id']); 67 66 -
sandbox/workflow/branches/609/inc/class.ui_userinterface.inc.php
r2253 r2311 129 129 130 130 /* create some objects */ 131 require_once 'class.so_userinterface.inc.php'; 132 $so = new so_userinterface(); 133 $smarty = Factory::getInstance('workflow_smarty'); 131 $so = &Factory::getInstance('so_userinterface'); 132 $smarty = &Factory::getInstance('workflow_smarty'); 134 133 135 134 /* get the user's organization */ -
sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php
r2253 r2311 34 34 function workflow_processmanager() 35 35 { 36 parent::ProcessManager( Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID);36 parent::ProcessManager(); 37 37 $this->workflow_acl = Factory::getInstace('workflow_acl'); 38 38 … … 62 62 function import_process(&$data) 63 63 { 64 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);64 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 65 65 66 66 if (parent::import_process($data)) … … 121 121 function serialize_process($pId) 122 122 { 123 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);123 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 124 124 if (!isset($this->jobManager)) 125 $this->jobManager = new JobManager($this->db);125 $this->jobManager = &Factory::newInstance('JobManager'); 126 126 127 127 //if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db); -
sandbox/workflow/branches/609/inc/engine/config.ajax.inc.php
r2233 r2311 256 256 function galaxia_get_config_values($parameters=array()) 257 257 { 258 $config = new ajax_config();258 $config = &Factory::getInstance('ajax_config'); 259 259 $config->read_repository(); 260 260 -
sandbox/workflow/branches/609/inc/engine/src/API/BaseActivity.php
r795 r2311 97 97 * @access public 98 98 */ 99 function BaseActivity( &$db)99 function BaseActivity() 100 100 { 101 101 $this->type='base'; 102 102 $this->child_name = 'BaseActivity'; 103 parent::Base( $db);103 parent::Base(); 104 104 } 105 105 … … 122 122 if(!$result || !$result->numRows() ) return false; 123 123 $res = $result->fetchRow(); 124 124 125 switch($res['wf_type']) { 125 126 case 'start': 126 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Start.php');127 $act = new Start($this->db);128 break; 127 $act = &Factory::newInstance('Start'); 128 break; 129 129 130 case 'end': 130 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'End.php');131 $act = new End($this->db);132 break; 131 $act = &Factory::newInstance('End'); 132 break; 133 133 134 case 'join': 134 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Join.php');135 $act = new Join($this->db);136 break; 135 $act = &Factory::newInstance('Join'); 136 break; 137 137 138 case 'split': 138 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Split.php');139 $act = new Split($this->db);140 break; 139 $act = &Factory::newInstance('Split'); 140 break; 141 141 142 case 'standalone': 142 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Standalone.php');143 $act = new Standalone($this->db);144 break; 143 $act = &Factory::newInstance('Standalone'); 144 break; 145 145 146 case 'view': 146 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'View.php');147 $act = new View($this->db);148 break; 147 $act = &Factory::newInstance('View'); 148 break; 149 149 150 case 'switch': 150 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'SwitchActivity.php');151 $act = new SwitchActivity($this->db);152 break; 151 $act = &Factory::newInstance('SwitchActivity'); 152 break; 153 153 154 case 'activity': 154 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Activity.php');155 $act = new Activity($this->db);156 break; 155 $act = &Factory::newInstance('Activity'); 156 break; 157 157 158 default: 158 159 trigger_error('Unknown activity type:'.$res['wf_type'],E_USER_WARNING); 159 160 } 160 161 161 162 $act->setName($res['wf_name']); 162 163 $act->setProcessId($res['wf_p_id']); -
sandbox/workflow/branches/609/inc/engine/src/API/Instance.php
r795 r2311 1 1 <?php 2 2 require_once (GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'Base.php'); 3 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'common' . SEP . 'WfSecurity.php');4 3 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 5 4 … … 141 140 142 141 var $activityID = null; 143 function Instance( $db)142 function Instance() 144 143 { 145 144 $this->child_name = 'Instance'; 146 parent::Base( $db);145 parent::Base(); 147 146 } 148 147 … … 1171 1170 1172 1171 //lock rows and ensure access is granted 1173 if (!(isset($this->security))) $this->security = & new WfSecurity($this->db);1172 if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity', $this->db); 1174 1173 if (!($this->security->checkUserAction($activityId,$this->instanceId,'complete'))) 1175 1174 { … … 1551 1550 { 1552 1551 //we check rights for this user on the next activity 1553 if (!(isset($this->security))) $this->security = & new WfSecurity($this->db);1552 if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); 1554 1553 if ($this->security->checkUserAccess($the_next_user,$activityId)) 1555 1554 { … … 1560 1559 { 1561 1560 // then check to see if there is a default user 1562 $activity_manager = & new ActivityManager($this->db);1561 $activity_manager = &Factory::newInstance('ActivityManager'); 1563 1562 //get_default_user will give us '*' if there is no default_user or if the default user has no role 1564 1563 //mapped anymore -
sandbox/workflow/branches/609/inc/engine/src/API/Process.php
r795 r2311 48 48 * @access public 49 49 */ 50 function Process( &$db)50 function Process() 51 51 { 52 52 $this->child_name = 'Process'; 53 parent::Base( $db);53 parent::Base(); 54 54 } 55 55 -
sandbox/workflow/branches/609/inc/engine/src/API/activities/Activity.php
r795 r2311 16 16 * @access public 17 17 */ 18 function Activity( &$db)18 function Activity() 19 19 { 20 parent::Base( $db);20 parent::Base(); 21 21 $this->child_name = 'Activity'; 22 22 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/End.php
r795 r2311 15 15 * @access public 16 16 */ 17 function End( &$db)17 function End() 18 18 { 19 parent::Base( $db);19 parent::Base(); 20 20 $this->child_name = 'End'; 21 21 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/Join.php
r795 r2311 15 15 * @access public 16 16 */ 17 function Join( &$db)17 function Join() 18 18 { 19 parent::Base( $db);19 parent::Base(); 20 20 $this->child_name = 'Join'; 21 21 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/Split.php
r795 r2311 15 15 * @access public 16 16 */ 17 function Split( &$db)17 function Split() 18 18 { 19 parent::Base( $db);19 parent::Base(); 20 20 $this->child_name = 'Split'; 21 21 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/Standalone.php
r795 r2311 15 15 * @access public 16 16 */ 17 function Standalone( &$db)17 function Standalone() 18 18 { 19 parent::Base( $db);19 parent::Base(); 20 20 $this->child_name = 'Standalone'; 21 21 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/Start.php
r795 r2311 15 15 * @access public 16 16 */ 17 function Start( &$db)17 function Start() 18 18 { 19 parent::Base( $db);19 parent::Base(); 20 20 $this->child_name = 'Start'; 21 21 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/SwitchActivity.php
r795 r2311 16 16 * @access public 17 17 */ 18 function SwitchActivity( &$db)18 function SwitchActivity() 19 19 { 20 parent::Base( $db);20 parent::Base(); 21 21 $this->child_name = 'Switch'; 22 22 } -
sandbox/workflow/branches/609/inc/engine/src/API/activities/View.php
r795 r2311 16 16 * @access public 17 17 */ 18 function View( &$db)18 function View() 19 19 { 20 parent::Base( $db);20 parent::Base(); 21 21 $this->child_name = 'View'; 22 22 } -
sandbox/workflow/branches/609/inc/engine/src/GUI/GUI.php
r795 r2311 32 32 * @access public 33 33 */ 34 function GUI( &$db)34 function GUI() 35 35 { 36 36 $this->child_name = 'GUI'; 37 parent::Base($db); 38 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'WfSecurity.php'); 39 $this->wf_security =& new WfSecurity($this->db); 37 parent::Base(); 38 $this->wf_security = &Factory::getInstance('WfSecurity'); 40 39 } 41 40 … … 703 702 if (!(isset($this->pm))) 704 703 { 705 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ProcessManager.php'); 706 $this->pm =& new ProcessManager($this->db); 704 $this->pm = &Factory::newInstance('ProcessManager'); 707 705 } 708 706 $this->process_cache[$pId]['view'] = $this->pm->get_process_view_activity($pId); … … 871 869 { 872 870 //the security object said everything was fine 873 $instance = new Instance($this->db);871 $instance = &Factory::newInstance('Instance'); 874 872 $instance->getInstance($instanceId); 875 873 if (!empty($instance->instanceId)) … … 975 973 { 976 974 //the security object said everything was fine 977 $instance = & new Instance($this->db);975 $instance = &Factory::newInstance('Instance'); 978 976 $instance->getInstance($instanceId); 979 977 // we force the execution of the activity … … 1012 1010 { 1013 1011 //the security object said everything was fine 1014 $instance = & new Instance($this->db);1012 $instance = &Factory::newInstance('Instance'); 1015 1013 $instance->getInstance($instanceId); 1016 1014 // we force the continuation of the flow -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ActivityManager.php
r795 r2311 26 26 * @access public 27 27 */ 28 function ActivityManager( &$db)29 { 30 parent::BaseManager( $db);28 function ActivityManager() 29 { 30 parent::BaseManager(); 31 31 $this->child_name = 'ActivityManager'; 32 32 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager' .SEP . 'ProcessManager.php'); … … 370 370 function build_process_graph($pId) 371 371 { 372 if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db);372 if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 373 373 $attributes = Array( 374 374 375 375 ); 376 $graph = new Process_GraphViz(true,$attributes);376 $graph = &Factory::newInstance('Process_GraphViz', true, $attributes); 377 377 $name = $this->process_manager->_get_normalized_name($pId); 378 378 $graph->set_pid($name); … … 747 747 { 748 748 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP . 'BaseActivity.php'); 749 $act = new BaseActivity($this->db);749 $act = &Factory::newInstance('BaseActivity'); 750 750 //Warning, we now use the BaseActivity object for it, interactivity and autorouting is now true/fales, not y/n 751 751 return ($act->getActivity($activityId,false,true, true)); … … 825 825 function remove_activity($pId, $activityId, $transaction = true) 826 826 { 827 if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db);827 if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 828 828 $proc_info = $this->process_manager->get_process($pId); 829 829 $actname = $this->_get_normalized_name($activityId); … … 888 888 function replace_activity($pId, $activityId, $vars, $create_files=true) 889 889 { 890 if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db);890 if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 891 891 $TABLE_NAME = GALAXIA_TABLE_PREFIX.'activities'; 892 892 $now = date("U"); … … 1195 1195 elseif ( (!($result=='*')) && $performAccessCheck) 1196 1196 { 1197 $wf_security = new WfSecurity($this->db);1197 $wf_security = &Factory::getInstance('WfSecurity', $this->db); 1198 1198 // perform the check 1199 1199 if (!($wf_security->checkUserAccess($result,$activityId))) -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/BaseManager.php
r2165 r2311 18 18 * @access public 19 19 */ 20 function BaseManager( &$db)20 function BaseManager() 21 21 { 22 22 $this->child_name = 'BaseManager'; 23 parent::Base( $db);23 parent::Base(); 24 24 } 25 25 -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/InstanceManager.php
r795 r2311 16 16 * @access public 17 17 */ 18 function InstanceManager( &$db)19 { 20 parent::BaseManager( $db);18 function InstanceManager() 19 { 20 parent::BaseManager(); 21 21 $this->child_name = 'InstanceManager'; 22 22 } -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/JobManager.php
r795 r2311 76 76 * @access public 77 77 */ 78 public function JobManager( &$db)79 { 80 parent::BaseManager( $db);78 public function JobManager() 79 { 80 parent::BaseManager(); 81 81 $this->child_name = 'JobManager'; 82 82 83 83 $this->jobTable = GALAXIA_TABLE_PREFIX . 'jobs'; 84 84 $this->logTable = GALAXIA_TABLE_PREFIX . 'job_logs'; 85 $this->processManager = new ProcessManager($this->db);85 $this->processManager = &Factory::newInstance('ProcessManager'); 86 86 } 87 87 -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php
r2165 r2311 66 66 * @access public 67 67 */ 68 function ProcessManager( &$db)69 { 70 parent::BaseManager( $db);68 function ProcessManager() 69 { 70 parent::BaseManager(); 71 71 $this->child_name = 'ProcessManager'; 72 72 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ActivityManager.php'); … … 131 131 function serialize_process($pId) 132 132 { 133 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);133 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 134 134 // <process> 135 135 $out = '<process>'."\n"; … … 459 459 { 460 460 //Now the show begins 461 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);462 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db);461 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 462 if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 463 463 if (!isset($this->jobManager)) 464 $this->jobManager = new JobManager($this->db);464 $this->jobManager = &Factory::newInstance('JobManager'); 465 465 466 466 // First create the process. Always inactive and inactive first. … … 620 620 function new_process_version($pId, $minor=true) 621 621 { 622 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);622 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 623 623 $oldpid = $pId; 624 624 //retrieve process info with config rows … … 671 671 } 672 672 // create roles 673 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db);673 if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 674 674 $query = 'select * from '.GALAXIA_TABLE_PREFIX.'roles where wf_p_id=?'; 675 675 $result = $this->query($query, array($oldpid)); … … 853 853 function remove_process($pId) 854 854 { 855 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);855 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 856 856 if (!isset($this->jobManager)) 857 $this->jobManager = new JobManager($this->db);857 $this->jobManager = &Factory::newInstance('JobManager'); 858 858 $this->deactivate_process($pId); 859 859 $name = $this->_get_normalized_name($pId); … … 919 919 function replace_process($pId, &$vars, $create = true) 920 920 { 921 if (!(isset($this->activity_manager))) $this->activity_manager = new ActivityManager($this->db);921 if (!(isset($this->activity_manager))) $this->activity_manager = &Factory::newInstance('ActivityManager'); 922 922 $TABLE_NAME = GALAXIA_TABLE_PREFIX.'processes'; 923 923 $now = date("U"); … … 1296 1296 { 1297 1297 //Warning: this means you have to include the Process.php from the API 1298 $this->Process = new Process($this->db);1298 $this->Process = &Factory::newInstance('Process'); 1299 1299 $this->Process->getProcess($pId); 1300 1300 $result_array = $this->Process->getConfigValues($config_array); … … 1316 1316 { 1317 1317 //Warning: this means you have to include the Process.php from the API 1318 $this->Process = new Process($this->db);1318 $this->Process = &Factory::newInstance('Process'); 1319 1319 $this->Process->getProcess($pId); 1320 1320 $this->Process->setConfigValues($config_array); -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/RoleManager.php
r2233 r2311 19 19 * @access public 20 20 */ 21 function RoleManager( &$db)22 { 23 parent::Base( $db);21 function RoleManager() 22 { 23 parent::Base(); 24 24 $this->child_name = 'RoleManager'; 25 25 } -
sandbox/workflow/branches/609/inc/engine/src/ProcessMonitor/ProcessMonitor.php
r795 r2311 18 18 * @access public 19 19 */ 20 function ProcessMonitor( &$db)20 function ProcessMonitor() 21 21 { 22 22 $this->child_name = 'ProcessMonitor'; 23 parent::Base( $db);23 parent::Base(); 24 24 // check the the actual user can really do this 25 25 if ( !(galaxia_user_can_monitor())) -
sandbox/workflow/branches/609/inc/engine/src/common/Base.php
r2165 r2311 39 39 var $child_name = 'Base'; 40 40 41 /** 42 * @var object $db_shared_obj The database abstraction object shared between 43 * all instances of this class. 44 * @acess private 45 * @static 46 */ 47 private static $db_shared_obj = null; 48 41 49 /** 42 50 * Constructor receiving a database abstraction object … … 46 54 * @access public 47 55 */ 48 function Base( &$db)56 function Base() 49 57 { 50 if(!$db) { 58 /** 59 * New Stuff! 60 * We decided to get here the database object. In a recent past, 61 * all the classes that specialize this one passed a db object. 62 * Now, to simplify and save memory, we store the database object 63 * into a single and static atribute shared among each instance 64 * of this class. 65 * 66 * To prevent to modify all sub-classes to use "self::$db" instead 67 * of "this->db", we made a very tiny workaround here. In the first 68 * instantiation of this class, we instantiate the database object 69 * and store it into 'self::$db_shared_obj'. Any subsequent 70 * instantiations will just point to the static one. 71 */ 72 if (!self::$db_shared_obj) 73 self::$db_shared_obj = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 74 75 $this->db = &self::$db_shared_obj; 76 77 78 if(!$this->db) { 51 79 die('Invalid db object passed to '.$this->child_name.' constructor'); 52 80 } 53 81 //Force transactionnal mysql (Innodb) -> mysqlt 54 if ($ db->databaseType=='mysql')82 if ($this->db->databaseType=='mysql') 55 83 { 56 84 $GLOBALS['phpgw']->db->disconnect(); 57 $ db = $GLOBALS['phpgw']->db->connect(85 $this->db = $GLOBALS['phpgw']->db->connect( 58 86 $GLOBALS['phpgw_info']['server']['db_name'], 59 87 $GLOBALS['phpgw_info']['server']['db_host'], … … 64 92 ); 65 93 } 66 $this->db = &$db;67 94 } 68 95 -
sandbox/workflow/branches/609/inc/engine/src/common/WfRuntime.php
r2253 r2311 86 86 * @access public 87 87 */ 88 function WfRuntime( &$db)88 function WfRuntime() 89 89 { 90 90 $this->child_name = 'WfRuntime'; 91 parent::Base($db); 92 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 93 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 94 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 95 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'WfSecurity.php'); 96 91 parent::Base(); 92 97 93 //first the activity is not set 98 94 $this->activity = null; 99 $this->instance = new Instance($this->db);100 $this->process = new Process($this->db);101 $this->security = new WfSecurity($this->db);95 $this->instance = &Factory::newInstance('Instance'); 96 $this->process = &Factory::newInstance('Process'); 97 $this->security = &Factory::getInstance('WfSecurity'); 102 98 } 103 99 … … 276 272 return false; 277 273 } 278 $base_activity = new BaseActivity($this->db);274 $base_activity = &Factory::getInstance('BaseActivity', $this->db); 279 275 $this->activity =& $base_activity->getActivity($activity_id, $with_roles, $with_agents); 280 276 if (!$this->activity) -
sandbox/workflow/branches/609/inc/engine/src/common/WfSecurity.php
r795 r2311 23 23 * @access public 24 24 */ 25 function WfSecurity( &$db)25 function WfSecurity() 26 26 { 27 27 $this->child_name = 'WfSecurity'; 28 parent::Base($db); 29 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 30 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 31 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 28 parent::Base(); 29 30 /* I'm not really sure if we can strip it out. */ 31 32 //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 33 //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 34 //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 32 35 } 33 36 … … 58 61 ); 59 62 //check theses values for this process and store the result for this object life duration 60 $myProcess = new Process($this->db);63 $myProcess = &Factory::newInstance('Process'); 61 64 $myProcess->getProcess($pId); 62 65 $this->processesConfig[$pId] = $myProcess->getConfigValues($arrayConf); … … 577 580 if (!(isset($this->pm))) 578 581 { 579 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ProcessManager.php'); 580 $this->pm = new ProcessManager($this->db); 582 $this->pm = &Factory::newInstance('ProcessManager'); 581 583 } 582 584 //$this->error[] = 'DEBUG: checking to see if there is no view activities on process :'.$pId.':'.$this->pm->get_process_view_activity($pId); -
sandbox/workflow/branches/609/inc/local/classes/class.wf_engine.php
r2292 r2311 191 191 function getChildInstances($instanceID = null, $activityID = null) 192 192 { 193 $WFInstance = Factory::getInstance('wf_instance');193 $WFInstance = &Factory::getInstance('wf_instance'); 194 194 $preOutput = $WFInstance->getChildren($instanceID, $activityID); 195 195 $output = array(); -
sandbox/workflow/branches/609/inc/local/classes/class.wf_instance.php
r2292 r2311 423 423 424 424 /* load the required instance (for the required user) */ 425 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'; 426 $GUI = new GUI($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 425 $GUI = &Factory::newInstance('GUI'); 427 426 $userInstance = $GUI->gui_list_user_instances($userID, 0, -1, '', '', "(ga.wf_is_interactive = 'y') AND (gia.wf_activity_id = {$activityID}) AND (gia.wf_instance_id = {$instanceID})", false, $this->processID, true, false, true, false, false, false); 428 427 $userInstance = $userInstance['data']; -
sandbox/workflow/branches/609/inc/local/classes/class.wf_ldap.php
r2249 r2311 1 1 <?php 2 require_once PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'local' . SEP . 'classes' . SEP . 'class.wf_cached_ldap.php';3 2 4 3 /** … … 47 46 $this->ds = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 48 47 49 $this->cachedLDAP = new wf_cached_ldap();48 $this->cachedLDAP = &Factory::getInstance('wf_cached_ldap'); 50 49 $this->cachedLDAP->setOperationMode($this->cachedLDAP->OPERATION_MODE_LDAP); 51 50 } -
sandbox/workflow/branches/609/inc/nano/NanoController.class.php
r795 r2311 59 59 function __construct() 60 60 { 61 $this->_mObjJsonConverter = new NanoJsonConverter();62 $this->_mObjJson = new Services_JSON();61 $this->_mObjJsonConverter = &Factory::newInstance('NanoJsonConverter'); 62 $this->_mObjJson = &Factory::newInstance('Services_JSON'); 63 63 } 64 64 … … 130 130 public function iterateOverVirtualRequests() 131 131 { 132 $this->_mObjNanoRequest = new NanoRequest($this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix );132 $this->_mObjNanoRequest = &Factory::newInstance('NanoRequest', $this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix ); 133 133 $return_data = array(); 134 134 -
sandbox/workflow/branches/609/inc/nano/NanoGuardian.class.php
r795 r2311 32 32 public function __construct() 33 33 { 34 $this->_mObjNanoSanitizer = new NanoSanitizer(new DummyLogger);34 $this->_mObjNanoSanitizer = &Factory::newInstance('NanoSanitizer', new DummyLogger); 35 35 } 36 36 -
sandbox/workflow/branches/609/inc/nano/NanoJsonConverter.class.php
r795 r2311 118 118 // initialize JSON object 119 119 $this->_mObjJson = ( strtolower($return_type) != 'object' ) 120 ? new Services_JSON(SERVICES_JSON_LOOSE_TYPE )121 : new Services_JSON();120 ? Factory::getInstance('Services_JSON', SERVICES_JSON_LOOSE_TYPE ) 121 : Factory::getInstance('Services_JSON'); 122 122 } 123 123 -
sandbox/workflow/branches/609/index.php
r2193 r2311 22 22 require_once dirname(__FILE__) . '/inc/nano/NanoJsonConverter.class.php'; 23 23 require_once dirname(__FILE__) . '/inc/nano/NanoController.class.php'; 24 $nanoController = new NanoController();24 $nanoController = &Factory::newInstance('NanoController'); 25 25 $nanoController->throwErrorOnAllVirtualRequests('__NANOAJAX_SESSION_EXPIRED__'); 26 26 exit; -
sandbox/workflow/branches/609/lib/factory/ProcessFactory.php
r2249 r2311 50 50 $this->registerFileInfo('wf_orgchart', 'class.wf_orgchart.php', 'inc/local/classes'); 51 51 $this->registerFileInfo('wf_ldap', 'class.wf_ldap.php', 'inc/local/classes'); 52 $this->registerFileInfo('wf_cached_ldap', 'class.wf_cached_ldap.php', 'inc/local/classes'); 52 53 $this->registerFileInfo('wf_engine', 'class.wf_engine.php', 'inc/local/classes'); 53 54 $this->registerFileInfo('wf_role', 'class.wf_role.php', 'inc/local/classes'); -
sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php
r2291 r2311 54 54 $this->registerFileInfo('WorkflowMacro', 'class.WorkflowMacro.inc.php', 'inc'); 55 55 $this->registerFileInfo('WorkflowJobManager', 'class.WorkflowJobManager.inc.php', 'inc'); 56 $this->registerFileInfo('SecurityUtils', 'class.utils.security.php', 'inc'); 56 57 $this->registerFileInfo('ResourcesRedirector', 'class.ResourcesRedirector.inc.php', 'inc'); 57 58 $this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc'); … … 59 60 $this->registerFileInfo('BrowserInfo', 'class.BrowserInfo.inc.php', 'inc'); 60 61 $this->registerFileInfo('JobScheduler', 'class.JobScheduler.inc.php', 'inc'); 62 $this->registerFileInfo('JobRunner', 'class.JobRunner.inc.php', 'inc'); 61 63 $this->registerFileInfo('Thread', 'class.Thread.inc.php', 'inc'); 62 64 $this->registerFileInfo('Paging', 'class.Paging.inc.php', 'inc'); 65 $this->registerFileInfo('FsUtils', 'class.fsutils.inc.php', 'inc'); 63 66 $this->registerFileInfo('UserPictureProvider', 'class.UserPictureProvider.inc.php', 'inc'); 67 $this->registerFileInfo('powergraphic', 'class.powergraphic.inc.php', 'inc'); 64 68 65 69 $this->registerFileInfo('run_activity', 'class.run_activity.inc.php', 'inc'); … … 82 86 83 87 $this->registerFileInfo('so_agent_mail_smtp', 'class.so_agent_mail_smtp.inc.php', 'inc'); 88 $this->registerFileInfo('so_external_applications', 'class.so_external_applications.inc.php', 'inc'); 89 $this->registerFileInfo('so_adminaccess', 'class.so_adminaccess.inc.php', 'inc'); 90 $this->registerFileInfo('so_orgchart', 'class.so_orgchart.inc.php', 'inc'); 91 $this->registerFileInfo('so_userinterface', 'class.so_userinterface.inc.php', 'inc'); 92 $this->registerFileInfo('so_adminjobs', 'class.so_adminjobs.inc.php', 'inc'); 93 $this->registerFileInfo('so_move_instances', 'class.so_move_instances.inc.php', 'inc'); 94 95 /* job classes */ 96 $this->registerFileInfo('AbsoluteDate', 'class.AbsoluteDate.inc.php', 'inc/jobs'); 97 $this->registerFileInfo('RelativeDate', 'class.RelativeDate.inc.php', 'inc/jobs'); 98 $this->registerFileInfo('WeekDate', 'class.WeekDate.inc.php', 'inc/jobs'); 99 100 /* galaxia engine classes */ 101 $this->registerFileInfo('GUI', 'GUI.php', 'inc/engine/src/GUI'); 102 $this->registerFileInfo('ProcessManager', 'ProcessManager.php', 'inc/engine/src/ProcessManager'); 103 $this->registerFileInfo('ActivityManager', 'ActivityManager.php', 'inc/engine/src/ProcessManager'); 104 $this->registerFileInfo('InstanceManager', 'InstanceManager.php', 'inc/engine/src/ProcessManager'); 105 $this->registerFileInfo('RoleManager', 'RoleManager.php', 'inc/engine/src/ProcessManager'); 106 $this->registerFileInfo('JobManager', 'JobManager.php', 'inc/engine/src/ProcessManager'); 107 $this->registerFileInfo('Process_GraphViz', 'GraphViz.php', 'inc/engine/src/ProcessManager'); 108 $this->registerFileInfo('ProcessMonitor', 'ProcessMonitor.php', 'inc/engine/src/ProcessMonitor'); 109 $this->registerFileInfo('Process', 'Process.php', 'inc/engine/src/API'); 110 $this->registerFileInfo('Instance', 'Instance.php', 'inc/engine/src/API'); 111 $this->registerFileInfo('Start', 'Start.php', 'inc/engine/src/API/activities'); 112 $this->registerFileInfo('End', 'End.php', 'inc/engine/src/API/activities'); 113 $this->registerFileInfo('Join', 'Join.php', 'inc/engine/src/API/activities'); 114 $this->registerFileInfo('Split', 'Split.php', 'inc/engine/src/API/activities'); 115 $this->registerFileInfo('Standalone', 'Standalone.php', 'inc/engine/src/API/activities'); 116 $this->registerFileInfo('View', 'View.php', 'inc/engine/src/API/activities'); 117 $this->registerFileInfo('SwitchActivity', 'SwitchActivity.php', 'inc/engine/src/API/activities'); 118 $this->registerFileInfo('Activity', 'Activity.php', 'inc/engine/src/API/activities'); 119 $this->registerFileInfo('BaseActivity', 'BaseActivity.php', 'inc/engine/src/API'); 120 121 $this->registerFileInfo('ajax_ldap', 'class.ajax_ldap.inc.php', 'inc/engine'); 122 $this->registerFileInfo('ajax_config', 'class.ajax_config.inc.php', 'inc/engine'); 123 $this->registerFileInfo('WfRuntime', 'WfRuntime.php', 'inc/engine/src/common'); 124 $this->registerFileInfo('WfSecurity', 'WfSecurity.php', 'inc/engine/src/common'); 125 126 /* nano classes */ 127 $this->registerFileInfo('Services_JSON', 'JSON.php', 'inc/nano'); 128 $this->registerFileInfo('NanoRequest', 'NanoRequest.class.php', 'inc/nano'); 129 $this->registerFileInfo('NanoController', 'NanoController.class.php', 'inc/nano'); 130 $this->registerFileInfo('NanoJsonConverter', 'NanoJsonConverter.class.php', 'inc/nano'); 131 $this->registerFileInfo('NanoSanitizer', 'NanoSanitizer.class.php', 'inc/nano'); 84 132 85 133 /* registering egw external classes */
Note: See TracChangeset
for help on using the changeset viewer.