/*********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php';
require_once 'modules/Settings/MailScanner/core/MailScannerRule.php';
require_once 'modules/Settings/MailScanner/core/MailScannerAction.php';
require_once 'Smarty_setup.php';
global $app_strings, $mod_strings, $currentModule, $theme, $current_language;
$scannername = $_REQUEST['scannername'];
$scannerruleid = $_REQUEST['ruleid'];
$scanneractionid = $_REQUEST['actionid'];
$scannerinfo = new Vtiger_MailScannerInfo($scannername);
$scannerrule = new Vtiger_MailScannerRule($scannerruleid);
$scannerrule->scannerid = $scannerinfo->scannerid;
$scannerrule->fromaddress = $_REQUEST['rule_from'];
$scannerrule->toaddress = $_REQUEST['rule_to'];
$scannerrule->subjectop = $_REQUEST['rule_subjectop'];
$scannerrule->subject = $_REQUEST['rule_subject'];
$scannerrule->bodyop = $_REQUEST['rule_bodyop'];
$scannerrule->body = $_REQUEST['rule_body'];
$scannerrule->matchusing = $_REQUEST['rule_matchusing'];
$scannerrule->update();
$scannerrule->updateAction($scanneractionid, $_REQUEST['rule_actiontext']);
include 'modules/Settings/MailScanner/MailScannerRule.php';
<?php

/*********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
require_once 'modules/Settings/MailScanner/core/MailScannerRule.php';
$mode = $_REQUEST['mode'];
$targetruleid = $_REQUEST['targetruleid'];
$ruleid = $_REQUEST['ruleid'];
if ($mode == 'rulemove_up') {
    Vtiger_MailScannerRule::resetSequence($ruleid, $targetruleid);
} else {
    if ($mode == 'rulemove_down') {
        Vtiger_MailScannerRule::resetSequence($ruleid, $targetruleid);
    }
}
include 'modules/Settings/MailScanner/MailScannerRule.php';
/*********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
require_once 'modules/Settings/MailScanner/core/MailScannerInfo.php';
require_once 'modules/Settings/MailScanner/core/MailScannerRule.php';
require_once 'modules/Settings/MailScanner/core/MailScannerAction.php';
require_once 'Smarty_setup.php';
global $app_strings, $mod_strings, $currentModule, $theme, $current_language;
$scannername = vtlib_purify($_REQUEST['scannername']);
$scannerruleid = vtlib_purify($_REQUEST['ruleid']);
$scanneractionid = vtlib_purify($_REQUEST['actionid']);
$scannerinfo = new Vtiger_MailScannerInfo($scannername);
$scannerrule = new Vtiger_MailScannerRule($scannerruleid);
$scannerrule->scannerid = $scannerinfo->scannerid;
$scannerrule->fromaddress = vtlib_purify($_REQUEST['rule_from']);
$scannerrule->toaddress = vtlib_purify($_REQUEST['rule_to']);
$scannerrule->subjectop = vtlib_purify($_REQUEST['rule_subjectop']);
$scannerrule->subject = vtlib_purify($_REQUEST['rule_subject']);
$scannerrule->bodyop = vtlib_purify($_REQUEST['rule_bodyop']);
$scannerrule->body = vtlib_purify($_REQUEST['rule_body']);
$scannerrule->matchusing = vtlib_purify($_REQUEST['rule_matchusing']);
$scannerrule->assign_to = vtlib_purify($_REQUEST['assigntype'] == 'U' ? $_REQUEST['assigned_user_id'] : $_REQUEST['assigned_group_id']);
$scannerrule->update();
$scannerrule->updateAction($scanneractionid, vtlib_purify($_REQUEST['rule_actiontext']));
include 'modules/Settings/MailScanner/MailScannerRule.php';
Esempio n. 4
0
 /**
  * Function to save the record
  */
 public function save()
 {
     $recordId = $this->getId();
     $ruleModel = new Vtiger_MailScannerRule($recordId);
     $fieldsList = $this->getFields();
     $ruleModel->scannerid = $this->get('scannerid');
     foreach ($fieldsList as $fieldName) {
         $ruleModel->{$fieldName} = $this->get($fieldName);
     }
     //Saving the Rule data
     $ruleModel->update();
     $this->set('ruleid', $ruleModel->ruleid);
     $actionString = $this->get('action');
     $newActionString = $this->get('newAction');
     if ($actionString != $newActionString) {
         $actionId = '';
         $actions = $this->getActions();
         if ($actions) {
             $actionModel = reset($this->getActions());
             $actionId = $actionModel->actionid;
         }
         //Svaing the Action info
         $ruleModel->updateAction($actionModel->actionid, str_replace('_', ',', $newActionString));
     }
     return $ruleModel->ruleid;
 }
<?php

/*********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
 ********************************************************************************/
require_once 'modules/Settings/MailScanner/core/MailScannerRule.php';
$scannername = vtlib_purify($_REQUEST['scannername']);
$scannerruleid = vtlib_purify($_REQUEST['ruleid']);
$scannerrule = new Vtiger_MailScannerRule($scannerruleid);
$scannerrule->delete();
include 'modules/Settings/MailScanner/MailScannerRule.php';