Changeset 2832


Ignore:
Timestamp:
05/20/10 18:20:35 (14 years ago)
Author:
asaikawa
Message:

Ticket #1082 - Alterado o método getChildren da classe wf_instance de acordo com a descricao do ticket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/local/classes/class.wf_instance.php

    r2591 r2832  
    250250 
    251251        /** 
    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) 
    260259        { 
    261260                $output = array(); 
    262261                if (is_null($instanceID)) 
    263262                        $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)) 
    269266                        return $output; 
    270267 
    271268                /* 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 = 'SELECT i.wf_instance_id AS wf_instance_id, ' . 
     270                                 '       ia.wf_activity_id AS wf_activity_id, ' . 
     271                                 '       i.wf_started AS wf_started, ' . 
     272                                 '       i.wf_name AS wf_name, ' . 
     273                                 '       i.wf_status AS wf_status, ' . 
     274                                 '       ia.wf_user AS wf_user, ' . 
     275                                 '       ir.wf_parent_lock AS wf_parent_lock ' . 
     276                                 ' FROM egw_wf_interinstance_relations ir, egw_wf_instances i ' . 
     277                                 '  LEFT JOIN egw_wf_instance_activities ia ' . 
     278                                 '  ON (ia.wf_instance_id = i.wf_instance_id) ' . 
     279                                 ' WHERE ' . 
     280                                 '  (ir.wf_child_instance_id = i.wf_instance_id) AND (ir.wf_parent_instance_id = ?) '; 
     281 
     282                $result = $this->db->query($query, array($instanceID)); 
    277283                $output = $result->GetArray(-1); 
    278284 
Note: See TracChangeset for help on using the changeset viewer.