From eec9fa33ac1466b0eae12494ea4717e16f61fca4 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 3 Mar 2016 14:27:05 +0000 Subject: [PATCH] * Mail: fix for problem when retrieving and displaying an event from winmail.dat attachment --- mail/inc/class.mail_ui.inc.php | 36 ++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index a373871135..67eaecbf2b 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2755,30 +2755,20 @@ $filter['before']= date("d-M-Y", $cutoffdate2); { if (strtolower($attach['mimeType']) == 'text/calendar' && isset($GLOBALS['egw_info']['user']['apps']['calendar']) && - ($attachment = $this->mail_bo->getAttachment($uid, $attach['partID'],0,(strtolower($attach['mimeType']) == 'text/calendar'?false:true)))) + ($attachment = $this->mail_bo->getAttachment($uid, $attach['partID'],$attach['is_winmail'],(strtolower($attach['mimeType']) == 'text/calendar'?false:true)))) { - $ical = new calendar_ical(); - $ical_charset = $attach['charset'] ? $attach['charset'] : 'utf-8'; - if (($events = $ical->icaltoegw($attachment['attachment'], '', $ical_charset))) - { - //error_log(__METHOD__.__LINE__.array2string($attachment)); - egw_cache::setSession('calendar', 'ical', array( - 'charset' => $attach['charset'] ? $attach['charset'] : 'utf-8', - 'attachment' => $attachment['attachment'], - 'method' => $attach['method'], - 'sender' => $mailbox, - )); - $this->mail_bo->htmlOptions = $bufferHtmlOptions; - translation::add_app('calendar'); - return ExecMethod( 'calendar.calendar_uiforms.meeting', - array('event'=>null,'msg'=>'','useSession'=>true) - ); - } - else - { - error_log(__METHOD__.__LINE__.'Cannot import the following as ical:'.array2string($attachment)); - //$bodyParts[] = array('body'=>$attachment['attachment'], 'charSet'=>$attach['charset'] ? $attach['charset'] : 'utf-8'); - } + //error_log(__METHOD__.__LINE__.array2string($attachment)); + egw_cache::setSession('calendar', 'ical', array( + 'charset' => $attach['charset'] ? $attach['charset'] : 'utf-8', + 'attachment' => $attachment['attachment'], + 'method' => $attach['method'], + 'sender' => $mailbox, + )); + $this->mail_bo->htmlOptions = $bufferHtmlOptions; + translation::add_app('calendar'); + return ExecMethod( 'calendar.calendar_uiforms.meeting', + array('event'=>null,'msg'=>'','useSession'=>true) + ); } } // Compose the content of the frame