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

Always show "done" field in the log form.

parent 281e2e63
......@@ -332,14 +332,12 @@ function log_field_extra_fields() {
'weight' => -5,
);
// Display the done field, if it isn't automatic.
if (empty($type->done)) {
$extra_fields['log'][$type->type]['form']['done'] = array(
'label' => t('Done'),
'description' => t('Whether or not the log is done.'),
'weight' => 100,
);
}
// Display the done field.
$extra_fields['log'][$type->type]['form']['done'] = array(
'label' => t('Done'),
'description' => t('Whether or not the log is done.'),
'weight' => 100,
);
}
return $extra_fields;
}
......
......@@ -109,21 +109,17 @@ function log_form($form, &$form_state, $log) {
'#required' => TRUE,
);
// Only display the done field if it's not automatic.
if (empty($log_type->done)) {
$form['done'] = array(
'#type' => 'checkbox',
'#title' => t('Done'),
'#description' => t('Mark this log as done.'),
'#default_value' => $log->done,
);
}
else {
$form['done'] = array(
'#type' => 'value',
'#value' => TRUE,
);
// If the log is new, and the log type marks new logs as "done" by default,
// mark the log as done.
if (empty($log->id) && !empty($log_type->done)) {
$log->done = TRUE;
}
$form['done'] = array(
'#type' => 'checkbox',
'#title' => t('Done'),
'#description' => t('Mark this log as done.'),
'#default_value' => $log->done,
);
// Log user id.
$form['uid'] = array(
......
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