From cf26bde93c38c5639d309685e293b0b8012775be Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 10 Sep 2013 13:39:44 +0000 Subject: [PATCH] add fileupload widget to compose, display uploaded file list area below signature select box --- mail/inc/class.mail_compose.inc.php | 1 + mail/inc/class.mail_ui.inc.php | 6 ++++++ mail/js/app.js | 27 ++++++++++++++++++++++++++- mail/templates/default/compose.xet | 13 +++++++------ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 319b56631b..9bdca5e541 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -979,6 +979,7 @@ class mail_compose $preserv['is_html'] = $content['is_html']; $preserv['is_plain'] = $content['is_plain']; $etpl = new etemplate_new('mail.compose'); + $etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2); } diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 6a90fc2cea..2ebc9a3e6e 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2370,6 +2370,12 @@ blockquote[type=cite] { $body .= $singleBodyPart['body']; continue; } + $bodyPartIsSet = strlen(trim($singleBodyPart['body'])); + if (!$bodyPartIsSet) + { + $body .= ''; + continue; + } if(!empty($body)) { $body .= '
'; } diff --git a/mail/js/app.js b/mail/js/app.js index 2b2d000558..02bebf65c5 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1194,7 +1194,32 @@ app.mail = AppJS.extend( // var request = new egw_json_request('mail_ui::ajax_importMessage', ['upload', widget.getValue(), _path], this); // widget.set_value(''); // request.sendRequest();//false, this._upload_callback, this); -this.et2_obj.submit(); + this.et2_obj.submit(); + } + }, + + /** + * Send names of uploaded files (again) to server, to process them: either copy to vfs or ask overwrite/rename + * + * @param _event + * @param _file_count + * @param {string} [_path=current directory] Where the file is uploaded to. + */ + uploadForCompose: function(_event, _file_count, _path) + { + //console.log(_event,_file_count,_path); + // path is probably not needed when uploading for file; maybe it is when from vfs + if(typeof _path == 'undefined') + { + //_path = this.get_path(); + } + if (_file_count && !jQuery.isEmptyObject(_event.data.getValue())) + { + var widget = _event.data; + //console.log(widget.getValue()); +// var request = new egw_json_request('mail_ui::ajax_importMessage', ['upload', widget.getValue(), _path], this); +// widget.set_value(''); +// request.sendRequest();//false, this._upload_callback, this); } }, diff --git a/mail/templates/default/compose.xet b/mail/templates/default/compose.xet index 215f6d8f18..df7ee6deda 100644 --- a/mail/templates/default/compose.xet +++ b/mail/templates/default/compose.xet @@ -10,6 +10,7 @@