コード例 #1
0
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!$data['distributiontime']) {
         $data['distributiontime'] = '23:59';
     }
     $ddate = strtotime($data['distributiondate'] . ' ' . $data['distributiontime']);
     if (!$data['enable_FCFS'] && (!$data['distributiondate'] || $ddate < time() + $this->minimum_timespan_to_distribution_time * 60)) {
         $errors[] = sprintf(_('Bitte geben Sie für die Platzverteilung ein Datum an, das weiter in der Zukunft liegt. Das frühestmögliche Datum ist %s.'), strftime('%x %R', time() + $this->minimum_timespan_to_distribution_time * 60));
     }
     return $errors;
 }
コード例 #2
0
ファイル: TimedAdmission.class.php プロジェクト: ratbird/hope
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!$data['startdate'] && !$data['enddate']) {
         $errors[] = _('Bitte geben Sie entweder ein Start- oder Enddatum an.');
     }
     if ($data['startdate'] && $data['enddate'] && strtotime($data['enddate'] . ' ' . $data['endtime']) < strtotime($data['startdate'] . ' ' . $data['starttime'])) {
         $errors[] = _('Das Enddatum darf nicht vor dem Startdatum liegen.');
     }
     return $errors;
 }
コード例 #3
0
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!$data['password1']) {
         $errors[] = _('Das Passwort darf nicht leer sein.');
     }
     if ($data['password1'] != $data['password2']) {
         $errors[] = _('Das Passwort stimmt nicht mit der Wiederholung überein.');
     }
     return $errors;
 }
コード例 #4
0
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!$data['conditions']) {
         $errors[] = _('Es muss mindestens eine Auswahlbedingung angegeben werden.');
     }
     return $errors;
 }
コード例 #5
0
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!($data['mandatory_course_id'] || $data['mandatory_course_id_old'])) {
         $errors[] = _('Bitte wählen Sie eine Veranstaltung aus.');
     }
     return $errors;
 }
コード例 #6
0
 /**
  * Validates if the given request data is sufficient to configure this rule
  * (e.g. if required values are present).
  *
  * @param  Array Request data
  * @return Array Error messages.
  */
 public function validate($data)
 {
     $errors = parent::validate($data);
     if (!$data['maxnumber']) {
         $errors[] = _('Bitte geben Sie die maximale Anzahl erlaubter Anmeldungen an.');
     }
     return $errors;
 }