Fix mail compose dialog and implements consistent attachments block

This commit is contained in:
Hadi Nategh 2022-08-31 12:26:39 +02:00
parent 38d7604115
commit b83f2f5847
4 changed files with 44 additions and 25 deletions

View File

@ -1384,6 +1384,10 @@ class mail_compose
$attach['filemode_title'] = lang(Vfs\Sharing::$modes[$attach['filemode_icon']]['label'] ?? '');
}
}
else
{
unset($content['attachments']);
}
if (isset($content['to'])) $content['to'] = self::resolveEmailAddressList($content['to']);
$content['html_toolbar'] = empty(Mail::$mailConfig['html_toolbar']) ?

View File

@ -4518,17 +4518,8 @@ app.classes.mail = AppJS.extend(
var bodyH = egw_getWindowInnerHeight();
var textArea = this.et2.getWidgetById('mail_plaintext');
var $headerSec = jQuery('.mailComposeHeaderSection');
var attachments = this.et2.getWidgetById('attachments');
var content = this.et2.getArrayMgr('content').data;
// @var arrbitary int represents px
// Visible height of attachment progress
var prgV_H = 150;
// @var arrbitary int represents px
// Visible height of attchements list
var attchV_H = 68;
if (typeof textArea != 'undefined' && textArea != null)
{
if (textArea.getParent().disabled)
@ -4536,11 +4527,11 @@ app.classes.mail = AppJS.extend(
textArea = this.et2.getWidgetById('mail_htmltext');
}
// Tolerate values base on plain text or html, in order to calculate freespaces
var textAreaDelta = textArea.id == "mail_htmltext"?20:40;
var textAreaDelta = textArea.id == "mail_htmltext"?120:40;
// while attachments are in progress take progress visiblity into account
// otherwise the attachment progress is finished and consider attachments list
var delta = (attachments.table.find('li').length>0 && attachments.table.height() > 0)? prgV_H: (content.attachments? attchV_H: textAreaDelta);
var delta = textAreaDelta;
var bodySize = (bodyH - Math.round($headerSec.height() + $headerSec.offset().top) - delta);

View File

@ -281,7 +281,6 @@ pre {
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
max-width: 0px;
}
#mail-index {
position: relative

View File

@ -24,7 +24,7 @@
<grid width="100%" resize_ratio="0">
<columns>
<column widtd="10%"/>
<column width="10%"/>
<column width="84%"/>
<column width="6%"/>
</columns>
@ -86,19 +86,28 @@
</grid>
</vbox>
<vbox class="mailComposeBodySection" width="100%">
<old-hbox disabled="@is_plain" class="mailComposeBody mailComposeHtmlContainer">
<htmlarea name="mail_htmltext" id="mail_htmltext" statusbar="false" menubar="false" toolbar="@html_toolbar" imageUpload="link_to" expand_toolbar="true" height="478px" width="100%" resize_ratio="0"/>
</old-hbox>
<old-hbox disabled="@is_html" class="mailComposeBody mailComposeTextContainer">
<textbox multiline="true" rows="40" cols="120" width="100%" span="all" no_lang="1" name="mail_plaintext" id="mail_plaintext" resize_ratio="0"/>
</old-hbox>
<vbox class="et2_file mailUploadSection" disabled="@no_griddata">
<hbox>
<select id="filemode" label="Send files as" onchange="app.mail.check_sharing_filemode"/>
<date id="expiration" label="Expiration" blur="@expiration_blur" data_format="Y-m-d"/>
<passwd id="password" blur="password protect" statustext="Only makes sense, if you transport password through a different channel / outside of this mail to recipients!"/>
<et2-details toggleAlign="left" title="@attachmentsBlockTitle" toggleOnHover="true" class="attachments" hoist="true" disabled="!@attachments">
<hbox slot="summary">
<grid class="previewAttachmentArea egwGridView_grid" >
<columns>
<column width= "3%"/>
<column disabled="!@showtempname" width="10%"/>
<column width="85%"/>
<column width="8%"/>
<column width="" />
</columns>
<rows>
<row class="row attachmentRow">
<image src="@attachments[0][filemode_icon]" statustext="@attachments[0][filemode_title]"/>
<description id="attachments[0][tmp_name]"/>
<description class="useEllipsis et2_link" id="attachments[0][name]" no_lang="1" onclick="app.mail.displayUploadedFile"/>
<vfs-size align="right" id="attachments[0][size]" />
<button id="delete[@attachments[0][tmp_name]]" value="Delete" image="delete"/>
</row>
</rows>
</grid>
</hbox>
<grid id="attachments" width="100%" maxheight="165" class="egwGridView_grid" resize_ratio="0">
<grid id="attachments" class="previewAttachmentArea egwGridView_grid">
<columns>
<column width= "3%"/>
<column disabled="!@showtempname" width="10%"/>
@ -116,6 +125,22 @@
</row>
</rows>
</grid>
</et2-details>
<old-hbox disabled="@is_plain" class="mailComposeBody mailComposeHtmlContainer">
<htmlarea name="mail_htmltext" id="mail_htmltext" statusbar="false" menubar="false" toolbar="@html_toolbar" imageUpload="link_to" expand_toolbar="true" height="478px" width="100%" resize_ratio="0"/>
</old-hbox>
<old-hbox disabled="@is_html" class="mailComposeBody mailComposeTextContainer">
<textbox multiline="true" rows="40" cols="120" width="100%" span="all" no_lang="1" name="mail_plaintext" id="mail_plaintext" resize_ratio="0"/>
</old-hbox>
<vbox class="et2_file mailUploadSection" disabled="@no_griddata">
<hbox>
<select id="filemode" label="Send files as" onchange="app.mail.check_sharing_filemode"/>
<hbox>
<description value="Expiration"/>
<date id="expiration" blur="@expiration_blur" data_format="Y-m-d"/>
</hbox>
<passwd id="password" blur="password protect" statustext="Only makes sense, if you transport password through a different channel / outside of this mail to recipients!"/>
</hbox>
</vbox>
</vbox>
</template>