Merge pull request #12141 from TobiasSekan/FixNoneNumericValue

Fix non-numeric value encountered on ical export
This commit is contained in:
Laurent Destailleur 2019-10-17 17:39:25 +02:00 committed by GitHub
commit 1a021e85f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1543,7 +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));
$dateend=$this->db->jdate($obj->datep2)-(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
$dateend = $datestart;
}
$duration=($datestart && $dateend)?($dateend - $datestart):0;
$event['summary']=$obj->label.($obj->socname?" (".$obj->socname.")":"");
$event['desc']=$obj->note;