Fix mail import message dialog

This commit is contained in:
Hadi Nategh 2014-07-16 11:37:02 +00:00
parent e44c85e774
commit 1d0db1e05b
5 changed files with 52 additions and 25 deletions

View File

@ -569,7 +569,7 @@ class mail_hooks
);
$file += array(
'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData,false)."','importMessageDialog',870,125,'no','$appname');",
'import message' => "javascript:egw_openWindowCentered2('".egw::link('/index.php', $linkData,false)."','importMessageDialog',600,100,'no','$appname');",
);
}

View File

@ -3322,6 +3322,7 @@ $this->partID = $partID;
/**
* importMessage
* @param array $content = null an array of content
*/
function importMessage($content=null)
{
@ -3330,20 +3331,20 @@ $this->partID = $partID;
if (!empty($content))
{
//error_log(__METHOD__.__LINE__.array2string($content));
if ($content['divImportArea']['vfsfile'])
if ($content['vfsfile'])
{
$file = $content['divImportArea']['vfsfile'] = array(
'name' => egw_vfs::basename($content['divImportArea']['vfsfile']),
'type' => egw_vfs::mime_content_type($content['divImportArea']['vfsfile']),
'file' => egw_vfs::PREFIX.$content['divImportArea']['vfsfile'],
'size' => filesize(egw_vfs::PREFIX.$content['divImportArea']['vfsfile']),
$file = $content['vfsfile'] = array(
'name' => egw_vfs::basename($content['vfsfile']),
'type' => egw_vfs::mime_content_type($content['vfsfile']),
'file' => egw_vfs::PREFIX.$content['vfsfile'],
'size' => filesize(egw_vfs::PREFIX.$content['vfsfile']),
);
}
else
{
$file = $content['divImportArea']['uploadForImport'];
$file = $content['uploadForImport'];
}
$destination = $content['divImportArea']['FOLDER'][0];
$destination = $content['FOLDER'][0];
$importID = mail_bo::getRandomString();
$importFailed = false;
try
@ -3351,7 +3352,7 @@ $this->partID = $partID;
$messageUid = $this->importMessageToFolder($file,$destination,$importID);
$linkData = array
(
'id' => $this->createRowID($destination, $messageUid, true),
'id' => $this->createRowID($destination, $messageUid, true),
);
}
catch (egw_exception_wrong_userinput $e)
@ -3366,8 +3367,8 @@ $this->partID = $partID;
}
}
if (!is_array($content)) $content = array();
if (empty($content['divImportArea']['FOLDER'])) $content['divImportArea']['FOLDER']=(array)$this->mail_bo->getDraftFolder();
if (!empty($content['divImportArea']['FOLDER'])) $sel_options['FOLDER']=mail_compose::ajax_searchFolder(0,true);
if (empty($content['FOLDER'])) $content['FOLDER']=(array)$this->mail_bo->getDraftFolder();
if (!empty($content['FOLDER'])) $sel_options['FOLDER']=mail_compose::ajax_searchFolder(0,true);
$etpl = new etemplate_new('mail.importMessage');
$etpl->setElementAttribute('uploadForImport','onFinish','app.mail.uploadForImport');

View File

@ -683,7 +683,13 @@ div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible {
height: 500px;
overflow: auto;
}
.mail_importMessageFile{
width: 40%;
}
#mail-importMessage .dialogHeader {
font-weight: bold;
font-size:150%;
}
/* MAIL PRINT */
@media print {
.mailDisplayHeaders {

View File

@ -2,17 +2,30 @@
<!-- $Id$ -->
<overlay>
<template id="mail.importMessage" template="" lang="" group="0" version="1.9.001">
<html id="msg"/>
<hbox class="dialogHeader" width="100%" >
<description value="Import message" align="center" class="dialogHeader"/>
</hbox>
<vbox id="divImportArea">
<hbox span="all">
<description value="Store to Folder"/>
<taglist id="FOLDER" width="50%" autocomplete_url='mail.mail_compose.ajax_searchFolder' autocomplete_params='' maxSelection="1" allowFreeEntries="false" onclick="app.mail.address_click"/>
<vfs-select id="vfsfile" mode="open" mime="message/rfc822" onchange="app.mail.vfsUploadForImport"/>
<file statustext="Select file to import into Folder" onFinish="app.mail.uploadForImport" mime="/^message\//i" id="uploadForImport" drop_target ="mail-importMessage_divImportArea"/>
</hbox>
</vbox>>
<grid width="100%">
<columns>
<column width="100"/>
<column/>
</columns>
<rows>
<row class="dialogHeader">
<description value="Import message" align="center" span="all" class="et2_fullWidth"/>
</row>
<row>
<description value="Store to Folder"/>
<taglist id="FOLDER" autocomplete_url='mail.mail_compose.ajax_searchFolder' autocomplete_params='' maxSelection="1" allowFreeEntries="false" onclick="app.mail.address_click"/>
</row>
<row>
<description value="Choose file"/>
<hbox>
<vfs-select id="vfsfile" button_caption = "" mode="open" mime="message/rfc822" onchange="app.mail.vfsUploadForImport"/>
<file statustext="Select file to import into Folder" onFinish="app.mail.uploadForImport" mime="/^message\//i" id="uploadForImport" drop_target ="mail-importMessage" class="mail_importMessageFile"/>
</hbox>
</row>
<row class="dialogFooterToolbar">
<buttononly statustext="Closes this window" label="Close" onclick="window.close();" image="close" background_image="1"/>
</row>
</rows>
</grid>
</template>
</overlay>

View File

@ -676,6 +676,13 @@ div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible {
height: 500px;
overflow: auto;
}
.mail_importMessageFile {
width: 40%;
}
#mail-importMessage .dialogHeader {
font-weight: bold;
font-size: 150%;
}
/* MAIL PRINT */
@media print {
.mailDisplayHeaders {