Ignore:
Timestamp:
07/28/09 11:20:54 (15 years ago)
Author:
amuller
Message:

Ticket #88 - Adaptação pro expresso2.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoCalendar/inc/class.bocalendar.inc.php

    r920 r1204  
    103103        function insertEvent ($datetime, $edatetime, $title, $description, $location) 
    104104        { 
    105                 //Discover the event id 
    106                 $query = "SELECT max(cal_id) FROM phpgw_cal"; 
    107                 if (!$this->db->query($query)) 
    108                         return false; 
    109  
    110                 while($this->db->next_record()) 
    111                         $id = $this->db->row(); 
    112  
    113105                // Performing SQL insert query 
    114                 $query = "INSERT INTO phpgw_cal VALUES (".($id['max']+1).", '".$_SESSION['calendar']['user']['email']."', ".$this->user_id.", null, null, ".$datetime.", ".time().",".$edatetime.", 2, 'E', 0, '".$title."', '".$description."', '".$location."', 0, null)"; 
     106                //FIXME LOCK the table sequence is desirable 
     107                $query = "INSERT INTO phpgw_cal VALUES (default, '".$_SESSION['calendar']['user']['email']."', ".$this->user_id.", null, null, ".$datetime.", ".time().",".$edatetime.", default, 'E', default, '".$title."', '".$description."', '".$location."', default, default)"; 
    115108                if ($this->db->query($query)){ 
    116                         $query = "INSERT INTO phpgw_cal_user VALUES (".($id['max']+1).", ".$this->user_id.", 'A', 'u')"; 
     109                        $query = "INSERT INTO phpgw_cal_user VALUES (currval('seq_phpgw_cal'::regclass), ".$this->user_id.", 'A', 'u')"; 
    117110                        if ($this->db->query($query)){ 
    118111                                $return = "true "; 
Note: See TracChangeset for help on using the changeset viewer.