Avoid a server round trip for delete a sieve rule via edit dialog

This commit is contained in:
Hadi Nategh 2014-05-23 08:00:41 +00:00
parent af63a49792
commit 7aa00f7217

View File

@ -262,8 +262,6 @@ class mail_sieve
$error = 0;
switch ($button)
{
case 'save':
case 'apply':
if($content)
@ -332,7 +330,18 @@ class mail_sieve
case 'delete':
if ($button == "delete")
{
$msg = $this->ajax_action(false,$button, $ruleID, $msg);
if ($ruleID === count($this->rules)-1)
{
$msg = lang('rule with priority ') . $ruleID . lang(' deleted!');
}
else
{
$msg = lang('rule with priority ') . $ruleID . lang(' deleted!') . lang(' And the rule with priority %1, now got the priority %2',$ruleID+1,$ruleID);
}
unset($this->rules[$ruleID]);
$this->rules = array_values($this->rules);
$result = $this->updateScript();
}
egw_framework::refresh_opener($msg, 'mail');