Changeset 1204 for trunk/expressoCalendar/inc/class.bocalendar.inc.php
- Timestamp:
- 07/28/09 11:20:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoCalendar/inc/class.bocalendar.inc.php
r920 r1204 103 103 function insertEvent ($datetime, $edatetime, $title, $description, $location) 104 104 { 105 //Discover the event id106 $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 113 105 // 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)"; 115 108 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')"; 117 110 if ($this->db->query($query)){ 118 111 $return = "true ";
Note: See TracChangeset
for help on using the changeset viewer.