Alarms for users in a different time zone than the server didn't work, so now the time in the table phpgw_async is stored in the time zone of the server, so that asyncservices can compare time() with this.

This commit is contained in:
alpeb 2004-02-22 20:23:52 +00:00
parent 332edea855
commit db890a0024
4 changed files with 4 additions and 2 deletions

View File

@ -98,6 +98,7 @@
); );
$alarm['id'] = $this->so->save_alarm($cal_id,$alarm); $alarm['id'] = $this->so->save_alarm($cal_id,$alarm);
$event['alarm'][$alarm['id']] = $alarm; $event['alarm'][$alarm['id']] = $alarm;
$event['alarm'][$alarm['id']]['time'] = $alarm['time'] + $this->tz_offset; // allows viewing alarm time in users timezone
return $alarm; return $alarm;
} }

View File

@ -176,6 +176,7 @@
} }
$alarm['cal_id'] = $cal_id; // we need the back-reference $alarm['cal_id'] = $cal_id; // we need the back-reference
$alarm['time'] -= $GLOBALS['phpgw']->datetime->tz_offset; // time should be stored in server timezone
if (!$this->async->set_timer($alarm['time'],$id,'calendar.bocalendar.send_alarm',$alarm)) if (!$this->async->set_timer($alarm['time'],$id,'calendar.bocalendar.send_alarm',$alarm))
{ {
return False; return False;

View File

@ -163,7 +163,7 @@
continue; continue;
} }
$var = Array( $var = Array(
'field' => $GLOBALS['phpgw']->common->show_date($alarm['time']-$this->bo->tz_offset), 'field' => $GLOBALS['phpgw']->common->show_date($alarm['time']),
//'data' => $alarm['text'], //'data' => $alarm['text'],
'data' => lang('Email Notification'), 'data' => lang('Email Notification'),
'owner' => $GLOBALS['phpgw']->common->grab_owner_name($alarm['owner']), 'owner' => $GLOBALS['phpgw']->common->grab_owner_name($alarm['owner']),

View File

@ -3326,7 +3326,7 @@
{ {
$icon = '<img src="'.$GLOBALS['phpgw']->common->image('calendar',($alarm['enabled']?'enabled':'disabled')).'" width="13" height="13">'; $icon = '<img src="'.$GLOBALS['phpgw']->common->image('calendar',($alarm['enabled']?'enabled':'disabled')).'" width="13" height="13">';
$var = Array( $var = Array(
'field' => $icon.$GLOBALS['phpgw']->common->show_date($alarm['time']-$GLOBALS['phpgw']->datetime->tz_offset), 'field' => $icon.$GLOBALS['phpgw']->common->show_date($alarm['time']),
'data' => lang('Email Notification for %1',$GLOBALS['phpgw']->common->grab_owner_name($alarm['owner'])) 'data' => lang('Email Notification for %1',$GLOBALS['phpgw']->common->grab_owner_name($alarm['owner']))
); );
$this->output_template_array($p,'row','list',$var); $this->output_template_array($p,'row','list',$var);