Created ttDebugTracer class to hopefully help to address blank screen issues.
[timetracker.git] / time.php
index 7450679..293c574 100644 (file)
--- a/time.php
+++ b/time.php
@@ -27,6 +27,7 @@
 // +----------------------------------------------------------------------+
 
 require_once('initialize.php');
+import('ttDebugTracer');
 import('form.Form');
 import('ttConfigHelper');
 import('ttUserHelper');
@@ -35,6 +36,10 @@ import('ttClientHelper');
 import('ttTimeHelper');
 import('DateAndTime');
 
+// Initialize ttDebugTracer to print diagnostic messages.
+$debug = new ttDebugTracer(__FILE__);
+$debug->println('page entry after imports');
+
 // Access checks.
 if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) {
   header('Location: access_denied.php');
@@ -55,6 +60,7 @@ if ($request->isPost()) {
     exit();
   }
 }
+$debug->println('after all access checks');
 // End of access checks.
 
 // Determine user for whom we display this page.
@@ -66,6 +72,7 @@ if ($request->isPost() && $userChanged) {
 }
 
 $group_id = $user->getGroup();
+$debug->println("user_id: $user_id group_id: $group_id");
 
 $showClient = $user->isPluginEnabled('cl');
 $trackingMode = $user->getTrackingMode();
@@ -429,6 +436,8 @@ if ($request->isPost()) {
 $week_total = ttTimeHelper::getTimeForWeek($selected_date);
 $timeRecords = $showFiles? ttTimeHelper::getRecordsWithFiles($user_id, $cl_date) : ttTimeHelper::getRecords($user_id, $cl_date);
 
+$debug->println('smarty assignments');
+
 $smarty->assign('selected_date', $selected_date);
 $smarty->assign('week_total', $week_total);
 $smarty->assign('day_total', ttTimeHelper::getTimeForDay($cl_date));
@@ -440,8 +449,6 @@ $smarty->assign('show_task', $showTask);
 $smarty->assign('show_start', $showStart);
 $smarty->assign('show_finish', $showFinish);
 $smarty->assign('show_duration', $showDuration);
-
-
 $smarty->assign('show_note_column', $showNoteColumn);
 $smarty->assign('show_note_row', $showNoteRow);
 $smarty->assign('show_files', $showFiles);