* eMail: allow to delete messages immediately (on userinteraction), if OVERQUOTA error is encountered

This commit is contained in:
Klaus Leithoff 2013-05-27 09:55:59 +00:00
parent e72d937e19
commit cbae83f9d3
5 changed files with 33 additions and 9 deletions

View File

@ -483,14 +483,14 @@ class ajaxfelamimail
*
* @return xajax response
*/
function deleteMessages($_messageList,$_refreshMessageList=true)
function deleteMessages($_messageList,$_refreshMessageList=true,$_forceDeleteMethod=null)
{
if($this->_debug) error_log(__METHOD__." called with Messages ".print_r($_messageList,true));
if($this->_debug) error_log(__METHOD__." called with Messages ".print_r($_messageList,true).' Method:'.$_forceDeleteMethod);
$messageCount = 0;
if(is_array($_messageList) && count($_messageList['msg']) > 0) $messageCount = count($_messageList['msg']);
try
{
$this->bofelamimail->deleteMessages(($_messageList == 'all'? 'all':$_messageList['msg']));
$this->bofelamimail->deleteMessages(($_messageList == 'all'? 'all':$_messageList['msg']),null,(empty($_forceDeleteMethod)?'no':$_forceDeleteMethod));
unset($this->sessionData['previewMessage']);
$this->saveSessionData();
}
@ -498,9 +498,17 @@ class ajaxfelamimail
{
$error = str_replace('"',"'",$e->getMessage());
$response = new xajaxResponse();
$response->addScript('resetMessageSelect();');
$response->addScript('tellUser("'.$error.'");');
$response->addScript('onNodeSelect("'.$this->sessionData['mailbox'].'");');
if (stripos($error,'[OVERQUOTA]')=== false)
{
$response->addScript('resetMessageSelect();');
$response->addScript('tellUser("'.$error.'");');
$response->addScript('onNodeSelect("'.$this->sessionData['mailbox'].'");');
}
else
{
$error = str_replace('\n',"\n",lang('mailserver reported:\n%1 \ndo you want to proceed by deleting the selected messages immediately (click ok)?\nif not, please try to empty your trashfolder before continuing. (click cancel)',$e->getMessage()));
$response->addScript('mail_retryforceddelete('.json_encode($error).','.json_encode($_messageList).');');
}
return $response->getXML();
}
if ($_refreshMessageList === false)

View File

@ -980,7 +980,7 @@ class felamimail_bo
function deleteMessages($_messageUID, $_folder=NULL, $_forceDeleteMethod='no')
{
//error_log(__METHOD__.__LINE__.'->'.array2string($_messageUID).','.$_folder);
//error_log(__METHOD__.__LINE__.'->'.array2string($_messageUID).','.$_folder,','.$_forceDeleteMethod);
$msglist = '';
$oldMailbox = '';
if (is_null($_folder) || empty($_folder)) $_folder = $this->sessionData['mailbox'];

View File

@ -456,7 +456,21 @@ function mail_delete(_action, _elems)
mail_deleteMessages(messageList);
}
function mail_deleteMessages(_messageList) {
/**
* retry to Delete mails
*
* @param messageList
*/
function mail_retryforceddelete(reason,messageList)
{
Check = confirm(reason);
if (Check==true)
{
mail_deleteMessages(messageList,'remove_immediately');
}
}
function mail_deleteMessages(_messageList,_method) {
var Check = true;
var cbAllMessages = document.getElementById('selectAllMessagesCheckBox').checked;
@ -489,7 +503,7 @@ function mail_deleteMessages(_messageList) {
}
}
}
egw_appWindow('felamimail').xajax_doXMLHTTPsync("felamimail.ajaxfelamimail.deleteMessages",_messageList,false);
egw_appWindow('felamimail').xajax_doXMLHTTPsync("felamimail.ajaxfelamimail.deleteMessages",_messageList,false,(typeof _method == undefined?null:_method));
egw_appWindow('felamimail').setStatusMessage(curStatus,true);
egw_appWindow('felamimail').refresh();
} else {

View File

@ -338,6 +338,7 @@ loading felamimail de lade
location of buttons when composing felamimail de Ort der Knöpfe beim E-Mail schreiben
look up the name of the mailbox (but not its contents). felamimail de Prüfen des Namens der Mailbox (jedoch nicht deren Inhalt).
mail server login type admin de Typ der Mailserver Anmeldung
mailserver reported:\n%1 \ndo you want to proceed by deleting the selected messages immediately (click ok)?\nif not, please try to empty your trashfolder before continuing. (click cancel) felamimail de Mailserver Meldung:\n%1 \nWollen Sie fortfahren, indem Sie die ausgewählten Nachrichten sofort löschen (Klicken Sie OK)?\nWenn nicht, dann versuchen Sie Platz freizugeben indem Sie Ihren Papierkorb leeren. (Klicken Sie Abbrechen)
mail settings felamimail de E-Mail-Einstellungen
mail source felamimail de Nachrichtenquelltext
mainmessage felamimail de Hauptnachricht

View File

@ -339,6 +339,7 @@ loading felamimail en Loading
location of buttons when composing felamimail en Location of buttons when composing
look up the name of the mailbox (but not its contents). felamimail en Look up the name of the mailbox (but not its contents).
mail server login type admin en Mail server login type
mailserver reported:\n%1 \ndo you want to proceed by deleting the selected messages immediately (click ok)?\nif not, please try to empty your trashfolder before continuing. (click cancel) felamimail en Mailserver reported:\n%1 \nDo you want to proceed by deleting the selected messages immediately (Click OK)?\nIf not, please try to empty your trashfolder before continuing. (Click Cancel)
mail settings felamimail en Mail settings
mail source felamimail en Mail source
mainmessage felamimail en Main message