Changeset 1293 for sandbox/workflow/2.0/inc/class.run_activity.inc.php
- Timestamp:
- 08/07/09 16:06:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/2.0/inc/class.run_activity.inc.php
r795 r1293 10 10 \**************************************************************************/ 11 11 12 require_once PHPGW_SERVER_ROOT . SEP . 'workflow/inc/common.inc.php'; 13 12 14 require_once(dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php' ); /* superclass source code */ 13 15 require_once(dirname(__FILE__) . SEP . 'class.basecontroller.inc.php' ); /* module controller */ 14 16 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 */17 require_once WF_PROC_LIB . SEP . 'ProcessFactory.php'; /* module process factory class */ 16 18 require_once(dirname(__FILE__) . SEP . 'class.utils.security.php' ); /* sanitizes input data */ 17 19 … … 25 27 */ 26 28 class run_activity extends WorkflowUtils 27 { 29 { 28 30 /** 29 31 * @var array $public_functions func … … 51 53 * @access public 52 54 */ 53 var $process; 55 var $process; 54 56 /** 55 57 * @var object $GUI GUI engine object. Act carefully with it. … … 63 65 var $message = Array(); 64 66 /** 65 * @var object $categories categorie object for categories 67 * @var object $categories categorie object for categories 66 68 * @access public 67 69 */ 68 70 var $categories; 69 71 /** 70 * @var array $conf 71 * @access public 72 */ 73 var $conf = array(); 72 * @var array $conf 73 * @access public 74 */ 75 var $conf = array(); 74 76 /** 75 77 * @var $wf_template local activity template … … 77 79 */ 78 80 var $wf_template; 79 /** 81 /** 80 82 * @var object $instance 81 83 * @access public 82 84 */ 83 85 var $instance; 84 /** 86 /** 85 87 * @var object $activity_type The type of activity 86 88 * @access public … … 89 91 // then we retain all usefull vars as members, to make them avaible in user's source code 90 92 // theses are data which can be set before the user code and which are not likely to change because of the user code 91 /** 92 * @var int $process_id The process id 93 /** 94 * @var int $process_id The process id 93 95 * @access public 94 96 */ 95 97 var $process_id; 96 /** 97 * @var int $activity_id The activity id 98 /** 99 * @var int $activity_id The activity id 98 100 * @access public 99 101 */ 100 102 var $activity_id; 101 /** 103 /** 102 104 * @var int $process_name The process name 103 105 * @access public 104 106 */ 105 107 var $process_name; 106 /** 107 * @var int $process_version The process_version 108 /** 109 * @var int $process_version The process_version 108 110 * @access public 109 111 */ 110 112 var $process_version; 111 /** 112 * @var int $activity_name The process id 113 /** 114 * @var int $activity_name The process id 113 115 * @access public 114 116 */ 115 117 var $activity_name; 116 /** 117 * @var int $user_name The user name 118 /** 119 * @var int $user_name The user name 118 120 * @access public 119 121 */ 120 122 var $user_name; 121 /** 122 * @var int $view_activity activity id of the view activity avaible for this process 123 /** 124 * @var int $view_activity activity id of the view activity avaible for this process 123 125 * @access public 124 126 */ 125 127 var $view_activity; 126 // theses 4 vars aren't avaible for the user code, they're set only after this user code was executed 127 /** 128 * @var int $instance_id Instance id 128 // theses 4 vars aren't avaible for the user code, they're set only after this user code was executed 129 /** 130 * @var int $instance_id Instance id 129 131 * @access public 130 132 */ 131 133 var $instance_id=0; 132 /** 133 * @var string $instance_name Instance name 134 /** 135 * @var string $instance_name Instance name 134 136 * @access public 135 137 */ 136 138 var $instance_name=''; 137 /** 138 * @var int $instance_owner Instance owner id 139 /** 140 * @var int $instance_owner Instance owner id 139 141 * @access public 140 142 */ 141 143 var $instance_owner=0; 142 /** 143 * @var string $owner_name Owner name 144 /** 145 * @var string $owner_name Owner name 144 146 * @access public 145 147 */ 146 148 var $owner_name=''; 147 149 148 150 /** 149 151 * @var bool $print_mode print mode … … 156 158 */ 157 159 var $enable_print_mode = false; 158 160 159 161 /** 160 162 * @var array $act_role_names of roles associated with the activity, usefull for lists of users associated with theses roles 161 * @access public 163 * @access public 162 164 */ 163 165 var $act_role_names= Array(); 164 166 165 167 /** 166 168 * @var array $agents Array of ui_agent objects … … 174 176 * @access public 175 177 */ 176 var $smarty; 178 var $smarty; 177 179 /** 178 180 * @var array $wf holds a global environment vector 179 181 * @access public 180 182 */ 181 var $wf; 183 var $wf; 182 184 /** 183 185 * @var $download_mode activates download mode 184 186 * @access public 185 187 */ 186 var $download_mode; 188 var $download_mode; 187 189 /** 188 190 * @var string $_template_name holds the template's file name 189 191 * @access public 190 192 */ 191 var $_template_name = null; 193 var $_template_name = null; 192 194 /** 193 195 * @var bool Indicates wether the current instance is a child instance or not … … 200 202 /** 201 203 * Constructor 202 * 203 * @access public 204 * 205 * @access public 204 206 */ 205 207 function run_activity() … … 301 303 $this->process_version = $this->process->getVersion(); 302 304 $this->activity_name = $activity->getName(); 303 $this->user_name = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']);305 $this->user_name = Factory::getForeignInstance('phpgwapi', 'phpgw')->accounts->id2name($GLOBALS['user']); 304 306 $this->view_activity = $this->GUI->gui_get_process_view_activity($this->process_id); 305 307 … … 317 319 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 318 320 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 319 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');320 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');321 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 322 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 321 323 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 322 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);324 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 323 325 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 324 326 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 375 377 376 378 /* check some permissions */ 377 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || ( $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($newUser) === false))379 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || (Factory::getInstance('WorkflowLDAP')->getName($newUser) === false)) 378 380 { 379 381 $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; … … 406 408 $smarty->plugins_dir[] = PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'inc'.SEP.'smarty'.SEP.'wf_plugins'; 407 409 408 $GLOBALS['phpgw']->template =& $smarty;410 Factory::getForeignInstance('phpgwapi', 'phpgw')->template =& $smarty; 409 411 $this->wf_template =& $smarty; 410 412 $_template_name = null; … … 418 420 $smarty->assign('wf_back_link',$GLOBALS['workflow']['wf_back_link']); 419 421 $smarty->assign('wf_activity_url',$GLOBALS['workflow']['wf_activity_url']); 420 422 421 423 /* register the prefilter smarty plugin wf_default_template */ 422 424 $smarty->load_filter('pre', 'wf_default_template'); … … 444 446 445 447 $GLOBALS['workflow_env'] = &$env; 448 446 449 //echo "<br><br><br><br><br>Including $source <br>In request: <pre>";print_r($_REQUEST);echo "</pre>"; 447 450 //[__leave_activity] is setted if needed in the xxx_pre code or by the user in his code … … 471 474 472 475 /* activate the security policy */ 473 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy();476 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 474 477 475 478 /* include the files */ … … 497 500 $this->instance_name = $instance->getName(); 498 501 $this->instance_owner = $instance->getOwner(); 499 $this->owner_name = $GLOBALS['phpgw']->accounts->id2name($this->instance_owner);502 $this->owner_name = Factory::getForeignInstance('phpgwapi', 'phpgw')->accounts->id2name($this->instance_owner); 500 503 if ($this->owner_name == '') 501 504 { … … 644 647 $this->process_version = $this->process->getVersion(); 645 648 $this->activity_name = $activity->getName(); 646 $this->user_name = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']);649 $this->user_name = Factory::getForeignInstance('phpgwapi', 'phpgw')->accounts->id2name($GLOBALS['user']); 647 650 $this->view_activity = $this->GUI->gui_get_process_view_activity($this->process_id); 648 651 … … 660 663 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 661 664 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 662 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');663 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');665 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 666 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 664 667 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 665 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);668 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 666 669 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 667 670 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 711 714 712 715 /* activate the security policy */ 713 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy();716 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 714 717 715 718 $GLOBALS['workflow_env'] = &$env;
Note: See TracChangeset
for help on using the changeset viewer.