Commit da92e886 authored by m.stenta's avatar m.stenta
Browse files

If a new log is marked "done", but the timestamp is in the future, display a...

If a new log is marked "done", but the timestamp is in the future, display a warning, but allow the user to continue if they submit the form again.
parent f555d995
......@@ -168,6 +168,15 @@ function log_form($form, &$form_state, $log) {
*/
function log_form_validate($form, &$form_state) {
// If a new log is marked "done", but the timestamp is in the future, display
// a warning, but allow the user to continue if they submit the form again.
if (empty($form_state['values']['log']->id) && empty($form_state['log_done_warning']) ) {
$timestamp = strtotime($form_state['values']['timestamp']);
if (!empty($form_state['values']['done']) && $timestamp > REQUEST_TIME) {
form_set_error('done', t('You marked this log item as "done", but it has a date in the future. If you are OK with this fact, click save again.'));
$form_state['log_done_warning'] = TRUE;
}
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment