handle attachment area for preview and display, give basic details on attachment(s) on hover with title tag

This commit is contained in:
Klaus Leithoff 2013-10-01 11:29:54 +00:00
parent b6a701ea34
commit 9288d23117
8 changed files with 128 additions and 77 deletions

View File

@ -33,7 +33,7 @@ class mail_compose
'reply' => True, 'reply' => True,
'replyAll' => True, 'replyAll' => True,
'selectFolder' => True, 'selectFolder' => True,
'addAtachment' => True, 'attachFromVFS' => True,
'action' => True 'action' => True
); );
@ -131,6 +131,12 @@ class mail_compose
return strtr ($string, $trans_tbl); return strtr ($string, $trans_tbl);
} }
function attachFromVFS($target, $path=null)
{
error_log(__METHOD__.__LINE__.array2string($path));
return "var path=".json_encode($path)."; opener.app.mail.compose_closeVfsSelector(path);";
}
function action() function action()
{ {
$formData['identity'] = (int)$_POST['identity']; $formData['identity'] = (int)$_POST['identity'];
@ -276,8 +282,18 @@ class mail_compose
{ {
//error_log(__METHOD__.__LINE__.array2string($_REQUEST)); //error_log(__METHOD__.__LINE__.array2string($_REQUEST));
error_log(__METHOD__.__LINE__.array2string($_content)); error_log(__METHOD__.__LINE__.array2string($_content));
$CAtFStart = array2string($_content);
if (isset($_GET['reply_id'])) $replyID = $_GET['reply_id']; if (isset($_GET['reply_id'])) $replyID = $_GET['reply_id'];
if (is_array($_content['uploadForCompose']))
{
foreach ($_content['uploadForCompose'] as $i => &$upload)
{
if (!isset($upload['file'])) $upload['file'] = $upload['tmp_name'];
$tmp_filename = mail_bo::checkFileBasics($upload,'compose',false);
$upload['file'] = $upload['tmp_name'] = $tmp_filename;
}
}
$CAtFStart = array2string($_content);
// read the data from session // read the data from session
// all values are empty for a new compose window // all values are empty for a new compose window
$insertSigOnTop = false; $insertSigOnTop = false;
@ -890,32 +906,6 @@ $CAtFStart = array2string($_content);
$this->t->set_var("toggle_editormode", lang("Editor type").":&nbsp;<span><input name=\"_is_html\" value=\"".$ishtml."\" type=\"hidden\" /><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "checked=\"checked\"" : "")." id=\"_html\" value=\"html\" type=\"radio\"><label for=\"_html\">HTML</label><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "" : "checked=\"checked\"")." id=\"_plain\" value=\"plain\" type=\"radio\"><label for=\"_plain\">Plain text</label></span>"); $this->t->set_var("toggle_editormode", lang("Editor type").":&nbsp;<span><input name=\"_is_html\" value=\"".$ishtml."\" type=\"hidden\" /><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "checked=\"checked\"" : "")." id=\"_html\" value=\"html\" type=\"radio\"><label for=\"_html\">HTML</label><input name=\"_editorselect\" onchange=\"fm_toggle_editor(this)\" onclick=\"fm_toggle_editor(this)\" ".($ishtml ? "" : "checked=\"checked\"")." id=\"_plain\" value=\"plain\" type=\"radio\"><label for=\"_plain\">Plain text</label></span>");
} }
*/ */
// attachments
if (is_array($sessionData['attachments']) && count($sessionData['attachments']) > 0)
{
$imgClearLeft = common::image('felamimail','clear_left');
$tableRows = array();
foreach((array)$sessionData['attachments'] as $id => $attachment) {
$tempArray = array (
'1' => $attachment['name'], '.1' => 'width="40%"',
'2' => mime_magic::mime2label($attachment['type']),
'3' => egw_vfs::hsize($attachment['size']), '.3' => "style='text-align:right;'",
'4' => '&nbsp;', '.4' => 'width="10%"',
'5' => "<img src='$imgClearLeft' onclick=\"fm_compose_deleteAttachmentRow(this,'".$this->composeID."','$id')\">",
);
$tableRows[] = $tempArray;
}
if(count($tableRows) > 0) {
$table = html::table($tableRows, "style='width:100%'");
}
// $this->t->set_var('attachment_rows',$table);
}
else
{
// $this->t->set_var('attachment_rows','');
}
// signature stuff set earlier // signature stuff set earlier
$sel_options['signatureID'] = $selectSignatures; $sel_options['signatureID'] = $selectSignatures;
$content['signatureID'] = ($presetSig ? $presetSig : $sessionData['signatureID']); $content['signatureID'] = ($presetSig ? $presetSig : $sessionData['signatureID']);

