Merge pull request #6044 from monishdeb/CRM-16575
[civicrm-core.git] / CRM / Admin / Form / Setting / Mail.php
index 28e1294564ee5bc3cb67d8a7e44deb7526e67799..989dad279ea9c0b7362ca396dff3c3d69e15ecae 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
  */
 class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
 
+  protected $_settings = array(
+    'replyTo' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
+  );
+
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @return void
    */
@@ -49,7 +53,6 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
     $this->addElement('text', 'mailerBatchLimit', ts('Mailer Batch Limit'));
     $this->addElement('text', 'mailThrottleTime', ts('Mailer Throttle Time'));
     $this->addElement('text', 'mailerJobSize', ts('Mailer Job Size'));
-    $this->addElement('advcheckbox', 'replyTo', ts('Enable Custom Reply-To'));
     $this->addElement('text', 'mailerJobsMax', ts('Mailer CRON job limit'));
     $check = TRUE;
 
@@ -58,10 +61,10 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
 
     $this->addFormRule(array('CRM_Admin_Form_Setting_Mail', 'formRule'));
-    $this->addRule('mailerBatchLimit', ts('Must be an integer'), 'integer');
-    $this->addRule('mailThrottleTime', ts('Must be an integer'), 'integer');
-    $this->addRule('mailerJobSize', ts('Must be an integer'), 'integer');
-    $this->addRule('mailerJobsMax', ts('Must be an integer'), 'integer');
+    $this->addRule('mailerBatchLimit', ts('Please enter a valid integer.'), 'integer');
+    $this->addRule('mailThrottleTime', ts('Please enter a valid integer.'), 'integer');
+    $this->addRule('mailerJobSize', ts('Please enter a valid integer.'), 'integer');
+    $this->addRule('mailerJobsMax', ts('Please enter a valid integer.'), 'integer');
 
     parent::buildQuickForm($check);
   }
@@ -79,12 +82,13 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
         $errors['mailerJobSize'] = ts('The job size must be at least 1000 or set to 0 (unlimited).');
       }
       elseif (CRM_Utils_Array::value('mailerJobSize', $fields) <
-        CRM_Utils_Array::value('mailerBatchLimit', $fields)) {
+        CRM_Utils_Array::value('mailerBatchLimit', $fields)
+      ) {
         $errors['mailerJobSize'] = ts('A job size smaller than the batch limit will negate the effect of the batch limit.');
       }
     }
 
     return empty($errors) ? TRUE : $errors;
   }
-}
 
+}