This now sends email notifications for all changes of status. You cannot reset your status to 'No Response' once it has been either accepted/tentative/rejected.

This commit is contained in:
skeeter 2001-05-16 17:40:20 +00:00
parent 0c01a48016
commit 05fec0da11
2 changed files with 31 additions and 11 deletions

View File

@ -130,6 +130,16 @@ class calendar__
$event_id = $old_event->id;
$msgtype = '"calendar";';
break;
case MSG_TENTATIVE:
$action = 'Tentative';
$event_id = $old_event->id;
$msgtype = '"calendar";';
break;
case MSG_ACCEPTED:
$action = 'Tentative';
$event_id = $old_event->id;
$msgtype = '"calendar";';
break;
}
if($old_event != False)
@ -158,6 +168,8 @@ class calendar__
$phpgw_info['user']['preferences']['common']['tz_offset'] = $part_prefs['common']['tz_offset'];
$phpgw_info['user']['preferences']['common']['timeformat'] = $part_prefs['common']['timeformat'];
$phpgw_info['user']['preferences']['common']['dateformat'] = $part_prefs['common']['dateformat'];
$new_tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset']));
if($old_event != False)
{
@ -184,8 +196,10 @@ class calendar__
$body = 'You have a meeting scheduled for '.$new_event_date;
break;
case MSG_REJECTED:
case MSG_TENTATIVE:
case MSG_ACCEPTED:
$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;
$body = 'On '.$phpgw->common->show_date(time() - $new_tz_offset).' '.$phpgw->common->grab_owner_name($phpgw_info['user']['account_id']).' '.$action.' your meeting request for '.$old_event_date;
break;
}
$subject = 'Calendar Event ('.$action.') #'.$event_id.': '.$action_date.' (L)';

View File

@ -728,18 +728,24 @@ class calendar_ extends calendar__
TENTATIVE => 'T',
ACCEPTED => 'A'
);
if($status == REJECTED)
$temp_event = $this->event;
$old_event = $this->fetch_event($this->stream,$id);
switch($status)
{
$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__);
case REJECTED:
$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__);
break;
case TENTATIVE:
$this->send_update(MSG_TENTATIVE,$old_event->participants,$old_event);
$this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__);
break;
case ACCEPTED:
$this->send_update(MSG_ACCEPTED,$old_event->participants,$old_event);
$this->stream->query("UPDATE phpgw_cal_user SET cal_status='".$status_code_short[$status]."' WHERE cal_id=".$id." AND cal_login=".$owner,__LINE__,__FILE__);
break;
}
$this->event = $temp_event;
return True;
}