From de947ef4662ce0b63de3a3ca6eb69a0cd29271b0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 24 Mar 2010 08:15:36 +0000 Subject: [PATCH] "fix an other case of empty enddate get set to \"something\"" --- infolog/inc/class.infolog_bo.inc.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index 4b93eff06f..d63b4bc9b2 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -711,7 +711,7 @@ class infolog_bo $status = 'done'; if (isset($values['info_type']) && !in_array($values['info_status'],array('done','billed','cancelled'))) { $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'])) { $forcestatus = true; $status = 'done'; @@ -791,17 +791,24 @@ class infolog_bo { // convert user- to server-time $this->time2time($to_write, null, false); - $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'); + + if (!empty($values['info_enddate'])) + { + $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 { - $time = new egw_time($values['info_enddate'], egw_time::$server_timezone); - // Set due date to 00:00 - $time->setTime(0, 0, 0); - $to_write['info_enddate'] = egw_time::to($time,'ts'); + if (!empty($values['info_enddate'])) + { + $time = new egw_time($values['info_enddate'], egw_time::$server_timezone); + // 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 $this->time2time($values); }