Fixing PHP warning in surveys see #4923

skala
Julio Montoya 12 years ago
parent 5b6982522f
commit a0b4371e61
  1. 3
      main/inc/lib/formvalidator/Rule/Date.php
  2. 11
      main/survey/create_new_survey.php

@ -33,9 +33,8 @@ class HTML_QuickForm_Rule_Date extends HTML_QuickForm_Rule
* @param array $date An array with keys F (month), d (day) and Y (year)
* @return boolean True if date is valid
*/
function validate($date)
function validate($date, $options)
{
return checkdate($date['F'], $date['d'], $date['Y']);
}
}
?>

@ -258,10 +258,6 @@ $form->addRule(array('start_date', 'end_date'), get_lang('StartDateShouldBeBefor
// Setting the default values
$form->setDefaults($defaults);
// Displaying the header
Display::display_header($tool_name);
// The validation or display
if ($form->validate()) {
// Exporting the values
@ -282,6 +278,9 @@ if ($form->validate()) {
// Display the error
Display::display_error_message(get_lang($return['message']), false);
// Displaying the header
Display::display_header($tool_name);
// Display the form
$form->display();
} else {
@ -307,6 +306,7 @@ if ($form->validate()) {
}
}
}
if ($config['survey']['debug']) {
// Displaying a feedback message
Display::display_confirmation_message($return['message'], false);
@ -316,6 +316,9 @@ if ($form->validate()) {
exit;
}
} else {
// Displaying the header
Display::display_header($tool_name);
$form->display();
}

Loading…
Cancel
Save