View File

@ -81,23 +81,23 @@ class mail_hooks
'menuaction' => 'mail.mail_ui.displayMessage', 'menuaction' => 'mail.mail_ui.displayMessage',
), ),
'view_id' => 'id', 'view_id' => 'id',
'view_popup' => '850xegw_getWindowOuterHeight()', 'view_popup' => '870xegw_getWindowOuterHeight()',
'view_list' => 'mail.mail_ui.index', 'view_list' => 'mail.mail_ui.index',
'add' => array( 'add' => array(
'menuaction' => 'mail.mail_compose.compose', 'menuaction' => 'mail.mail_compose.compose',
), ),
'add_popup' => '850xegw_getWindowOuterHeight()', 'add_popup' => '870xegw_getWindowOuterHeight()',
'edit' => array( 'edit' => array(
'menuaction' => 'mail.mail_compose.compose', 'menuaction' => 'mail.mail_compose.compose',
), ),
'edit_id' => 'id', 'edit_id' => 'id',
'edit_popup' => '850xegw_getWindowOuterHeight()', 'edit_popup' => '870xegw_getWindowOuterHeight()',
// register fmail as handler for .eml files // register fmail as handler for .eml files
'mime' => array( 'mime' => array(
'message/rfc822' => array( 'message/rfc822' => array(
'menuaction' => 'felamimail.uifelamimail.importMessageFromVFS2DraftAndDisplay', 'menuaction' => 'felamimail.uifelamimail.importMessageFromVFS2DraftAndDisplay',
//'menuaction' => 'mail.mail_ui.importMessageFromVFS2DraftAndDisplay', //'menuaction' => 'mail.mail_ui.importMessageFromVFS2DraftAndDisplay',
'mime_popup' => '850xegw_getWindowOuterHeight()', 'mime_popup' => '870xegw_getWindowOuterHeight()',
'mime_url' => 'formData[file]', 'mime_url' => 'formData[file]',
), ),
), ),
@ -836,7 +836,7 @@ class mail_hooks
); );
$file += array( $file += array(
'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData,false)."','importMessageDialog',700,125,'no','$appname');", 'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData,false)."','importMessageDialog',870,125,'no','$appname');",
); );
} }

View File

