fix flag message action; hide quotabox if not supported; add toggle Editor to compose (not fully implemented)

This commit is contained in:
Klaus Leithoff 2013-10-04 09:33:44 +00:00
parent 8c94a4fd19
commit e630823872
7 changed files with 45 additions and 7 deletions

View File

@ -2879,6 +2879,7 @@ class mail_bo
}
if (PEAR::isError($ret))
{
//error_log(__METHOD__.__LINE__.$ret->message);
if (stripos($ret->message,'Too long argument'))
{
$c = count($_messageUID);
@ -2892,10 +2893,12 @@ class mail_bo
$cachemodified = false;
foreach ((array)$_messageUID as $k => $_uid)
{
if (isset($summary[$this->icServer->ImapServerId][(!empty($currentFolder)?$currentFolder: $this->sessionData['mailbox'])][$_uid]))
//error_log(__METHOD__.__LINE__.' try to unset summarycache for:'.$_uid.' in '.(!empty($_folder)?$_folder: $this->sessionData['mailbox']));
if (isset($summary[$this->icServer->ImapServerId][(!empty($_folder)?$_folder: $this->sessionData['mailbox'])][$_uid]))
{
//error_log(__METHOD__.__LINE__.' unset summarycache for:'.$_uid.' in '.(!empty($_folder)?$_folder: $this->sessionData['mailbox']));
$cachemodified = true;
unset($summary[$this->icServer->ImapServerId][(!empty($currentFolder)?$currentFolder: $this->sessionData['mailbox'])][$_uid]);
unset($summary[$this->icServer->ImapServerId][(!empty($_folder)?$_folder: $this->sessionData['mailbox'])][$_uid]);
}
}
if ($cachemodified)
@ -2903,7 +2906,7 @@ class mail_bo
egw_cache::setCache(egw_cache::INSTANCE,'email','summaryCache'.trim($GLOBALS['egw_info']['user']['account_id']),$summary,$expiration=60*60*1);
}
$this->sessionData['folderStatus'][$this->profileID][$this->sessionData['mailbox']]['uidValidity'] = 0;
$this->sessionData['folderStatus'][$this->profileID][(!empty($_folder)?$_folder: $this->sessionData['mailbox'])]['uidValidity'] = 0;
$this->saveSessionData();
//error_log(__METHOD__.__LINE__.'->' .$_flag." ".array2string($_messageUID).",".($_folder?$_folder:$this->sessionData['mailbox']));
return true; // as we do not catch/examine setFlags returnValue

View File

@ -377,6 +377,21 @@ $CAtFStart = array2string($_content);
}
$insertSigOnTop = false;
$content = (is_array($_content)?$_content:array());
// user might have switched desired mimetype, so we should convert
if ($content['is_html'] && $content['mimeType']=='plain')
{
$suppressSigOnTop = true;
$content['body'] = $content['mail_htmltext'];
$content['is_html'] = false;
$content['is_plain'] = true;
}
if ($content['is_plain'] && $content['mimeType']=='html')
{
$suppressSigOnTop = true;
$content['body'] = $content['mail_plaintext'];
$content['is_html'] = true;
$content['is_plain'] = false;
}
$content['body'] = ($content['body'] ? $content['body'] : $content['mail_'.($content['mimeType'] == 'html'?'html':'plain').'text']);
$alwaysAttachVCardAtCompose = false; // we use this to eliminate double attachments, if users VCard is already present/attached
if ( isset($GLOBALS['egw_info']['apps']['stylite']) && (isset($this->preferencesArray['attachVCardAtCompose']) &&
@ -923,7 +938,7 @@ $CAtFStart = array2string($_content);
}
else
{
$content['body'] = ($font_span?$font_span:' ').$content['body'];
$content['body'] = ($font_span?$font_span:/*($content['mimeType'] == 'html'?' ':'')*/'').$content['body'];
}
//error_log(__METHOD__.__LINE__.$content['body']);
@ -1053,6 +1068,7 @@ if (is_array($content['attachments']))error_log(__METHOD__.__LINE__.' Attachment
$preserv['is_html'] = $content['is_html'];
$preserv['is_plain'] = $content['is_plain'];
if (isset($content['mimeType'])) $preserv['mimeType'] = $content['mimeType'];
$sel_options['mimeType'] = array("plain"=>"plain","html"=>"html");
$etpl = new etemplate_new('mail.compose');
$etpl->exec('mail.mail_compose.compose',$content,$sel_options,$readonlys,$preserv,2);

View File

@ -233,8 +233,11 @@ class mail_ui
$content[self::$nm_index]['quota'] = $sel_options[self::$nm_index]['quota'] = $quotainfo['text'];
$content[self::$nm_index]['quotainpercent'] = $sel_options[self::$nm_index]['quotainpercent'] = (string)$quotainfo['percent'];
$content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = $quotainfo['class'];
$content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "";
} else {
$content[self::$nm_index]['quota'] = $sel_options[self::$nm_index]['quota'] = lang("Quota not provided by server");
$content[self::$nm_index]['quotaclass'] = $sel_options[self::$nm_index]['quotaclass'] = "mail-index_quotaDisplayNone";
$content[self::$nm_index]['quotanotsupported'] = $sel_options[self::$nm_index]['quotanotsupported'] = "mail-index_quotaDisplayNone";
}
$sel_options[self::$nm_index]['foldertree'] = $this->getFolderTree(false);
@ -3342,7 +3345,7 @@ blockquote[type=cite] {
*/
function ajax_flagMessages($_flag, $_messageList)
{
if(mail_bo::$debug) error_log(__METHOD__."->".$_flag.':'.print_r($_messageList,true));
if(mail_bo::$debug) error_log(__METHOD__."->".$_flag.':'.array2string($_messageList));
if ($_messageList=='all' || !empty($_messageList['msg']))
{
if ($_messageList=='all')

View File

@ -829,8 +829,16 @@ app.mail = AppJS.extend(
mail_flag: function(_action, _elems)
{
//alert(_action.id+' - '+_elems[0].id);
//console.log(_action, _elems);
var msg = this.mail_getFormData(_elems);
//
if (_action.id.substring(0,2)=='un') {
this.mail_removeRowClass(_elems,_action.id.substring(2));
}
else
{
this.mail_removeRowClass(_elems,'un'+_action.id);
}
this.mail_setRowClass(_elems,_action.id);
this.mail_flagMessages(_action.id,msg);
},
@ -842,6 +850,7 @@ app.mail = AppJS.extend(
*/
mail_flagMessages: function(_flag, _elems)
{
//console.log(_flag, _elems);
app.mail.app_refresh(egw.lang('flag messages'), 'mail');
egw.json('mail.mail_ui.ajax_flagMessages',[_flag, _elems])
.sendRequest();

View File

@ -293,6 +293,9 @@ pre {
width:200px !important;
z-index:99;
}
.mail-index_quotaDisplayNone {
display: none !important;
}
.mail-index_QuotaGreen, .mail-index_QuotaYellow, .mail-index_QuotaRed {
height:12px !important;
width:100px !important;

View File

@ -56,6 +56,10 @@
<menulist>
<menupopup id="stationeryID"/>
</menulist>
<description value="Editor type"/>
<menulist>
<menupopup id="mimeType" onchange="1"/>
</menulist>
</groupbox>
<groupbox class="et2_file mailUploadSection">
<caption label="Files"/>

View File

@ -42,7 +42,7 @@
<html id="msg"/>
<buttononly id="button[mailcreate]" onclick="app.mail.mail_compose(false);" label="Compose" parent_node="mail-index_buttonmailcreate"/>
<buttononly id="button[testhtmlarea]" onclick="app.mail.mail_testhtmlarea(false);" label="Test HTML Area" parent_node="mail-index_buttontesthtmlarea"/>
<hbox class="mail-index_quotabox"><description value="Quota"/><progress id="nm[quotainpercent]" label="@nm[quota]" class="@nm[quotaclass]"/></hbox>
<hbox class="mail-index_quotabox"><description value="Quota" class="@nm[quotanotsupported]"/><progress id="nm[quotainpercent]" label="@nm[quota]" class="@nm[quotaclass]"/></hbox>
<split dock_side="bottomDock" id="mailSplitter" orientation="h">
<nextmatch id="nm" onselect="app.mail.mail_preview" template="mail.index.rows"/>
<vbox id="mailPreview" width="100%">