Display most recent comment together with description master
authorJoey Schulze <joey@infodrom.org>
Wed, 17 Dec 2014 01:05:57 +0000 (02:05 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 17 Dec 2014 01:05:57 +0000 (02:05 +0100)
templates/index.tpl

index 8e0fb45..d4da6c8 100644 (file)
 <div id="desc_<?php echo $task_details['task_id']; ?>" class="descbox box">
 <b>Task Description:</b>
 <?php echo $task_details['detailed_desc'] ? $task_details['detailed_desc'] : "<p>No Description</p>"; ?>
+<?php
+   global $db;
+   $sql = $db->Query('SELECT date_added,comment_text FROM {comments} WHERE task_id = ? ORDER BY date_added DESC LIMIT 1',
+                     array($task_details['task_id']));
+   if ($db->countRows($sql) == 1) {
+     $row = $db->FetchRow($sql);
+     if (strlen($row['comment_text'])) {
+       echo "<hr>" . Filters::noXSS(formatDate($row['date_added'], true)) . $row['comment_text'];
+     }
+   }
+?>
 </div>
     </tr>
     <?php endforeach; ?>