@ -1155,7 +1155,6 @@ unset($query['actions']);
//error_log(__METHOD__.__LINE__.array2string($rows)); //error_log(__METHOD__.__LINE__.array2string($rows));
$endtime = microtime(true) - $starttime; $endtime = microtime(true) - $starttime;
//error_log(__METHOD__.__LINE__.' SelectedFolder:'.$query['selectedFolder'].' Start:'.$query['start'].' NumRows:'.$query['num_rows'].' Took:'.$endtime); //error_log(__METHOD__.__LINE__.' SelectedFolder:'.$query['selectedFolder'].' Start:'.$query['start'].' NumRows:'.$query['num_rows'].' Took:'.$endtime);
return $rowsFetched['messages']; return $rowsFetched['messages'];
} }
@ -1335,6 +1334,8 @@ unset($query['actions']);
} }
//_debug_array($header); //_debug_array($header);
$imageTag = '';
$imageHTMLBlock = '';
if (in_array("attachments", $cols)) if (in_array("attachments", $cols))
{ {
if($header['mimetype'] == 'multipart/mixed' || if($header['mimetype'] == 'multipart/mixed' ||
@ -1348,16 +1349,9 @@ unset($query['actions']);
substr($header['mimetype'],0,5) == 'video' || substr($header['mimetype'],0,5) == 'video' ||
$header['mimetype'] == 'multipart/alternative') $header['mimetype'] == 'multipart/alternative')
{ {
$linkDataAttachments = array (
'menuaction' => 'mail.uidisplay.displayAttachments',
'showHeader' => 'false',
'mailbox' => base64_encode($_folderName),
'uid' => $header['uid'],
'id' => $header['id'],
);
$windowName = 'displayMessage_'.$header['uid'];
$image = html::image('mail','attach'); $image = html::image('mail','attach');
$imageTag = '';
$imageHTMLBlock = '';
if (//$header['mimetype'] != 'multipart/mixed' && if (//$header['mimetype'] != 'multipart/mixed' &&
$header['mimetype'] != 'multipart/signed' $header['mimetype'] != 'multipart/signed'
) )
@ -1368,11 +1362,23 @@ unset($query['actions']);
$this->mail_bo->reopen($_folderName); $this->mail_bo->reopen($_folderName);
} }
$attachments = $this->mail_bo->getMessageAttachments($header['uid'],$_partID='', $_structure='', $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=false); $attachments = $this->mail_bo->getMessageAttachments($header['uid'],$_partID='', $_structure='', $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=false);
if (count($attachments)<1) $image = '&nbsp;'; if (count($attachments)<1)
{
$image = '&nbsp;';
}
if (count($attachments)==1)
{
$imageHTMLBlock = self::createAttachmentBlock($attachments, $data['row_id'], $header['uid'], $_folder);
$imageTag = json_encode($attachments);
$image = html::image('mail','attach',$attachments[0]['name'].(!empty($attachments[0]['mimeType'])?' ('.$attachments[0]['mimeType'].')':''));
}
}
if (count($attachments)>1)
{
$imageHTMLBlock = self::createAttachmentBlock($attachments, $data['row_id'], $header['uid'], $_folder);
$imageTag = json_encode($attachments);
$image = html::image('mail','attach',lang('%1 attachments',count($attachments)));
} }
if (count($attachments)>0) $image = "<a name=\"subject_url\" href=\"#\"
onclick=\"fm_handleAttachmentClick(false,'".$GLOBALS['egw']->link('/index.php',$linkDataAttachments)."', '".$windowName."', this); return false;\"
title=\"".$header['subject']."\">".$image."</a>";
$attachmentFlag = $image; $attachmentFlag = $image;
} else { } else {
@ -1408,7 +1414,7 @@ unset($query['actions']);
} }
$linkData = array $linkData = array
( (
'menuaction' => 'mail.uicompose.compose', 'menuaction' => 'mail.mail_compose.compose',
'send_to' => base64_encode($senderAddress) 'send_to' => base64_encode($senderAddress)
); );
$windowName = 'compose_'.$header['uid']; $windowName = 'compose_'.$header['uid'];
@ -1456,7 +1462,7 @@ unset($query['actions']);
/* /*
$linkData = array $linkData = array
( (
'menuaction' => 'mail.uicompose.compose', 'menuaction' => 'mail.mail_compose.compose',
'send_to' => base64_encode($senderAddress) 'send_to' => base64_encode($senderAddress)
); );
$windowName = 'compose_'.$header['uid']; $windowName = 'compose_'.$header['uid'];
@ -1467,14 +1473,6 @@ unset($query['actions']);
} }
if (in_array("date", $cols)) if (in_array("date", $cols))
{ {
/*
if ($dateToday == mail_bo::_strtotime($header['date'],'Y-m-d')) {
$dateShort = mail_bo::_strtotime($header['date'],($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']==12?'h:i:s a':'H:i:s'));
} else {
$dateShort = mail_bo::_strtotime($header['date'],str_replace('Y','y',$GLOBALS['egw_info']['user']['preferences']['common']['dateformat']).' '.
($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == 12 ? 'h:i a' : 'H:i'));
}
*/
$data["date"] = $header['date'];//$dateShort;//'<nobr><span style="font-size:10px" title="'.$dateLong.'">'.$dateShort.'</span></nobr>'; $data["date"] = $header['date'];//$dateShort;//'<nobr><span style="font-size:10px" title="'.$dateLong.'">'.$dateShort.'</span></nobr>';
} }
if (in_array("modified", $cols)) if (in_array("modified", $cols))
@ -1496,6 +1494,8 @@ unset($query['actions']);
//$this->t->set_var('phpgw_images',EGW_IMAGES); //$this->t->set_var('phpgw_images',EGW_IMAGES);
//$result["data"] = $data; //$result["data"] = $data;
$data["class"] = implode(' ', $css_styles); $data["class"] = implode(' ', $css_styles);
$data['attachmentsPresent'] = $imageTag;
$data['attachmentsBlock'] = $imageHTMLBlock;
$rv[] = $data; $rv[] = $data;
//error_log(__METHOD__.__LINE__.array2string($result)); //error_log(__METHOD__.__LINE__.array2string($result));
} }
@ -1773,7 +1773,7 @@ unset($query['actions']);
break; break;
} }
//error_log(__METHOD__.__LINE__.$linkView); //error_log(__METHOD__.__LINE__.$linkView);
$attachmentHTML[$key]['link_view'] = '<a href="#" onclick="'.$linkView.' return false;"><b>'. $attachmentHTML[$key]['link_view'] = '<a href="#" ." title="'.$attachmentHTML[$key]['filename'].'" onclick="'.$linkView.' return false;"><b>'.
($value['name'] ? ( $filename ? $filename : $value['name'] ) : lang('(no subject)')). ($value['name'] ? ( $filename ? $filename : $value['name'] ) : lang('(no subject)')).
'</b></a>'; '</b></a>';
@ -1823,7 +1823,7 @@ unset($query['actions']);
$attachmentHTMLBlock="<table width='100%'>"; $attachmentHTMLBlock="<table width='100%'>";
foreach ((array)$attachmentHTML as $row) foreach ((array)$attachmentHTML as $row)
{ {
$attachmentHTMLBlock .= "<tr><td>".$row['link_view'].'</td>'; $attachmentHTMLBlock .= "<tr><td><div class='useEllipsis'>".$row['link_view'].'</div></td>';
$attachmentHTMLBlock .= "<td>".$row['mimetype'].'</td>'; $attachmentHTMLBlock .= "<td>".$row['mimetype'].'</td>';
$attachmentHTMLBlock .= "<td>".$row['size'].'</td>'; $attachmentHTMLBlock .= "<td>".$row['size'].'</td>';
$attachmentHTMLBlock .= "<td>".$row['link_save'].'</td></tr>'; $attachmentHTMLBlock .= "<td>".$row['link_save'].'</td></tr>';

View File

@ -80,6 +80,8 @@ app.mail = AppJS.extend(
case 'mail.display': case 'mail.display':
isDisplay=true; isDisplay=true;
break; break;
case 'mail.compose':
} }
} }
//alert('action about to go down'); //alert('action about to go down');
@ -91,14 +93,14 @@ app.mail = AppJS.extend(
body.node.parentNode.style.top=subject.node.offsetTop+40+'px'; body.node.parentNode.style.top=subject.node.offsetTop+40+'px';
var app_registry = egw.link_get_registry(this.appname); var app_registry = egw.link_get_registry(this.appname);
//console.log(app_registry); //console.log(app_registry);
w=850; w=870;
if (typeof app_registry['view'] != 'undefined' && typeof app_registry['view_popup'] != 'undefined' ) if (typeof app_registry['view'] != 'undefined' && typeof app_registry['view_popup'] != 'undefined' )
{ {
var w_h =app_registry['view_popup'].split('x'); var w_h =app_registry['view_popup'].split('x');
if (w_h[1] == 'egw_getWindowOuterHeight()') w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight()); if (w_h[1] == 'egw_getWindowOuterHeight()') w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight());
} }
//alert('resizing to'+(w_h[0]?w_h[0]:850)+','+(w_h[1]?w_h[1]:egw_getWindowOuterHeight())); //alert('resizing to'+(w_h[0]?w_h[0]:870)+','+(w_h[1]?w_h[1]:egw_getWindowOuterHeight()));
window.resizeTo((w_h[0]?w_h[0]:850),(w_h[1]?w_h[1]:(screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight()))); window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight())));
} }
}, },
@ -224,25 +226,25 @@ app.mail = AppJS.extend(
{ {
url += 'menuaction=mail.mail_compose.composeFromDraft'; url += 'menuaction=mail.mail_compose.composeFromDraft';
url += '&id='+_elems[0].id; url += '&id='+_elems[0].id;
egw_openWindowCentered(url,'composeasnew_'+_elems[0].id,700,egw_getWindowOuterHeight()); egw_openWindowCentered(url,'composeasnew_'+_elems[0].id,870,egw_getWindowOuterHeight());
} }
if (_action.id == 'composeasnew') if (_action.id == 'composeasnew')
{ {
url += 'menuaction=mail.mail_compose.composeAsNew'; url += 'menuaction=mail.mail_compose.composeAsNew';
url += '&reply_id='+_elems[0].id; url += '&reply_id='+_elems[0].id;
egw_openWindowCentered(url,'composeasnew_'+_elems[0].id,700,egw_getWindowOuterHeight()); egw_openWindowCentered(url,'composeasnew_'+_elems[0].id,870,egw_getWindowOuterHeight());
} }
if (_action.id == 'reply') if (_action.id == 'reply')
{ {
url += 'menuaction=mail.mail_compose.reply'; url += 'menuaction=mail.mail_compose.reply';
url += '&reply_id='+_elems[0].id; url += '&reply_id='+_elems[0].id;
egw_openWindowCentered(url,'reply_'+_elems[0].id,700,egw_getWindowOuterHeight()); egw_openWindowCentered(url,'reply_'+_elems[0].id,870,egw_getWindowOuterHeight());
} }
if (_action.id == 'reply_all') if (_action.id == 'reply_all')
{ {
url += 'menuaction=mail.mail_compose.replyAll'; url += 'menuaction=mail.mail_compose.replyAll';
url += '&reply_id='+_elems[0].id; url += '&reply_id='+_elems[0].id;
egw_openWindowCentered(url,'replyAll_'+_elems[0].id,700,egw_getWindowOuterHeight()); egw_openWindowCentered(url,'replyAll_'+_elems[0].id,870,egw_getWindowOuterHeight());
} }
if (_action.id == 'forward'||_action.id == 'forwardinline'||_action.id == 'forwardasattach') if (_action.id == 'forward'||_action.id == 'forwardinline'||_action.id == 'forwardasattach')
{ {
@ -256,7 +258,7 @@ app.mail = AppJS.extend(
url += 'menuaction=mail.mail_compose.forward'; url += 'menuaction=mail.mail_compose.forward';
url += '&reply_id='+_elems[0].id; url += '&reply_id='+_elems[0].id;
url += '&mode=forwardinline'; url += '&mode=forwardinline';
egw_openWindowCentered(url,'forward_'+_elems[0].id,700,egw_getWindowOuterHeight()); egw_openWindowCentered(url,'forward_'+_elems[0].id,870,egw_getWindowOuterHeight());
} }
} }
}, },
@ -331,7 +333,7 @@ app.mail = AppJS.extend(
sMessageList= 'AsForward&forwardmails=1&folder='+activeFolderB64+'&reply_id='+sMessageList.substring(0,sMessageList.length-1); sMessageList= 'AsForward&forwardmails=1&folder='+activeFolderB64+'&reply_id='+sMessageList.substring(0,sMessageList.length-1);
} }
//alert(sMessageList); //alert(sMessageList);
egw_openWindowCentered(_url+sMessageList,'compose',700,egw_getWindowOuterHeight()); egw_openWindowCentered(_url+sMessageList,'compose',870,egw_getWindowOuterHeight());
} }
//ToDo: reset message selection //ToDo: reset message selection
}, },
@ -381,6 +383,10 @@ app.mail = AppJS.extend(
var _id = this.mail_fetchCurrentlyFocussed(selected); var _id = this.mail_fetchCurrentlyFocussed(selected);
dataElem = egw.dataGetUIDdata(_id); dataElem = egw.dataGetUIDdata(_id);
} }
//get_class does not exist yet
//var pAAClass = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').get_class();
//console.log(pAAClass);
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_class('previewAttachmentArea');
if(typeof selected == 'undefined' || selected.length == 0 || selected.length > 1 || typeof dataElem =='undefined') if(typeof selected == 'undefined' || selected.length == 0 || selected.length > 1 || typeof dataElem =='undefined')
{ {
this.mail_fetchCurrentlyFocussed(); this.mail_fetchCurrentlyFocussed();
@ -389,6 +395,8 @@ app.mail = AppJS.extend(
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewToAddress').set_value(""); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewToAddress').set_value("");
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewDate').set_value(""); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewDate').set_value("");
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewSubject').set_value(""); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewSubject').set_value("");
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_value("");
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_class('previewAttachmentArea noContent');
var IframeHandle = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('messageIFRAME'); var IframeHandle = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('messageIFRAME');
IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:""})); IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:""}));
this.mail_disablePreviewArea(true); this.mail_disablePreviewArea(true);
@ -402,7 +410,10 @@ app.mail = AppJS.extend(
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewToAddress').set_value(dataElem.data.toaddress); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewToAddress').set_value(dataElem.data.toaddress);
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewDate').set_value(dataElem.data.date); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewDate').set_value(dataElem.data.date);
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewSubject').set_value(subject); etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewSubject').set_value(subject);
etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_value((dataElem.data.attachmentsBlock.length>1?dataElem.data.attachmentsBlock:''));
if (dataElem.data.attachmentsBlock.length<1) etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('previewAttachmentArea').set_class('previewAttachmentArea noContent');
var IframeHandle = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('messageIFRAME'); var IframeHandle = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('messageIFRAME');
//console.log(IframeHandle);
IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:_id})); IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:_id}));
var messages = {}; var messages = {};
messages['msg'] = [_id]; messages['msg'] = [_id];
@ -844,7 +855,7 @@ app.mail = AppJS.extend(
*/ */
mail_displayHeaderLines: function(_url) { mail_displayHeaderLines: function(_url) {
// only used by right clickaction // only used by right clickaction
egw_openWindowCentered(_url,'mail_display_headerLines','700','600',window.outerWidth/2,window.outerHeight/2); egw_openWindowCentered(_url,'mail_display_headerLines','870','600',window.outerWidth/2,window.outerHeight/2);
}, },
/** /**
@ -1174,14 +1185,16 @@ app.mail = AppJS.extend(
}, },
import_displayVfsSelector: function(_ref) { import_displayVfsSelector: function(_ref) {
var ref = this.et2.getWidgetById(_ref); //var ref = this.et2.getWidgetById(_ref);
//console.log(ref); //console.log(ref);
cInst= this.et2.getInstanceManager();
console.log(cInst);
this.mail_fileSelectorWindow = egw().open_link(egw.link('/index.php', { this.mail_fileSelectorWindow = egw().open_link(egw.link('/index.php', {
menuaction: 'filemanager.filemanager_select.select', menuaction: 'filemanager.filemanager_select.select',
mode: 'open', mode: (_ref=='import'?'open':'open-multiple'),
method: 'mail.mail_ui.setImportMessageFromVFS', method: (_ref=='import'?'mail.mail_ui.setImportMessageFromVFS':'mail.mail_compose.attachFromVFS'),
id: ref.value[0],//represents the target where to import to id: _ref,//represents the target where to import to
}), 'mail_import_vfsSelector', '640x580'); }), 'mail_'+(_ref=='import'?'import':'compose')+'_vfsSelector', '640x580');
}, },
import_closeVfsSelector: function(_ref) { import_closeVfsSelector: function(_ref) {
@ -1204,6 +1217,25 @@ app.mail = AppJS.extend(
//vfsfile._parent._parent._parent.parentNode.et2_obj.submit(); //vfsfile._parent._parent._parent.parentNode.et2_obj.submit();
}, },
compose_closeVfsSelector: function(_ref) {
// names used here to access the popupwindows must be available, else it fails
// names used here are assigned in app.mail.import_displayVfsSelector and class.mail_hooks.inc.php
this.mail_fileSelectorWindow = window.open('','mail_compose_vfsSelector');
this.mail_fileSelectorWindow.close();
var vfsfile = this.et2.getWidgetById('vfsfile');
console.log(vfsfile);
console.log(_ref);
//vfsfile.input[0].value=_ref;
//console.log(vfsfile.input[0].value,folder.value[0]);
//composeMessageDialog = egw().open_link(egw.link('/index.php', {
// menuaction: 'mail.mail_compose.compose',
// file: vfsfile.input[0].value
//}), 'importMessageDialog', '640x580');
//composeMessageDialog.focus();
//vfsfile._parent._parent._parent.parentNode.et2_obj.submit();
},
/** /**
* Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename * Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename
* *

View File

@ -277,6 +277,12 @@ pre {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
} }
.useEllipsis {
text-overflow: ellipsis;
width: 250px;
white-space: nowrap;
overflow: hidden;
}
/* /*
influence the tree display and scrolling behavior influence the tree display and scrolling behavior
*/ */
@ -326,11 +332,29 @@ input[type=button] {
#mail-index_mailPreviewContainer { #mail-index_mailPreviewContainer {
position: absolute; position: absolute;
border: 1px solid silver; border: 1px solid silver;
top: 55px; top: 60px;
bottom: 0; bottom: 0;
left: 3px; left: 3px;
right: 0; right: 0;
} }
#mail-index_previewAttachmentArea {
background-color:#efefdf;
max-height: 10%;
max-width: 50%;
position: absolute;
overflow:scroll;
overflow-x:hidden;
right: 0;
top: 25px;
border: 1px solid red;
opacity: 1;
-moz-opacity:1:
filter: Alpha(opacity=100);
}
#mail-index_previewAttachmentArea.noContent {
border:0px !important;
}
.mailDisplayContainer, .mailDisplayAttachments { .mailDisplayContainer, .mailDisplayAttachments {
display: block; display: block;
display: -moz-inline-stack; display: -moz-inline-stack;

View File

@ -10,6 +10,8 @@
</hbox> </hbox>
<hbox> <hbox>
<button label="Submit" id="button[apply]"/><button label="Save" id="button[save]"/> <button label="Submit" id="button[apply]"/><button label="Save" id="button[save]"/>
<buttononly id="selectFromVFSForCompose" value="Select" image="filemanager/navbar" onclick="app.mail.import_displayVfsSelector('compose')" />
<textbox align="left" width="1px" id="vfsfile" />
<file statustext="Select file to attach to message" multiple='true' progress='mailUploadProgress' onFinish="app.mail.uploadForCompose" id="uploadForCompose" drop_target ="mailUploadSection"/> <file statustext="Select file to attach to message" multiple='true' progress='mailUploadProgress' onFinish="app.mail.uploadForCompose" id="uploadForCompose" drop_target ="mailUploadSection"/>
</hbox> </hbox>
<hbox class="mailComposeHeaders" width="99%"> <hbox class="mailComposeHeaders" width="99%">
@ -56,7 +58,7 @@
<menupopup id="stationeryID"/> <menupopup id="stationeryID"/>
</menulist> </menulist>
</groupbox> </groupbox>
<groupbox class="et2_file" id='mailUploadSection'> <groupbox class="et2_file mailUploadSection">
<caption label="Files"/> <caption label="Files"/>
<box class="mailUploadProgress" id="mailUploadProgress" width="97%"/> <box class="mailUploadProgress" id="mailUploadProgress" width="97%"/>
<grid disabled="@no_griddata" id="attachments" width="100%" maxheight="165" overflow="auto"> <grid disabled="@no_griddata" id="attachments" width="100%" maxheight="165" overflow="auto">

View File

@ -15,7 +15,7 @@
</hbox> </hbox>
<hbox span="all"> <hbox span="all">
<description value="Select from EGroupware Filestore"/> <textbox align="left" width="30%" id="vfsfile" /> <description value="Select from EGroupware Filestore"/> <textbox align="left" width="30%" id="vfsfile" />
<buttononly id="selectFromVFSForImport" value="Select" image="filemanager/navbar" onclick="app.mail.import_displayVfsSelector('FOLDER')" /> <buttononly id="selectFromVFSForImport" value="Select" image="filemanager/navbar" onclick="app.mail.import_displayVfsSelector('import')" />
</hbox> </hbox>
</vbox>> </vbox>>
</template> </template>

View File

@ -61,6 +61,9 @@
<description value="Subject"/> <description value="Subject"/>
<description align="left" id="previewSubject" readonly="true"/> <description align="left" id="previewSubject" readonly="true"/>
</hbox> </hbox>
<hbox class="previewAttachmentArea">
<html id="previewAttachmentArea"/>
</hbox>
<hbox id="mailPreviewIcons"> <hbox id="mailPreviewIcons">
<description value="Icons"/> <description value="Icons"/>
</hbox> </hbox>