Index: time.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/time/time.module,v
retrieving revision 1.3
diff -u -p -r1.3 time.module
--- time.module	19 Feb 2009 05:36:08 -0000	1.3
+++ time.module	22 Jul 2009 13:08:26 -0000
@@ -169,7 +169,7 @@ function time_profile_load($tpid = 0, $e
  * Implementation of a load callback for time entries and time profiles.
  */
 function time_load($teid = NULL, $node = NULL) {
-  if ($teid) { 
+  if ($teid) {
     if (is_object($teid) || is_array($teid)) {
       $row = (array) $teid;
     }
@@ -189,17 +189,28 @@ function time_load($teid = NULL, $node =
 /**
  * Implementation of hook_comment().
  */
-function time_comment(&$edit, $op) {
-  if ($op == 'insert') {
-    // If the time tracking form was embedded in the comment form, store the
-    // time entry for this comment.  This happens here so we can access cid.
-    if (isset($edit['time']) && strlen($edit['time']['duration'])) {
-      $edit['time']['cid'] = $edit['cid'];
-      $edit['time']['timestamp'] = $edit['timestamp'];
-      $time = time_load($edit['time']);
-      $time->set_note($edit['comment']);
-      $time->save();
-    }
+function time_comment(&$comment, $op) {
+  switch ($op) {
+    case 'insert':
+      // If the time tracking form was embedded in the comment form, store the
+      // time entry for this comment.  This happens here so we can access cid.
+      if (isset($comment['time']) && strlen($comment['time']['duration'])) {
+        $comment['time']['cid'] = $comment['cid'];
+        $comment['time']['timestamp'] = $comment['timestamp'];
+        $time = time_load($comment['time']);
+        $time->set_note($comment['comment']);
+        $time->save();
+      }
+      break;
+    case 'view':
+      // If this is a preview we won't have a cid yet.
+      if (!empty($comment->cid) AND user_access('view time entries')) {
+        $sql = 'SELECT teid FROM {time_entry} WHERE cid = %d';
+        $teid = db_result(db_query($sql, $comment->cid));
+        $time = time_load($teid);
+        $comment->comment = theme('time_comment_changes', $time) . $comment->comment;
+      }
+      break;
   }
 }
 
@@ -247,6 +258,7 @@ function time_form($form_state, $time_en
  * Validate handler for Time tracking form.
  */
 function time_form_validate($form, &$form_state) {
+  return true;
   $time_entry = $form['time']['#time_entry'];
   return $time_entry->validate($form_state['values']['time']);
 }
@@ -294,11 +306,15 @@ function time_access($profile = NULL, $n
  */
 function time_theme() {
   return array(
-    'time_admin_global_form' => array( 
+    'time_admin_global_form' => array(
       'arguments' => array('form' => NULL),
       'file' => 'time.theme.inc',
       //'path' => drupal_get_path('module', 'time') .'/includes',
     ),
+    'time_comment_changes' => array(
+      'arguments' => array('time' => NULL),
+      'file' => 'time.theme.inc',
+    ),
   );
 }
 
Index: time.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/time/time.theme.inc,v
retrieving revision 1.1
diff -u -p -r1.1 time.theme.inc
--- time.theme.inc	16 Feb 2009 02:16:02 -0000	1.1
+++ time.theme.inc	22 Jul 2009 13:08:26 -0000
@@ -1,5 +1,18 @@
 <?php
 function theme_time_admin_global_form($form) {
 print_r(debug_backtrace()); die;
-print_r($form); 
+print_r($form);
+}
+
+/**
+ * Displays the time added via the comment
+ *
+ * @param $time
+ *   The time object with details of how much time was added.
+ */
+function theme_time_comment_changes($time) {
+  $activities = $time->activities();
+  $string = '&raquo; '. $time->duration .' '. $activities[$time->activity] .t(' hours added');
+  return theme('table', NULL, array(array($string)), array('class' => 'time_added'));
+
 }
