From 199fb3be0f99808fc640da81ee12db2d381f734a Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Tue, 15 Oct 2019 14:29:27 +0200 Subject: [PATCH 1/3] Fix non-numeric value encountered on ical export --- htdocs/comm/action/class/actioncomm.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5803c0afc20..1ce4dce01a0 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1543,6 +1543,19 @@ class ActionComm extends CommonObject $event['uid']='dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"]; $event['type']=$type; $datestart=$this->db->jdate($obj->datep)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); + + // fix for -> Warning: A non-numeric value encountered + if(is_numeric($this->db->jdate($obj->datep2))) + { + $dateend = $this->db->jdate($obj->datep2) + - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600)); + } + else + { + // use start date as fall-back to avoid import erros on empty end date + $datestart = $dateend; + } + $dateend=$this->db->jdate($obj->datep2)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); $duration=($datestart && $dateend)?($dateend - $datestart):0; $event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":""); From 741627897ee2ff709dd59d68787dc60159a27161 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Wed, 16 Oct 2019 13:56:11 +0200 Subject: [PATCH 2/3] fix interchanged allocation --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1ce4dce01a0..42e77c898c3 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1553,7 +1553,7 @@ class ActionComm extends CommonObject else { // use start date as fall-back to avoid import erros on empty end date - $datestart = $dateend; + $dateend = $datestart; } $dateend=$this->db->jdate($obj->datep2)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); From daa7f542951d8a19b409a168f6df7efaa105de6b Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Thu, 17 Oct 2019 08:10:21 +0200 Subject: [PATCH 3/3] fix - not removed old code line --- htdocs/comm/action/class/actioncomm.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 42e77c898c3..9741c7083bb 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1556,7 +1556,6 @@ class ActionComm extends CommonObject $dateend = $datestart; } - $dateend=$this->db->jdate($obj->datep2)-(empty($conf->global->AGENDA_EXPORT_FIX_TZ)?0:($conf->global->AGENDA_EXPORT_FIX_TZ*3600)); $duration=($datestart && $dateend)?($dateend - $datestart):0; $event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":""); $event['desc']=$obj->note;