- Timestamp:
- 08/17/10 16:17:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/local/classes/class.wf_instance.php
r1385 r3167 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(); … … 250 250 251 251 /** 252 * Busca as instâncias filhas de uma instância 253 * Se os parâmetros não forem informados, retorna instâncias filhas das instância atual. 254 * @param int $instanceID O ID da instância pai (não obrigatório). 255 * @param int $activityID O ID da atividade corrente da instância pai 256 * @return array As instâncias filhas do par instância/atividade atual 257 * @access public 258 */ 259 public function getChildren($instanceID = null, $activityID = null) 252 * This method gets all children instances of the given instance. 253 * If there is no parameter, it gets the children instances of the current instance 254 * @param int $instanceID Dad instance's identification. 255 * @return array Array with the children instances, or false 256 * @access public 257 */ 258 public function getChildren($instanceID = null) 260 259 { 261 260 $output = array(); 262 261 if (is_null($instanceID)) 263 262 $instanceID = $GLOBALS['workflow']['wf_runtime']->instance_id; 264 if (is_null($activityID)) 265 $activityID = $GLOBALS['workflow']['wf_runtime']->activity_id; 266 267 /* check instanceID */ 268 if (!$this->checkInstanceAccess($instanceID, $activityID)) 263 264 /* check instanceID */ 265 if (!$this->checkInstanceAccess($instanceID)) 269 266 return $output; 270 267 271 268 /* build the SQL query */ 272 $query = 'SELECT i.wf_instance_id AS wf_instance_id, ia.wf_activity_id AS wf_activity_id, ia.wf_started AS wf_started, i.wf_name AS wf_name, i.wf_status AS wf_status, ia.wf_user AS wf_user, ir.wf_parent_lock AS wf_parent_lock '; 273 $query .= 'FROM egw_wf_interinstance_relations ir, egw_wf_instances i LEFT JOIN egw_wf_instance_activities ia ON (ia.wf_instance_id = i.wf_instance_id)'; 274 $query .= 'WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) AND (ir.wf_parent_activity_id = ?)'; 275 276 $result = $this->db->query($query, array($instanceID, $activityID)); 269 $query = " 270 SELECT 271 i.wf_instance_id AS wf_instance_id, 272 ia.wf_activity_id AS wf_activity_id, 273 i.wf_started AS wf_started, 274 i.wf_name AS wf_name, 275 i.wf_status AS wf_status, 276 ia.wf_user AS wf_user, 277 ir.wf_parent_lock AS wf_parent_lock 278 FROM 279 egw_wf_interinstance_relations as ir 280 LEFT JOIN 281 egw_wf_instances as i 282 ON 283 i.wf_instance_id = ir.wf_child_instance_id 284 LEFT JOIN 285 egw_wf_instance_activities as ia 286 ON 287 i.wf_instance_id = ia.wf_instance_id 288 WHERE 289 ir.wf_parent_instance_id = ?"; 290 291 $result = $this->db->query($query, array($instanceID)); 277 292 $output = $result->GetArray(-1); 278 293 … … 423 438 424 439 /* 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); 440 $GUI = &Factory::newInstance('GUI'); 427 441 $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 442 $userInstance = $userInstance['data']; … … 456 470 if ($userID !== '*') 457 471 { 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(); 472 $wfRole = Factory::getInstance('wf_role'); 473 $engine = Factory::getInstance('wf_engine'); 463 474 /* get information about the activity */ 464 475 if (($activityInfo = $engine->getActivityInformationByID($activityID)) === false) … … 529 540 530 541 /* try to get the role id */ 531 require_once dirname(__FILE__) . '/class.wf_role.php'; 532 $wfRole = new wf_role(); 542 $wfRole = Factory::getInstance('wf_role'); 533 543 if (($roleID = $wfRole->getRoleIdByName($roleName)) === false) 534 544 return false;
Note: See TracChangeset
for help on using the changeset viewer.