add fileupload widget to compose, display uploaded file list area below signature select box

This commit is contained in:
Klaus Leithoff 2013-09-10 13:39:44 +00:00
parent 8667f81010
commit cf26bde93c
4 changed files with 40 additions and 7 deletions

View File

@ -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);
}

View File

@ -2370,6 +2370,12 @@ blockquote[type=cite] {
$body .= $singleBodyPart['body'];
continue;
}
$bodyPartIsSet = strlen(trim($singleBodyPart['body']));
if (!$bodyPartIsSet)
{
$body .= '';
continue;
}
if(!empty($body)) {
$body .= '<hr style="border:dotted 1px silver;">';
}

View File

@ -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);
}
},

View File

@ -10,6 +10,7 @@
</hbox>
<hbox>
<button label="Submit" id="button[apply]"/><button label="Save" id="button[save]"/>
<file statustext="Select file to attach to message" multiple='true' progress='mailUploadProgress' onFinish="app.mail.uploadForCompose" id="uploadForCompose" drop_target ="mail-compose_mailUploadSection"/>
</hbox>
<hbox class="mailComposeHeaders" width="99%">
<description value="To"/>
@ -46,7 +47,7 @@
<hbox disabled="@is_html" class="mailComposeBody">
<textbox multiline="true" rows="15" cols="120" width="99%" span="all" name="mail_plaintext" id="mail_plaintext"/>
</hbox>
<box class="mailSignature">
<groupbox class="mailSignature">
<menulist>
<menupopup id="signatureID"/>
</menulist>
@ -54,11 +55,11 @@
<menulist>
<menupopup id="stationeryID"/>
</menulist>
</box>
<box class="mailComposeAttachments">
<html id="mail_composeattachments"/>
</box>
</groupbox>
<groupbox class="et2_file" id='mailUploadSection'>
<caption label="Files"/>
<box class="mailUploadProgress" id="mailUploadProgress" width="97%"/>
</groupbox>
</vbox>
</template>
</overlay>