Commit 281e2e63 authored by m.stenta's avatar m.stenta
Browse files

Display log's "done" status on the log view page, along with a warning message...

Display log's "done" status on the log view page, along with a warning message if it isn't done yet.
parent 6e6304c8
......@@ -16,14 +16,28 @@ function log_view($log) {
// Build the log entity render array.
$output = entity_view('log', array(entity_id('log', $log) => $log), 'full');
// Add the log's timestamp to the render array.
// Add the log's "done" status.
if ($log->done) {
$status = 'DONE';
}
else {
$status = 'NOT DONE';
drupal_set_message('This log item is not done.', 'warning');
}
$output['log'][$log->id]['done'] = array(
'#markup' => '<div style="float: right;">Status: <strong>' . $status . '</strong></div>',
'#weight' => -100,
);
// Add the log's timestamp.
if (!empty($log->timestamp)) {
$date = date('M j Y', $log->timestamp);
$output['log'][$log->id]['timestamp'] = array(
'#markup' => '<strong>Date:</strong> ' . $date,
'#weight' => -100,
'#markup' => '<p><strong>Date:</strong> ' . $date . '</p>',
'#weight' => -99,
);
}
return $output;
}
......
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