From 427cc1b593452f9beaa3b1aa78e7ced2b5a1ebd0 Mon Sep 17 00:00:00 2001 From: skeeter Date: Thu, 1 Mar 2001 04:13:30 +0000 Subject: [PATCH] new ICAP functions --- calendar/inc/class.calendar_icap.inc.php | 62 ++++++++++++++++++++++++ calendar/inc/class.calendar_sql.inc.php | 21 ++++++++ 2 files changed, 83 insertions(+) diff --git a/calendar/inc/class.calendar_icap.inc.php b/calendar/inc/class.calendar_icap.inc.php index 31f332e229..67fc3e6883 100755 --- a/calendar/inc/class.calendar_icap.inc.php +++ b/calendar/inc/class.calendar_icap.inc.php @@ -157,6 +157,68 @@ class calendar_ return mcal_append_event($mcal_stream); } + function store_event($mcal_stream) + { + return mcal_store_event($mcal_stream); + } + + function delete_event($mcal_stream,$event_id) + { + return mcal_delete_event($mcal_stream,$event_id); + } + + function snooze($mcal_stream,$event_id) + { + return mcal_snooze($mcal_stream,$event_id); + } + + function list_alarms($mcal_stream,$begin_year='',$begin_month='',$begin_day='',$end_year='',$end_month='',$end_day='') + { + if($end_day == '') + { + if($end_month == '') + { + if($end_year == '') + { + if($begin_day == '') + { + if($begin_month == '') + { + if($begin_year == '') + { + return mcal_list_alarms($mcal_stream); + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year); + } + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year,$begin_month); + } + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year,$begin_month,$begin_day); + } + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year,$begin_month,$begin_day,$end_year); + } + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year,$begin_month,$begin_day,$end_year,$end_month); + } + } + else + { + return mcal_list_alarms($mcal_stream,$begin_year,$begin_month,$begin_day,$end_year,$end_month,$end_day); + } + } + function event_init($stream) { return mcal_event_init($stream); diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index cc8d6abd91..ca382ac776 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -397,6 +397,27 @@ class calendar_ return $this->save_event($this->event); } + function delete_event($mcal_stream,$event_id) + { + $this->stream->lock(array('calendar_entry','calendar_entry_user','calendar_entry_repeats')); + $this->stream->query('DELETE FROM calendar_entry_user WHERE cal_id='.$event_id,__LINE__,__FILE__); + $this->stream->query('DELETE FROM calendar_entry_repeats WHERE cal_id='.$event_id,__LINE__,__FILE__); + $this->stream->query('DELETE FROM calendar_entry WHERE cal_id='.$event_id[$i],__LINE__,__FILE__); + $this->stream->unlock(); + } + + function snooze($mcal_stream,$event_id) + { + //Turn off an alarm for an event + //Returns true. + } + + function list_alarms($mcal_stream,$begin_year='',$begin_month='',$begin_day='',$end_year='',$end_month='',$end_day='') + { + //Return a list of events that has an alarm triggered at the given datetime + //Returns an array of event ID's + } + function event_init($stream) { $this->event = CreateObject('calendar.calendar_item');