From 09509270c72b7c93c31279e8ea77f37f55eaf442 Mon Sep 17 00:00:00 2001 From: skeeter Date: Wed, 16 May 2001 04:39:55 +0000 Subject: [PATCH] Updates are now being sent for Rejections. --- calendar/inc/class.calendar__.inc.php | 12 ++++++++++++ calendar/inc/class.calendar_sql.inc.php | 13 ++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar__.inc.php b/calendar/inc/class.calendar__.inc.php index f94a5e5121..38ede6e274 100755 --- a/calendar/inc/class.calendar__.inc.php +++ b/calendar/inc/class.calendar__.inc.php @@ -41,6 +41,9 @@ if(extension_loaded('mcal') == False) define('MSG_DELETED',0); define('MSG_MODIFIED',1); define('MSG_ADDED',2); +define('MSG_REJECTED',3); +define('MSG_TENTATIVE',4); +define('MSG_ACCEPTED',5); define('REJECTED',0); define('NO_RESPONSE',1); @@ -122,6 +125,11 @@ class calendar__ $event_id = $old_event->id; $msgtype = '"calendar"; Version="'.$phpgw_info['server']['versions']['calendar'].'"; Id="'.$new_event->id.'"'; break; + case MSG_REJECTED: + $action = 'Rejected'; + $event_id = $old_event->id; + $msgtype = '"calendar";'; + break; } if($old_event != False) @@ -175,6 +183,10 @@ class calendar__ $action_date = $new_event_date; $body = 'You have a meeting scheduled for '.$new_event_date; break; + case MSG_REJECTED: + $action_date = $old_event_date; + $body = 'On '.$phpgw->common->show_date(time() - ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset']))).' '.$phpgw->common->grab_owner_name($phpgw_info['user']['account_id']).' REJECTED your meeting request for '.$old_event_date; + break; } $subject = 'Calendar Event ('.$action.') #'.$event_id.': '.$action_date.' (L)'; $returncode = $send->msg('email',$to,$subject,$body,$msgtype,'','','',$sender); diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index 7f523d4a95..3e248534ce 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -728,7 +728,18 @@ class calendar_ extends calendar__ TENTATIVE => 'T', ACCEPTED => 'A' ); - $this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__); + if($status == REJECTED) + { + $temp_event = $this->event; + $old_event = $this->fetch_event($this->stream,$id); + $this->send_update(MSG_REJECTED,$old_event->participants,$old_event); + $this->stream->query("DELETE FROM phpgw_cal_user WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__); + $this->event = $temp_event; + } + else + { + $this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__); + } return True; }