From 605f412878a9eabc6b5a4c57ebf8b36c0949f756 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 14 Apr 2003 21:35:50 +0000 Subject: [PATCH] fix for bug #3162 creation of new calendar entries fails, because tempnam used to create the id returns a to long string (possibly because TMP_DIR is to long) use the get_last_insert_id function now --- calendar/inc/class.socalendar_sql.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/calendar/inc/class.socalendar_sql.inc.php b/calendar/inc/class.socalendar_sql.inc.php index f8a40feac8..0c4eb6a191 100755 --- a/calendar/inc/class.socalendar_sql.inc.php +++ b/calendar/inc/class.socalendar_sql.inc.php @@ -451,12 +451,19 @@ class socalendar_ extends socalendar__ } $event['uid'] = $part[0].'-'.$part[1].'@'.$id_suffix; } +/* makes problems if tempnam is to long for title column, see bug #3162 $temp_name = tempnam($GLOBALS['phpgw_info']['server']['temp_dir'],'cal'); $this->stream->query('INSERT INTO phpgw_cal(uid,title,owner,priority,is_public,category) ' . "values('".$event['uid']."','".$temp_name."',".$event['owner'].','.$event['priority'].','.$event['public'].",'".$event['category']."')"); $this->stream->query("SELECT cal_id FROM phpgw_cal WHERE title='".$temp_name."'"); $this->stream->next_record(); $event['id'] = $this->stream->f('cal_id'); +*/ + $this->stream->query('INSERT INTO phpgw_cal(uid,title,owner,priority,is_public,category) ' + . "values('".$event['uid']."','".$this->stream->db_addslashes($event['title']) + . "',".$event['owner'].','.$event['priority'].','.$event['public'].",'" + . $event['category']."')",__LINE__,__FILE__); + $event['id'] = $this->stream->get_last_insert_id('phpgw_cal','cal_id'); } $date = $this->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset;