Updates are now being sent for Rejections.

This commit is contained in:
skeeter 2001-05-16 04:39:55 +00:00
parent b7a4b1ca57
commit 09509270c7
2 changed files with 24 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}