Commit 638a975a authored by m.stenta's avatar m.stenta
Browse files

Put "Done" checkbox in vertical tabs at the bottom of log edit forms.

parent 57d125c5
......@@ -331,13 +331,6 @@ function log_field_extra_fields() {
'description' => t('The timestamp of the log entry.'),
'weight' => -5,
);
// 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;
}
......
......@@ -132,6 +132,12 @@ function log_form(array $form, array &$form_state, Log $log) {
'#required' => TRUE,
);
// Additional settings (vertical tabs at the bottom of the form).
$form['additional_settings'] = array(
'#type' => 'vertical_tabs',
'#weight' => 99,
);
// If the log is new, and the log type marks new logs as "done" by default,
// mark the log as done and add some Javascript to auto-check/uncheck based
// on the timestamp.
......@@ -139,10 +145,16 @@ function log_form(array $form, array &$form_state, Log $log) {
$log->done = TRUE;
drupal_add_js(drupal_get_path('module', 'log') . '/log.done.js');
}
$form['done'] = array(
$form['log_status'] = array(
'#type' => 'fieldset',
'#title' => t('Log status'),
'#description' => t('Mark this log as done.'),
'#collapsible' => TRUE,
'#group' => 'additional_settings'
);
$form['log_status']['done'] = array(
'#type' => 'checkbox',
'#title' => t('Done'),
'#description' => t('Mark this log as done.'),
'#default_value' => $log->done,
);
......
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