From 1d0db1e05bf218fa6c0b8c22f39186ec39971acb Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 16 Jul 2014 11:37:02 +0000 Subject: [PATCH] Fix mail import message dialog --- mail/inc/class.mail_hooks.inc.php | 2 +- mail/inc/class.mail_ui.inc.php | 23 ++++++++------- mail/templates/default/app.css | 8 ++++- mail/templates/default/importMessage.xet | 37 ++++++++++++++++-------- mail/templates/pixelegg/app.css | 7 +++++ 5 files changed, 52 insertions(+), 25 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index 1f8ebd4cea..55e34a9e75 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -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');", ); } diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 7b25693b13..4d709ab526 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -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'); diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index 05befa3a2f..4edcc380d4 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -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 { diff --git a/mail/templates/default/importMessage.xet b/mail/templates/default/importMessage.xet index 6c654e5797..8d44e5ed7b 100644 --- a/mail/templates/default/importMessage.xet +++ b/mail/templates/default/importMessage.xet @@ -2,17 +2,30 @@ diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index e51a81aff2..3da09016db 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -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 {