Example #1
0
File: Spam.php Project: horde/horde
 public function validate($vars = null, $canAutoFill = false)
 {
     if (is_null($vars)) {
         $vars = $this->_vars;
     }
     if (strlen($vars->get('folder_new'))) {
         $this->folder_var->type->newFolderSet = true;
     }
     return parent::validate($vars, $canAutoFill);
 }
Example #2
0
 /**
  * Additional validate of start and end date fields.
  */
 public function validate($vars = null, $canAutoFill = false)
 {
     $valid = true;
     if (!parent::validate($vars, $canAutoFill)) {
         $valid = false;
     }
     if ($this->hasFeature('period')) {
         $this->_start->getInfo($vars, $start);
         $this->_end->getInfo($vars, $end);
         if ($start && $end && $end < $start) {
             $valid = false;
             $this->_errors['end'] = _("Vacation end date is prior to start.");
         }
         if ($end && $end < mktime(0, 0, 0)) {
             $valid = false;
             $this->_errors['end'] = _("Vacation end date is prior to today.");
         }
     }
     return $valid;
 }