next (little) step for sharing files

This commit is contained in:
Ralf Becker 2014-12-02 19:18:37 +00:00
parent f7610cd6d6
commit 03ea6d9294
5 changed files with 54 additions and 26 deletions

View File

@ -176,13 +176,6 @@ class mail_compose
unset($_GET['part_id']); unset($_GET['part_id']);
unset($_GET['id']); unset($_GET['id']);
unset($_GET['mode']); unset($_GET['mode']);
if (is_array($_content['attachments']))
{
foreach ($_content['attachments'] as $i => &$upload)
{
if (is_numeric($upload['size'])) $upload['size'] = mail_bo::show_readable_size($upload['size']);
}
}
//error_log(__METHOD__.__LINE__.array2string($_content)); //error_log(__METHOD__.__LINE__.array2string($_content));
} }
@ -242,7 +235,6 @@ class mail_compose
error_log(__METHOD__.__LINE__." ". $e->getMessage()); error_log(__METHOD__.__LINE__." ". $e->getMessage());
} }
$upload['file'] = $upload['tmp_name'] = $tmp_filename; $upload['file'] = $upload['tmp_name'] = $tmp_filename;
$upload['size'] = mail_bo::show_readable_size($upload['size']);
} }
} }
// check if someone did hit delete on the attachments list // check if someone did hit delete on the attachments list

View File

