Changeset 2372 for sandbox/workflow/trunk/inc/class.run_activity.inc.php
- Timestamp:
- 03/29/10 14:46:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/trunk/inc/class.run_activity.inc.php
r2072 r2372 10 10 \**************************************************************************/ 11 11 12 require_once(dirname(__FILE__) . SEP . 'common.inc.php'); /* including common deifinitions */ 12 13 require_once(dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php' ); /* superclass source code */ 13 14 require_once(dirname(__FILE__) . SEP . 'class.basecontroller.inc.php' ); /* module controller */ 14 15 require_once(dirname(__FILE__) . SEP . 'class.basemodel.inc.php' ); /* module logic */ 15 require_once(dirname(__FILE__) . SEP . 'class.process_factory.inc.php'); /* module process factory class */16 require_once(dirname(__FILE__) . SEP . 'class.utils.security.php' ); /* sanitizes input data */17 16 18 17 /** … … 206 205 { 207 206 parent::WorkflowUtils(); 208 $this->runtime = CreateObject('workflow.workflow_wfruntime'); 207 208 /** 209 * We should always use newInstance to instantiate 210 * 'workflow_wfruntime' 211 */ 212 $this->runtime = &Factory::newInstance('workflow_wfruntime'); 209 213 $this->runtime->setDebug(_DEBUG); 210 //$this->base_activity = CreateObject('workflow.workflow_baseactivity');211 //$this->process = CreateObject('workflow.workflow_process');212 $this->GUI = CreateObject('workflow.workflow_gui');213 $this->categories = CreateObject('phpgwapi.categories');214 215 $this->workflowSmarty = CreateObject('workflow.workflow_smarty', false);214 //$this->base_activity = Factory::getInstance('workflow_baseactivity'); 215 //$this->process = Factory::getInstance('workflow_process'); 216 $this->GUI = &Factory::getInstance('workflow_gui'); 217 $this->categories = &Factory::getInstance('categories'); 218 219 $this->workflowSmarty = &Factory::getInstance('workflow_smarty', false); 216 220 // TODO: open a new connection to the database under a different username to allow privilege handling on tables 217 221 /* CELEPAR */ … … 301 305 $this->process_version = $this->process->getVersion(); 302 306 $this->activity_name = $activity->getName(); 303 $this->user_name = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']);307 $this->user_name = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']); 304 308 $this->view_activity = $this->GUI->gui_get_process_view_activity($this->process_id); 305 309 … … 318 322 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 319 323 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 320 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');321 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');324 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 325 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 322 326 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 323 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);327 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 324 328 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 325 329 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 376 380 377 381 /* check some permissions */ 378 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || ( $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($newUser) === false))382 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || (Factory::getInstance('WorkflowLDAP')->getName($newUser) === false)) 379 383 { 380 384 $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; … … 386 390 return false; 387 391 } 388 $smarty = CreateObject('workflow.process_smarty');392 $smarty = Factory::getInstance('process_smarty'); 389 393 } 390 394 … … 399 403 /* #celepar# smarty code*/ 400 404 401 $smarty = CreateObject('workflow.process_smarty');405 $smarty = Factory::getInstance('process_smarty'); 402 406 403 407 $smarty->template_dir = GALAXIA_PROCESSES.SEP.$this->process->getNormalizedName().SEP.'code'.SEP.'templates'; … … 438 442 $env['instance'] =& $instance; //process manager instance 439 443 $env['activity'] =& $activity; //activity manager instance 440 $security =& new SecurityUtils(); //input sanitizer class444 $security =& Factory::newInstance('SecurityUtils'); //input sanitizer class 441 445 $env['request'] =& $security->process($_REQUEST); //sanitizes input data from client 442 $env['factory'] =& new ProcessFactory(); //instantiation controller class 446 //$env['factory'] =& new ProcessFactory(); //instantiation controller class 447 $env['factory'] =& Factory::getInstance('ProcessWrapperFactory'); //instantiation controller class 443 448 $env['natural'] =& wf_create_object('wf_natural'); //data access object instance for mainframe 444 449 /* END WORKFLOW MVC SETTINGS */ … … 472 477 473 478 /* activate the security policy */ 474 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy(); 479 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 480 481 /** 482 * XXX 483 * here we are going to use our new Security static class. 484 * From now, the factory frontend (static) will forward 485 * the messages for the process factory instead of Workflow 486 * factory. 487 * XXX 488 */ 489 Security::enable(); 475 490 476 491 /* include the files */ … … 661 676 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 662 677 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 663 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');664 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');678 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 679 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 665 680 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 666 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);681 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 667 682 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 668 683 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 699 714 $env['instance'] =& $instance; //process manager instance 700 715 $env['activity'] =& $activity; //activity manager instance 701 $security =& new SecurityUtils();//input sanitizer class716 $security =& Factory::newInstance('SecurityUtils'); //input sanitizer class 702 717 $env['request'] =& $security->process($_REQUEST); //sanitizes input data from client 703 $env['factory'] =& new ProcessFactory(); //instantiation controller class 718 //$env['factory'] =& new ProcessFactory(); //instantiation controller class 719 $env['factory'] =& Factory::newInstance('ProcessWrapperFactory'); //instantiation controller class 704 720 $env['natural'] =& wf_create_object('wf_natural'); //data access object instance for mainframe 705 721 /* END WORKFLOW MVC SETTINGS */ … … 712 728 713 729 /* activate the security policy */ 714 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy(); 730 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 731 732 /** 733 * XXX 734 * here we are going to use our new Security static class. 735 * From now, the factory frontend (static) will forward 736 * the messages for the process factory instead of Workflow 737 * factory. Note that this is the same comment as the previous 738 * function... boooring.. =} 739 * XXX 740 */ 741 Security::enable(); 715 742 716 743 $GLOBALS['workflow_env'] = &$env; 717 $nc = new NanoController();744 $nc = &Factory::newInstance('NanoController'); 718 745 $nc->setClassPath(GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'); 719 746 $nc->iterateOverVirtualRequests();
Note: See TracChangeset
for help on using the changeset viewer.