"fix an other case of empty enddate get set to \"something\""

This commit is contained in:
Ralf Becker 2010-03-24 08:15:36 +00:00
parent 8d033f95f8
commit de947ef466

View File

@ -711,7 +711,7 @@ class infolog_bo
$status = 'done'; $status = 'done';
if (isset($values['info_type']) && !in_array($values['info_status'],array('done','billed','cancelled'))) { if (isset($values['info_type']) && !in_array($values['info_status'],array('done','billed','cancelled'))) {
$forcestatus = false; $forcestatus = false;
echo "set_completed:"; _debug_array($this->status[$values['info_type']]); //echo "set_completed:"; _debug_array($this->status[$values['info_type']]);
if (isset($this->status[$values['info_type']]['done'])) { if (isset($this->status[$values['info_type']]['done'])) {
$forcestatus = true; $forcestatus = true;
$status = 'done'; $status = 'done';
@ -791,17 +791,24 @@ class infolog_bo
{ {
// convert user- to server-time // convert user- to server-time
$this->time2time($to_write, null, false); $this->time2time($to_write, null, false);
$time = new egw_time($values['info_enddate'], egw_time::$user_timezone);
// Set due date to 00:00 if (!empty($values['info_enddate']))
$time->setTime(0, 0, 0); {
$values['info_enddate'] = egw_time::to($time,'ts'); $time = new egw_time($values['info_enddate'], egw_time::$user_timezone);
// Set due date to 00:00
$time->setTime(0, 0, 0);
$values['info_enddate'] = egw_time::to($time,'ts');
}
} }
else else
{ {
$time = new egw_time($values['info_enddate'], egw_time::$server_timezone); if (!empty($values['info_enddate']))
// Set due date to 00:00 {
$time->setTime(0, 0, 0); $time = new egw_time($values['info_enddate'], egw_time::$server_timezone);
$to_write['info_enddate'] = egw_time::to($time,'ts'); // Set due date to 00:00
$time->setTime(0, 0, 0);
$to_write['info_enddate'] = egw_time::to($time,'ts');
}
// convert server- to user-time // convert server- to user-time
$this->time2time($values); $this->time2time($values);
} }