mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 12:21:26 +02:00
fixing a problem regarding the import of draft-messages with attachments into infolog (, fixing a display issue with getAttachments in uicompose as well)
This commit is contained in:
parent
30dd2980e6
commit
0473f987ad
@ -1426,14 +1426,15 @@ class infolog_ui
|
|||||||
|
|
||||||
if (is_array($_attachments))
|
if (is_array($_attachments))
|
||||||
{
|
{
|
||||||
|
//echo __METHOD__.'<br>';
|
||||||
//_debug_array($_attachments);
|
//_debug_array($_attachments);
|
||||||
|
$bofelamimail = CreateObject('felamimail.bofelamimail',$GLOBALS['egw']->translation->charset());
|
||||||
|
$bopreferences = CreateObject('felamimail.bopreferences');
|
||||||
|
$bofelamimail->openConnection();
|
||||||
foreach ($_attachments as $attachment)
|
foreach ($_attachments as $attachment)
|
||||||
{
|
{
|
||||||
if ($attachment['type'] == 'MESSAGE/RFC822')
|
if ($attachment['type'] == 'MESSAGE/RFC822')
|
||||||
{
|
{
|
||||||
$bofelamimail = CreateObject('felamimail.bofelamimail',$GLOBALS['egw']->translation->charset());
|
|
||||||
$bopreferences = CreateObject('felamimail.bopreferences');
|
|
||||||
$bofelamimail->openConnection();
|
|
||||||
$bofelamimail->reopen($attachment['folder']);
|
$bofelamimail->reopen($attachment['folder']);
|
||||||
|
|
||||||
$mailcontent = self::get_mailcontent($bofelamimail,$attachment['uid'],$attachment['partID'],$attachment['folder']);
|
$mailcontent = self::get_mailcontent($bofelamimail,$attachment['uid'],$attachment['partID'],$attachment['folder']);
|
||||||
@ -1445,6 +1446,17 @@ class infolog_ui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!empty($attachment['folder']))
|
||||||
|
{
|
||||||
|
$is_winmail = $_GET['is_winmail'] ? $_GET['is_winmail'] : 0;
|
||||||
|
$bofelamimail->reopen($attachment['folder']);
|
||||||
|
$attachmentData = $bofelamimail->getAttachment($attachment['uid'],$attachment['partID'],$is_winmail);
|
||||||
|
$attachment['file'] =tempnam($GLOBALS['egw_info']['server']['temp_dir'],$GLOBALS['egw_info']['flags']['currentapp']."_");
|
||||||
|
$tmpfile = fopen($attachment['file'],'w');
|
||||||
|
fwrite($tmpfile,$attachmentData['attachment']);
|
||||||
|
fclose($tmpfile);
|
||||||
|
}
|
||||||
|
|
||||||
$attachments[] = array(
|
$attachments[] = array(
|
||||||
'name' => $attachment['name'],
|
'name' => $attachment['name'],
|
||||||
'mimeType' => $attachment['type'],
|
'mimeType' => $attachment['type'],
|
||||||
@ -1453,6 +1465,7 @@ class infolog_ui
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$bofelamimail->closeConnection();
|
||||||
}
|
}
|
||||||
//_debug_array($attachments);
|
//_debug_array($attachments);
|
||||||
$body = strip_tags($_body);
|
$body = strip_tags($_body);
|
||||||
@ -1502,7 +1515,7 @@ class infolog_ui
|
|||||||
$subject = $bofelamimail->decode_header($headers['SUBJECT']);
|
$subject = $bofelamimail->decode_header($headers['SUBJECT']);
|
||||||
|
|
||||||
$message = self::getdisplayableBody($bofelamimail, $bodyParts);
|
$message = self::getdisplayableBody($bofelamimail, $bodyParts);
|
||||||
|
//echo __METHOD__.'<br>';
|
||||||
//_debug_array($attachments);
|
//_debug_array($attachments);
|
||||||
if (is_array($attachments))
|
if (is_array($attachments))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user