catch error on failed copy/move messages and report to user via egw_message

This commit is contained in:
Klaus Leithoff 2014-02-17 10:19:31 +00:00
parent acd8b742e8
commit 092af04bc4

View File

@ -4183,10 +4183,16 @@ blockquote[type=cite] {
$hA = self::splitRowID($rowID); $hA = self::splitRowID($rowID);
$messageList[] = $hA['msgUID']; $messageList[] = $hA['msgUID'];
} }
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
$response = egw_json_response::get(); $response = egw_json_response::get();
$response->call('egw_refresh',($_copyOrMove=='copy'?lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder):lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder)),'mail'); try
{
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
$response->call('egw_refresh',($_copyOrMove=='copy'?lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder):lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder)),'mail');
}
catch (Exception $e)
{
$response->call('egw_message',$e->getMessage(),"error");
}
} }
else else
{ {