Changeset 2872


Ignore:
Timestamp:
05/27/10 15:02:03 (14 years ago)
Author:
fabianok
Message:

Ticket #1089 - Substituição na consulta que cria nova instância.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/1089/inc/engine/src/API/Instance.php

    r2466 r2872  
    510510    $this->setStarted($now); 
    511511    $this->setOwner($user); 
    512      
     512 
     513    //Get the id of new instance, before insert values in table and use this value from main table and relationship tables. 
     514    $this->instanceId = $this->getOne("SELECT nextval('seq_egw_wf_instances')"); 
     515    $iid=$this->instanceId; 
     516 
    513517    $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instances 
    514       (wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties)  
    515       values(?,?,?,?,?,?)'; 
    516     $this->query($query,array($now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 
    517     $this->instanceId = $this->getOne('select max(wf_instance_id) from '.GALAXIA_TABLE_PREFIX.'instances  
    518                       where wf_started=? and wf_owner=?',array((int)$now,$user)); 
    519     $iid=$this->instanceId; 
    520      
     518      (wf_instance_id, wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties)  
     519      values(?,?,?,?,?,?,?)'; 
     520 
     521   $this->query($query,array((int)$iid, $now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 
     522  
    521523    // Then add in ".GALAXIA_TABLE_PREFIX."instance_activities an entry for the 
    522524    // activity the user and status running and started now 
Note: See TracChangeset for help on using the changeset viewer.