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) * @param array $date An array with keys F (month), d (day) and Y (year)
* @return boolean True if date is valid * @return boolean True if date is valid
*/ */
function validate($date) function validate($date, $options)
{ {
return checkdate($date['F'], $date['d'], $date['Y']); 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 // Setting the default values
$form->setDefaults($defaults); $form->setDefaults($defaults);
// Displaying the header
Display::display_header($tool_name);
// The validation or display // The validation or display
if ($form->validate()) { if ($form->validate()) {
// Exporting the values // Exporting the values
@ -282,6 +278,9 @@ if ($form->validate()) {
// Display the error // Display the error
Display::display_error_message(get_lang($return['message']), false); Display::display_error_message(get_lang($return['message']), false);
// Displaying the header
Display::display_header($tool_name);
// Display the form // Display the form
$form->display(); $form->display();
} else { } else {
@ -307,6 +306,7 @@ if ($form->validate()) {
} }
} }
} }
if ($config['survey']['debug']) { if ($config['survey']['debug']) {
// Displaying a feedback message // Displaying a feedback message
Display::display_confirmation_message($return['message'], false); Display::display_confirmation_message($return['message'], false);
@ -316,6 +316,9 @@ if ($form->validate()) {
exit; exit;
} }
} else { } else {
// Displaying the header
Display::display_header($tool_name);
$form->display(); $form->display();
} }

Loading…
Cancel
Save