made it more concise
authorAndrew Hunt <andrew@aghstrategies.com>
Thu, 28 Mar 2013 19:49:48 +0000 (15:49 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Thu, 28 Mar 2013 19:49:48 +0000 (15:49 -0400)
CRM/Admin/Form/Setting/Mail.php

index 40f7aa0c303309b00b7ccbfde6925b532d82c35f..82f9f26c19967784ffd22530e264efb38be7e216 100644 (file)
@@ -70,15 +70,14 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
   static function formRule($fields) {
     $errors = array();
 
-    if (CRM_Utils_Array::value('mailerJobSize', $fields) < 1000
-      && CRM_Utils_Array::value('mailerJobSize', $fields) > 0) {
-      $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) > 0
-      && CRM_Utils_Array::value('mailerJobSize', $fields) > 0) {
-      $errors['mailerJobSize'] = ts('A job size smaller than the batch limit will negate the effect of the batch limit.');
+    if (CRM_Utils_Array::value('mailerJobSize', $fields) > 0) {
+      if (CRM_Utils_Array::value('mailerJobSize', $fields) < 1000) {
+        $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)) {
+        $errors['mailerJobSize'] = ts('A job size smaller than the batch limit will negate the effect of the batch limit.');
+      }
     }
     
     return empty($errors) ? TRUE : $errors;