Changeset 2591 for trunk/workflow/inc/local
- Timestamp:
- 04/19/10 18:18:22 (14 years ago)
- Location:
- trunk/workflow/inc/local/classes
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/local/classes/class.JobBase.php
r1437 r2591 89 89 { 90 90 require_once 'common.inc.php'; 91 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();91 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 92 92 $this->jobID = $jobID; 93 93 $this->processID = $processID; 94 94 $this->currentDate = $currentDate; 95 $this->jobManager = &$GLOBALS['workflow']['factory']->getInstance('WorkflowJobManager');95 $this->jobManager = Factory::getInstance('WorkflowJobManager'); 96 96 $this->testMode = $testMode; 97 97 $this->maximumExecutionTime = $maximumExecutionTime; … … 148 148 final private function prepareEnvironment() 149 149 { 150 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareProcessEnvironment($this->processID); 151 152 require_once PHPGW_SERVER_ROOT . '/workflow/inc/class.process_factory.inc.php'; 150 Factory::getInstance('WorkflowMacro')->prepareProcessEnvironment($this->processID); 153 151 154 152 $this->environment = array(); 155 $this->environment['factory'] = & new ProcessFactory();153 $this->environment['factory'] = &Factory::newInstance('ProcessWrapperFactory'); 156 154 } 157 155 … … 202 200 final public function createNewInstance($startActivityId, $instanceName=false, $properties=false, $user=false) 203 201 { 204 $activityManager = CreateObject('workflow.workflow_activitymanager');202 $activityManager = Factory::getInstance('workflow_activitymanager'); 205 203 $activity = $activityManager->get_activity($startActivityId); 206 204 -
trunk/workflow/inc/local/classes/class.wf_engine.php
r795 r2591 68 68 $flagObject[0] = is_null($this->processManager); 69 69 if ($flagObject[0]) 70 $this->processManager = CreateObject('workflow.workflow_processmanager');70 $this->processManager = Factory::getInstance('workflow_processmanager'); 71 71 72 72 $output = array(); … … 90 90 function continueInstance($activityID, $instanceID) 91 91 { 92 require_once 'class.wf_instance.php'; 93 $WFInstance = new wf_instance(); 92 $WFInstance = &Factory::getInstance('wf_instance'); 94 93 return $WFInstance->continueInstance($activityID, $instanceID); 95 94 } … … 104 103 function abortInstance($instanceID) 105 104 { 106 require_once 'class.wf_instance.php'; 107 $WFInstance = new wf_instance(); 105 $WFInstance = &Factory::getInstance('wf_instance'); 108 106 return $WFInstance->abort($instanceID); 109 107 } … … 119 117 function setInstanceName($instanceID, $name) 120 118 { 121 require_once 'class.wf_instance.php'; 122 $WFInstance = new wf_instance(); 119 $WFInstance = &Factory::getInstance('wf_instance'); 123 120 return $WFInstance->setName($instanceID, $name); 124 121 } … … 134 131 function setInstancePriority($instanceID, $priority) 135 132 { 136 require_once 'class.wf_instance.php'; 137 $WFInstance = new wf_instance(); 133 $WFInstance = &Factory::getInstance('wf_instance'); 138 134 return $WFInstance->setPriority($instanceID, $priority); 139 135 } … … 149 145 function getIdleInstances($numberOfDays, $activities = null) 150 146 { 151 require_once 'class.wf_instance.php'; 152 $WFInstance = new wf_instance(); 147 $WFInstance = &Factory::getInstance('wf_instance'); 153 148 return $WFInstance->getIdle($numberOfDays, $activities); 154 149 } … … 175 170 function getInstancesByName($name) 176 171 { 177 require_once 'class.wf_instance.php'; 178 $WFInstance = new wf_instance(); 172 $WFInstance = &Factory::getInstance('wf_instance'); 179 173 $preOutput = $WFInstance->getByName($name); 180 174 $output = array(); … … 197 191 function getChildInstances($instanceID = null, $activityID = null) 198 192 { 199 require_once 'class.wf_instance.php'; 200 $WFInstance = new wf_instance(); 193 $WFInstance = &Factory::getInstance('wf_instance'); 201 194 $preOutput = $WFInstance->getChildren($instanceID, $activityID); 202 195 $output = array(); … … 217 210 function getInstanceProperties($instanceID) 218 211 { 219 require_once 'class.wf_instance.php'; 220 $WFInstance = new wf_instance(); 212 $WFInstance = &Factory::getInstance('wf_instance'); 221 213 return $WFInstance->getProperties($instanceID); 222 214 } … … 231 223 function getChildInstanceProperties($instanceID) 232 224 { 233 require_once 'class.wf_instance.php'; 234 $WFInstance = new wf_instance(); 225 $WFInstance = &Factory::getInstance('wf_instance'); 235 226 return $WFInstance->getProperties($instanceID); 236 227 } … … 247 238 $flagObject[0] = is_null($this->acl); 248 239 if ($flagObject[0]) 249 $this->acl = CreateObject('workflow.workflow_acl');240 $this->acl = Factory::getInstance('workflow_acl'); 250 241 251 242 $output = $this->acl->getUserPermissions($type, $uid); … … 268 259 $flagObject[0] = is_null($this->acl); 269 260 if ($flagObject[0]) 270 $this->acl = CreateObject('workflow.workflow_acl');261 $this->acl = Factory::getInstance('workflow_acl'); 271 262 272 263 $output = $this->acl->getUserGroupPermissions($type, $uid); … … 291 282 /* build the SQL query */ 292 283 $query = "SELECT wf_activity_id, wf_name, wf_normalized_name, wf_type, wf_description FROM egw_wf_activities WHERE (wf_activity_id = ?) AND (wf_p_id = ?)"; 293 $db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;284 $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 294 285 $resultSet = $db->query($query, array($activityID, $processID)); 295 286 … … 319 310 /* build the SQL query */ 320 311 $query = "SELECT wf_activity_id, wf_name, wf_normalized_name, wf_type, wf_description FROM egw_wf_activities WHERE (wf_name = ?) AND (wf_p_id = ?)"; 321 $db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;312 $db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 322 313 $resultSet = $db->query($query, array($activityName, $processID)); 323 314 … … 346 337 function getUserInstances($users, $activities = null, $status = null) 347 338 { 348 require_once 'class.wf_instance.php'; 349 $WFInstance = new wf_instance(); 339 $WFInstance = &Factory::getInstance('wf_instance'); 350 340 return $WFInstance->getByUser($users, $activities, $status); 351 341 } … … 360 350 function setInstanceProperty($instanceID, $nameProperty, $value) 361 351 { 362 require_once 'class.wf_instance.php'; 363 $WFInstance = new wf_instance(); 352 $WFInstance = &Factory::getInstance('wf_instance'); 364 353 return $WFInstance->setProperty($instanceID, $nameProperty, $value); 365 354 } … … 377 366 function checkUserAccessToInstance($userID, $instanceID, $activityID, $writeAccess = true) 378 367 { 379 require_once 'class.wf_instance.php'; 380 $WFInstance = new wf_instance(); 368 $WFInstance = &Factory::getInstance('wf_instance'); 381 369 return $WFInstance->checkUserAccess($userID, $instanceID, $activityID, $writeAccess); 382 370 } -
trunk/workflow/inc/local/classes/class.wf_instance.php
r1385 r2591 77 77 { 78 78 $instanceID = (int) $instanceID; 79 $instance = CreateObject('workflow.workflow_instance');79 $instance = Factory::getInstance('workflow_instance'); 80 80 if (!$instance->getInstance($instanceID)) 81 81 return false; … … 92 92 { 93 93 /* load the DB */ 94 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;94 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 95 95 96 96 /* load the process ID from the runtime */ … … 118 118 $instance = $this->getInstanceObject($instanceID); 119 119 120 $runActivity = CreateObject('workflow.run_activity');120 $runActivity = Factory::getInstance('run_activity'); 121 121 122 122 ob_start(); … … 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']; … … 456 455 if ($userID !== '*') 457 456 { 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(); 457 $wfRole = Factory::getInstance('wf_role'); 458 $engine = Factory::getInstance('wf_engine'); 463 459 /* get information about the activity */ 464 460 if (($activityInfo = $engine->getActivityInformationByID($activityID)) === false) … … 529 525 530 526 /* try to get the role id */ 531 require_once dirname(__FILE__) . '/class.wf_role.php'; 532 $wfRole = new wf_role(); 527 $wfRole = Factory::getInstance('wf_role'); 533 528 if (($roleID = $wfRole->getRoleIdByName($roleName)) === false) 534 529 return false; -
trunk/workflow/inc/local/classes/class.wf_ldap.php
r1067 r2591 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 /** … … 41 40 function wf_ldap() 42 41 { 43 $tmpLDAP = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');42 $tmpLDAP = Factory::getInstance('WorkflowLDAP'); 44 43 $this->user_context = $tmpLDAP->getUserContext(); 45 44 $this->group_context = $tmpLDAP->getGroupContext(); 46 45 47 $this->ds = & $GLOBALS['workflow']['workflowObjects']->getLDAP();46 $this->ds = &Factory::getInstance('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 } -
trunk/workflow/inc/local/classes/class.wf_location.php
r2137 r2591 36 36 function initialize() 37 37 { 38 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID;38 $this->db = &Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID; 39 39 $this->db->setFetchMode(ADODB_FETCH_ASSOC); 40 40 $this->cityInfo = array(); -
trunk/workflow/inc/local/classes/class.wf_mail.php
r795 r2591 39 39 $requiredConfiguration = array('mail_smtp_profile' => false); 40 40 $configuration = $GLOBALS['workflow']['wf_runtime']->process->getConfigValues($requiredConfiguration); 41 $bo_emailadmin = CreateObject('emailadmin.bo');41 $bo_emailadmin = Factory::getInstance('bo'); 42 42 $profileData = $bo_emailadmin->getProfile($configuration['mail_smtp_profile']); 43 43 -
trunk/workflow/inc/local/classes/class.wf_orgchart.php
r2348 r2591 24 24 function wf_orgchart() 25 25 { 26 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID;26 $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 27 27 $this->db->setFetchMode(ADODB_FETCH_ASSOC); 28 28 } -
trunk/workflow/inc/local/classes/class.wf_role.php
r1048 r2591 57 57 $this->processID = (int) $GLOBALS['workflow']['job']['processID']; 58 58 59 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;60 $this->roleManager = CreateObject('workflow.workflow_rolemanager');61 $this->activityManager = CreateObject('workflow.workflow_activitymanager');59 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 60 $this->roleManager = Factory::getInstance('workflow_rolemanager'); 61 $this->activityManager = Factory::getInstance('workflow_activitymanager'); 62 62 } 63 63 … … 186 186 $users = array((int) $users); 187 187 $roleID = $this->roleManager->get_role_id($this->processID, $roleName); 188 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');188 $ldap = Factory::getInstance('WorkflowLDAP'); 189 189 foreach ($users as $user) 190 190 { … … 212 212 $users = $this->roleManager->list_mapped_users($this->processID, false, array('wf_role_name' => $roleName)); 213 213 214 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');214 $ldap = Factory::getInstance('WorkflowLDAP'); 215 215 $output = array(); 216 216 foreach ($users as $id => $login) … … 367 367 368 368 /* get the roles */ 369 $userGroups = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserGroups($userID);369 $userGroups = Factory::getInstance('WorkflowLDAP')->getUserGroups($userID); 370 370 $query = 'SELECT DISTINCT role.wf_role_id, role.wf_name, role.wf_description FROM egw_wf_roles role, egw_wf_user_roles user_role WHERE (user_role.wf_role_id = role.wf_role_id) AND (role.wf_p_id = ?) AND (role.wf_role_id = ANY (?))'; 371 371 $query .= ' AND (((user_role.wf_user = ?) AND (user_role.wf_account_type = ?))'; -
trunk/workflow/inc/local/classes/class.wf_workitem.php
r795 r2591 29 29 public function wf_workitem() 30 30 { 31 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;31 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 32 32 $this->processID = (int) $GLOBALS['workflow']['wf_runtime']->activity->getProcessId(); 33 33 }
Note: See TracChangeset
for help on using the changeset viewer.