diff --git a/mail/inc/class.mail_sieve.inc.php b/mail/inc/class.mail_sieve.inc.php
index f5951b8101..5e45aaf233 100644
--- a/mail/inc/class.mail_sieve.inc.php
+++ b/mail/inc/class.mail_sieve.inc.php
@@ -9,48 +9,18 @@
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
-include_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.etemplate.inc.php');
class mail_sieve
{
- var $public_functions = array
- (
- 'editVacation' => True,
- 'index' => True,
- 'edit' => True,
- 'editEmailNotification'=> True, // Added email notifications
- );
+ var $public_functions = array(
+ 'editVacation' => True,
+ 'index' => True,
+ 'edit' => True,
+ 'editEmailNotification'=> True, // Added email notifications
+ );
var $errorStack;
- /**
- * etemplate object for sieve index
- *
- * @var object
- */
- var $tmpl;
-
- /**
- * etemplate object for sieve edit popup
- *
- * @var object
- */
- var $etmpl;
-
- /**
- * etemplate object for Vacation
- *
- * @var object
- */
- var $vtmpl;
-
- /**
- * etemplate object for email notification
- *
- * @var object
- */
- var $eNotitmpl;
-
/**
* Current Identitiy
*
@@ -78,17 +48,14 @@ class mail_sieve
* @var boolean
*/
var $is_admin_vac = false;
-
+
/**
* Constructor
- *
- *
*/
-
function __construct()
{
$this->displayCharset = translation::charset();
- $profileID = 0;
+ $profileID = (int)$_GET['acc_id'];
$this->mail_admin = isset($GLOBALS['egw_info']['user']['apps']['emailadmin']);
if (isset($GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']))
@@ -110,7 +77,6 @@ class mail_sieve
*/
function index(array $content=null,$msg=null)
{
-
//Instantiate an etemplate_new object
$tmpl = new etemplate_new('mail.sieve.index');
@@ -191,7 +157,7 @@ class mail_sieve
}
if (isset($content['externalEmail']) && !empty($content['externalEmail']))
{
- if (!$this->account->imapServer()->setEmailNotification(null, $newEmailNotification))
+ if (!$this->account->imapServer()->setEmailNotification($newEmailNotification))
{
$msg = lang("email notification update failed")."
";
break;
@@ -242,7 +208,6 @@ class mail_sieve
/**
* Sieve rules edit
*
- *
* @param {array} $content
*/
function edit ($content=null)
@@ -334,7 +299,7 @@ class mail_sieve
if($newRule['action'] && $this->rulesByID['priority'])
{
$this->rules[$ruleID] = $newRule;
- $ret = $this->account->imapServer()->setRules(null, $this->rules);
+ $ret = $this->account->imapServer()->setRules($this->rules);
if (!$ret && !empty($this->account->imapServer()->error))
{
$msg .= lang("Saving the rule failed:")."
".$this->account->imapServer()->error."
";
@@ -374,7 +339,6 @@ class mail_sieve
egw_framework::window_close();
common::egw_exit();
}
-
}
$sel_options = array(//array_merge($sel_options,array(
'anyof' => array(
@@ -397,7 +361,6 @@ class mail_sieve
$mailCompose = new mail_compose();
$sel_options['action_folder_text'] = $mailCompose->ajax_searchFolder(0,true);
-
return $etmpl->exec('mail.mail_sieve.edit',$content,$sel_options,$readonlys,array(),2);
}
@@ -518,6 +481,11 @@ class mail_sieve
$this->is_admin_vac = true;
$preserv['account_id'] = $account_id;
}
+ elseif(!is_array($content) && isset($_GET['acc_id']))
+ {
+ $this->account = emailadmin_account::read($_GET['acc_id']);
+ $preserv['acc_id'] = $this->account->acc_id;
+ }
$icServer = $this->account->imapServer($this->is_admin_vac ? $account_id : false);
@@ -607,11 +575,11 @@ class mail_sieve
{
if (isset($account_id) && $this->mail_admin)
{
- $resSetvac = $icServer->setVacationUser($account_id,$this->scriptName, $newVacation);
+ $resSetvac = $icServer->setVacationUser($account_id, $this->scriptName, $newVacation);
}
else
{
- $resSetvac = $icServer->setVacation($this->scriptName, $newVacation);
+ $resSetvac = $icServer->setVacation($newVacation);
}
if (!$resSetvac)
@@ -620,9 +588,12 @@ class mail_sieve
break;
}
// schedule job to switch message on/off, if request and not already in past
- elseif ($newVacation['status'] == 'by_date' && $newVacation['end_date']+24*3600