Ticket #1719: class.wf_instance.php.diff
File class.wf_instance.php.diff, 2.1 KB (added by viani, 13 years ago) |
---|
-
class.wf_instance.php
old new 76 76 private function getInstanceObject($instanceID) 77 77 { 78 78 $instanceID = (int) $instanceID; 79 $instance = Factory:: getInstance('workflow_instance');79 $instance = Factory::newInstance('workflow_instance'); 80 80 if (!$instance->getInstance($instanceID)) 81 81 return false; 82 82 else … … 242 242 * @param array $activities Uma lista de atividades das quais se quer as instâncias (também pode ser um valor inteiro). 243 243 * @return array As instâncias que satisfazem o critério de seleção. 244 244 * @access public 245 * @deprecated 2.2.000 245 246 */ 246 247 public function getAll($activities = null) 247 248 { 249 wf_warn_deprecated_method('wf_instances', 'getAllActive'); 248 250 return $this->getIdle(0, $activities); 249 251 } 250 252 251 253 /** 254 * Search and return all active instances. 255 * @param array $activities A list of activities codes to restrict instances from (may also be a single integer code). 256 * @return array The instaces which match the search criteria. 257 * @access public 258 */ 259 public function getAllActive($activities = null) 260 { 261 return $this->getIdle(0, $activities); 262 } 263 264 /** 265 * Retrieve all completed instances. 266 * @return array All completed instances from current process. Be careful this may be a long array. 267 * @access public 268 */ 269 public function getAllCompleted() 270 { 271 $output = array(); 272 273 // Build the SQL query 274 // Select all instances from the process that has a final date 275 $query = 'SELECT i.wf_instance_id, i.wf_started, i.wf_ended, i.wf_name, i.wf_status, i.wf_priority '; 276 $query .= 'FROM egw_wf_instances i '; 277 $query .= 'WHERE (i.wf_p_id = ?) AND (i.wf_ended > 0)'; 278 $resultSet = $this->db->query($query, array($this->processID)); 279 280 /* fetch the results */ 281 while ($row = $resultSet->fetchRow()) 282 { 283 $output[] = $row; 284 } 285 286 return $output; 287 } 288 289 /** 252 290 * This method gets all children instances of the given instance. 253 291 * If there is no parameter, it gets the children instances of the current instance 254 292 * @param int $instanceID Dad instance's identification.