@ -179,6 +179,7 @@ app.classes.mail = AppJS.extend(
var that = this; var that = this;
this.mail_isMainWindow = false; this.mail_isMainWindow = false;
this.compose_fieldExpander_init(); this.compose_fieldExpander_init();
this.check_sharing_filemode();
// Set autosaving interval to 2 minutes for compose message // Set autosaving interval to 2 minutes for compose message
window.setInterval(function (){ window.setInterval(function (){
@ -200,7 +201,7 @@ app.classes.mail = AppJS.extend(
jQuery(window).on ('resize',function() { jQuery(window).on ('resize',function() {
that.compose_resizeHandler(); that.compose_resizeHandler();
}); });
this.compose_fieldExpander(); this.compose_fieldExpander();
//Call drag_n_drop initialization for emails on compose //Call drag_n_drop initialization for emails on compose
@ -3911,7 +3912,7 @@ app.classes.mail = AppJS.extend(
{ {
var mainIframe = jQuery('#mail-display_mailDisplayBodySrc'); var mainIframe = jQuery('#mail-display_mailDisplayBodySrc');
var tmpPrintDiv = jQuery('#tempPrintDiv'); var tmpPrintDiv = jQuery('#tempPrintDiv');
if (tmpPrintDiv.length == 0 && tmpPrintDiv.children()) if (tmpPrintDiv.length == 0 && tmpPrintDiv.children())
{ {
tmpPrintDiv = jQuery(document.createElement('div')) tmpPrintDiv = jQuery(document.createElement('div'))
@ -3919,7 +3920,7 @@ app.classes.mail = AppJS.extend(
.addClass('tmpPrintDiv'); .addClass('tmpPrintDiv');
var notAttached = true; var notAttached = true;
} }
if (mainIframe) if (mainIframe)
{ {
tmpPrintDiv[0].innerHTML = mainIframe.contents().find('body').html(); tmpPrintDiv[0].innerHTML = mainIframe.contents().find('body').html();
@ -3929,7 +3930,7 @@ app.classes.mail = AppJS.extend(
tmpPrintDiv.find('#divAppboxHeader').remove(); tmpPrintDiv.find('#divAppboxHeader').remove();
this.egw.message('Printing....'); this.egw.message('Printing....');
// Make sure the print happens after the content is loaded. Seems Firefox and IE can't handle timing for print command correctly // Make sure the print happens after the content is loaded. Seems Firefox and IE can't handle timing for print command correctly
setTimeout(function(){ setTimeout(function(){
egw(window).window.print(); egw(window).window.print();
@ -4113,5 +4114,26 @@ app.classes.mail = AppJS.extend(
} }
return true; return true;
}; };
},
/**
* Check sharing mode and disable not available options
*
* @param {DOMNode} _node
* @param {et2_widget} _widget
*/
check_sharing_filemode: function(_node, _widget)
{
if (!_widget) _widget = this.et2.getWidgetById('filemode');
var extended_settings = _widget.get_value() != 'attach' && this.egw.app('stylite');
this.et2.getWidgetById('share_expiration').set_readonly(!extended_settings);
this.et2.getWidgetById('share_password').set_readonly(!extended_settings);
if (_widget.get_value() == 'share_rw' && !this.egw.app('stylite'))
{
this.egw.message(this.egw.lang('Writable sharing required EPL version!'), 'info');
_widget.setValue('share_ro');
}
} }
}); });

View File

@ -368,18 +368,23 @@ div.mailUploadSection {
border-top: 1px solid silver; border-top: 1px solid silver;
margin-top: 16px; margin-top: 16px;
} }
div.mailUploadSection > label { div.mailUploadSection > div.et2_hbox {
margin-top: -10px; margin-top: -10px;
padding-left: 4px; margin-left: 6px;
padding-right: 12px; margin-right: -12px;
background-color: white; background-color: white;
display: table-caption; display: table-caption;
white-space: nowrap; }
margin-left: 6px; div.mailUploadSection > div.et2_hbox > label {
padding-left: 4px;
white-space: nowrap;
} }
#mail-compose_filemode { #mail-compose_filemode {
margin-left: 6px; margin-left: 6px;
} }
#mail-compose_share_expiration > input {
min-width: 15ex;
}
#mail-compose_selectFromVFSForCompose{ #mail-compose_selectFromVFSForCompose{
width:20px; width:20px;
float:none; float:none;

View File

@ -112,7 +112,11 @@
<textbox multiline="true" rows="40" cols="120" width="100%" span="all" no_lang="1" name="mail_plaintext" id="mail_plaintext"/> <textbox multiline="true" rows="40" cols="120" width="100%" span="all" no_lang="1" name="mail_plaintext" id="mail_plaintext"/>
</hbox> </hbox>
<vbox class="et2_file mailUploadSection" disabled="@no_griddata"> <vbox class="et2_file mailUploadSection" disabled="@no_griddata">
<select id="filemode" label="Send files as"/> <hbox>
<select id="filemode" label="Send files as" onchange="app.mail.check_sharing_filemode"/>
<date id="share_expiration" label="Expiration"/>
<passwd id="share_password" blur="password protect"/>
</hbox>
<grid id="attachments" width="100%" maxheight="165" class="egwGridView_grid"> <grid id="attachments" width="100%" maxheight="165" class="egwGridView_grid">
<columns> <columns>
<column disabled="!@showtempname" width="10%"/> <column disabled="!@showtempname" width="10%"/>
@ -124,7 +128,7 @@
<row class="row attachmentRow"> <row class="row attachmentRow">
<description id="${row}[tmp_name]"/> <description id="${row}[tmp_name]"/>
<description class="useEllipsis et2_link" id="${row}[name]" no_lang="1" onclick="app.mail.displayUploadedFile"/> <description class="useEllipsis et2_link" id="${row}[name]" no_lang="1" onclick="app.mail.displayUploadedFile"/>
<description align="right" id="${row}[size]" /> <vfs-size align="right" id="${row}[size]" />
<button id="delete[$row_cont[tmp_name]]" value="Delete" image="delete"/> <button id="delete[$row_cont[tmp_name]]" value="Delete" image="delete"/>
</row> </row>
</rows> </rows>

View File

@ -365,18 +365,23 @@ div.mailUploadSection {
border-top: 1px solid silver; border-top: 1px solid silver;
margin-top: 16px; margin-top: 16px;
} }
div.mailUploadSection > label { div.mailUploadSection > div.et2_hbox {
margin-top: -10px; margin-top: -10px;
padding-left: 4px; margin-left: 6px;
padding-right: 12px; margin-right: -12px;
background-color: white; background-color: white;
display: table-caption; display: table-caption;
}
div.mailUploadSection > div.et2_hbox > label {
padding-left: 4px;
white-space: nowrap; white-space: nowrap;
margin-left: 6px;
} }
#mail-compose_filemode { #mail-compose_filemode {
margin-left: 6px; margin-left: 6px;
} }
#mail-compose_share_expiration > input {
min-width: 15ex;
}
#mail-compose_selectFromVFSForCompose { #mail-compose_selectFromVFSForCompose {
width: 20px; width: 20px;
float: none; float: none;