something to maintain users status when editing existing events

This commit is contained in:
skeeter 2001-03-12 03:44:43 +00:00
parent 629790873c
commit 82dc6f2b07
2 changed files with 8 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class calendar__
$phpgw_info['user']['preferences']['common']['dateformat'] = $temp_dateformat; $phpgw_info['user']['preferences']['common']['dateformat'] = $temp_dateformat;
} }
function prepare_recipients($new_event,$old_event) function prepare_recipients(&$new_event,$old_event)
{ {
for($i=0;$i<count($old_event->participants);$i++) for($i=0;$i<count($old_event->participants);$i++)
{ {
@ -161,6 +161,7 @@ class calendar__
{ {
$delete = False; $delete = False;
$this->modified[] = $new_event->participants[$k]; $this->modified[] = $new_event->participants[$k];
$new_event->status[$k] = $old_event->status[$i];
} }
} }
if($delete == True) if($delete == True)
@ -181,6 +182,7 @@ class calendar__
if($add == True) if($add == True)
{ {
$this->added[] = $new_event->participants[$i]; $this->added[] = $new_event->participants[$i];
$new_event->status[$i] = 'U';
} }
} }

View File

@ -849,13 +849,17 @@ class calendar_ extends calendar__
$this->stream->query('DELETE FROM calendar_entry_user WHERE cal_id='.$event->id,__LINE__,__FILE__); $this->stream->query('DELETE FROM calendar_entry_user WHERE cal_id='.$event->id,__LINE__,__FILE__);
reset($event->participants);
while ($participant = each($event->participants)) while ($participant = each($event->participants))
{ {
$status = 'U';
if(intval($participant[1]) == intval($this->user)) if(intval($participant[1]) == intval($this->user))
{ {
$status = 'A'; $status = 'A';
} }
else
{
$status = $event->status[$participant[0]];
}
$this->stream->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) ' $this->stream->query('INSERT INTO calendar_entry_user(cal_id,cal_login,cal_status) '
. 'VALUES('.$event->id.','.$participant[1].",'".$status."')",__LINE__,__FILE__); . 'VALUES('.$event->id.','.$participant[1].",'".$status."')",__LINE__,__FILE__);
} }