make mailattachments of type message/rfc822 clickable on compose

This commit is contained in:
Klaus Leithoff 2014-01-31 10:21:58 +00:00
parent 6c8c58f5c6
commit 7c28c6c016
3 changed files with 19 additions and 5 deletions

View File

@ -3999,7 +3999,7 @@ class mail_bo
//error_log(__METHOD__.__LINE__.":$_uid,$_partID,$decode,$_folder".function_backtrace());
if (empty($_folder)) $_folder = ($this->sessionData['mailbox']? $this->sessionData['mailbox'] : $this->icServer->getCurrentMailbox());
//error_log(__METHOD__.__LINE__.":$_uid,$_partID,$decode,$_folder");
if(empty($_partID)) {
if(empty($_partID)||$_partID=='null') {
$uidsToFetch = new Horde_Imap_Client_Ids();
if (!(is_object($_uid) || is_array($_uid))) $_uid = (array)$_uid;
$uidsToFetch->add($_uid);

View File

@ -328,6 +328,9 @@ class mail_compose
$keysToDelete = array();
if (!empty($_content['attachments']['delete']))
{
//error_log(__METHOD__.__LINE__.':'.array2string($_content['attachments']));
//error_log(__METHOD__.__LINE__.':'.array2string($_content['attachments']['delete']));
$suppressSigOnTop = true;
$toDelete = $_content['attachments']['delete'];
unset($_content['attachments']['delete']);
@ -1723,7 +1726,8 @@ class mail_compose
'name' => $_name,
'type' => $_type,
'size' => $_size,
'folder' => $_folder
'folder' => $_folder,
'tmp_name' => mail_ui::generateRowID($this->mail_bo->profileID, $_folder, $_uid),
);
}
@ -1735,7 +1739,7 @@ class mail_compose
//if(isset($_GET['size'])) $attachment['size'] = $_GET['size'];
if(isset($_GET['type'])) $attachment['type'] = $_GET['type'];
error_log(__METHOD__.__LINE__.array2string($_GET));
//error_log(__METHOD__.__LINE__.array2string($_GET));
if (isset($attachment['filename']) && parse_url($attachment['filename'],PHP_URL_SCHEME) == 'vfs')
{
egw_vfs::load_wrapper('vfs');

View File

@ -1443,8 +1443,18 @@ app.classes.mail = AppJS.extend(
}
else
{
// CALLED FOR COMPOSE; processedmail_id could hold several IDs seperated by comma
attgrid = this.et2.getArrayMgr("content").getEntry('attachments')[widget.id.replace(/\[name\]/,'')];
mailid = this.et2.getArrayMgr("content").getEntry('processedmail_id');
var mailids = this.et2.getArrayMgr("content").getEntry('processedmail_id');
var mailida = mailids.split(',');
mailid = mailida[widget.id.replace(/\[name\]/,'')];
if (typeof attgrid.uid != 'undefined' && attgrid.uid && mailid.indexOf(attgrid.uid)==-1)
{
for (i=0; i<mailida.length; i++)
{
if (mailida[i].indexOf('::'+attgrid.uid)>-1) mailid = mailida[i];
}
}
}
//console.log(mailid,attgrid.partID,attgrid.filename,attgrid.mimetype);
var url = window.egw_webserverUrl+'/index.php?';
@ -1539,7 +1549,7 @@ app.classes.mail = AppJS.extend(
var attgrid;
attgrid = this.et2.getArrayMgr("content").getEntry('attachments')[widget.id.replace(/\[name\]/,'')];
//console.log(attgrid);
if (attgrid.uid && attgrid.partID)
if (attgrid.uid && (attgrid.partID||attgrid.folder))
{
this.displayAttachment(tag_info, widget, true);
return;