From 96f535e48374d0f06be96bdd386bb3329a4033c0 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sun, 18 Nov 2001 23:01:09 +0000 Subject: [PATCH] Fix to allow for saving new calendar events. --- calendar/inc/class.bocalendar.inc.php | 59 ++++++++++++++--------- calendar/inc/class.socalendar__.inc.php | 1 + calendar/inc/class.socalendar_sql.inc.php | 5 ++ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index c7b3624f7c..76b3a0ab70 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -547,6 +547,10 @@ $GLOBALS['phpgw']->common->phpgw_exit(); } + if($this->debug) + { + echo ''."\n"; + } $this->fix_update_time($l_start); $this->fix_update_time($l_end); @@ -709,28 +713,26 @@ } $overlapping_events = $this->overlap( -// $this->maketime($event['start']) - $this->datetime->tz_offset, -// $this->maketime($event['end']) - $this->datetime->tz_offset, - $this->maketime($event['start']), - $this->maketime($event['end']), - $event['participants'], - $event['owner'], - $event_ids + $this->maketime($event['start']), + $this->maketime($event['end']), + $event['participants'], + $event['owner'], + $event_ids ); } if($overlapping_events) { - if($send_to_ui) - { + if($send_to_ui) + { unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - ExecMethod('calendar.uicalendar.overlap', - Array( - 'o_events' => $overlapping_events, - 'this_event' => $event - ) - ); + ExecMethod('calendar.uicalendar.overlap', + Array( + 'o_events' => $overlapping_events, + 'this_event' => $event + ) + ); $GLOBALS['phpgw']->common->phpgw_exit(True); } else @@ -742,21 +744,34 @@ { if(!$event['id']) { - $this->so->add_entry($event); - $this->send_update(MSG_ADDED,$event['participants'],'',$this->get_cached_event()); + if($this->debug) + { + echo ''."\n"; + } + $this->so->cal->event = $event; + $this->so->add_entry($event); + $this->send_update(MSG_ADDED,$event['participants'],'',$this->get_cached_event()); + if($this->debug) + { + echo ''."\n"; + } } else { + if($this->debug) + { + echo ''."\n"; + } $new_event = $event; $old_event = $this->read_entry($event['id']); $this->prepare_recipients($new_event,$old_event); $this->so->cal->event = $event; - $this->so->add_entry($event); + $this->so->add_entry($event); } - $date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']); - if($send_to_ui) - { - Execmethod('calendar.uicalendar.index'); + $date = sprintf("%04d%02d%02d",$event['start']['year'],$event['start']['month'],$event['start']['mday']); + if($send_to_ui) + { + Execmethod('calendar.uicalendar.index'); $GLOBALS['phpgw']->common->phpgw_exit(); } } diff --git a/calendar/inc/class.socalendar__.inc.php b/calendar/inc/class.socalendar__.inc.php index 4a64fbd237..1344b456e5 100755 --- a/calendar/inc/class.socalendar__.inc.php +++ b/calendar/inc/class.socalendar__.inc.php @@ -65,6 +65,7 @@ class socalendar__ var $users_status; var $datetime; var $debug = False; +// var $debug = True; function socalendar__() { diff --git a/calendar/inc/class.socalendar_sql.inc.php b/calendar/inc/class.socalendar_sql.inc.php index 99cf396ebc..e8126d0d07 100755 --- a/calendar/inc/class.socalendar_sql.inc.php +++ b/calendar/inc/class.socalendar_sql.inc.php @@ -537,6 +537,11 @@ class socalendar_ extends socalendar__ { $this->stream->query('DELETE FROM phpgw_cal_repeats WHERE cal_id='.$event['id'],__LINE__,__FILE__); } + + if($this->debug) + { + echo ''."\n"; + } $this->stream->unlock(); return True;