if ($hide_inactive) { $q->addWhere('task_status >= 0'); } if ($hide_complete) { $q->addWhere('task_percent_complete < 100'); } if ($cost_code != '0') { $q->addWhere('task_log_costcode = "' . $cost_code . '"'); } $q->addOrder('task_log_date'); $project->setAllowedSQL($AppUI->user_id, $q, 'task_project'); $logs = $q->loadList(); $s = ''; $hrs = 0; if (count($logs) == 0) { showEmptyRow(8, 'second'); } else { foreach ($logs as $row) { $mylog = $row['task_log_creator'] == $AppUI->user_id; $task_log_date = intval($row['task_log_date']) ? new CDate($row['task_log_date']) : null; ?> <tr class="second"> <td> <?php if ($perms->checkModuleItem('tasks', 'edit', $row['task_id']) && $mylog) { showIconLink('images/edit_log.gif', 'js:doShowTaskLog(' . $row['task_id'] . ',' . $row['task_log_id'] . ',1)', 'Edit'); } else { showIconLink('images/view.gif', 'js:doShowTaskLog(' . $row['task_id'] . ',' . $row['task_log_id'] . ',0)', 'View'); } ?> </td>
<?php echo showButton($AppUI->_('New contact'), 'js:doEditCard(0, \'&company_id=' . $company_id . '\')'); ?> </td> </tr> </table> <table width="100%" border=0 cellpadding="2" cellspacing="0" class="list"> <tr> <th width="16"> </td> <th><?php echo $AppUI->_('Name'); ?> </td> <th><?php echo $AppUI->_('Email'); ?> </td> <th><?php echo $AppUI->_('Department'); ?> </td> </tr> <?php if (!$total) { showEmptyRow(3, 'padding'); } else { echo $s; } ?> </table>
<th width="100">CC</th> <th width="90%"><?php echo $AppUI->_('Comments'); ?> </th> <th width="24px" class="last"> </th> </tr> <?php // Pull the task comments $sql = "\nSELECT task_log.*, user_username, billingcode_name as task_log_costcode\nFROM task_log\nLEFT JOIN billingcode ON task_log.task_log_costcode = billingcode_id\nLEFT JOIN users ON user_id = task_log_creator\nWHERE task_log_task = {$task_id}" . ($problem ? " AND task_log_problem > '0'" : '') . " ORDER BY task_log_date\n"; $logs = db_loadList($sql); $s = ''; $hrs = 0; $nlogs = 1; if (count($logs) == 0) { showEmptyRow(10, 'second'); } else { foreach ($logs as $row) { $task_log_date = intval($row['task_log_date']) ? new CDate($row['task_log_date']) : null; $style = $row['task_log_problem'] ? 'background-color:#cc6666;color:#f0f0f0' : ''; $s .= $nlogs % 2 == 0 ? '<tr class="first">' : '<tr class="second">'; $nlogs++; $s .= '<td>'; if ($row['task_log_creator'] == $AppUI->user_id || $isMyProject) { // && $perms->checkModuleItem('task_log', 'edit', $task_id)) { if ($tab == -1) { $s .= '<a href="?m=tasks&a=view&task_id=' . $task_id . '&tab=' . $AppUI->getState('TaskLogVwTab'); } else { $s .= '<a href="?m=tasks&a=view&task_id=' . $task_id . '&tab=1'; } $s .= '&task_log_id=' . @$row['task_log_id'] . '#log" title="Edit">' . '<img src="images/edit_log.gif" title="Edit log"></a>';
} ?> <table border="0" cellpadding="7" cellspacing="0" width="100%" class="infopanel"> <tr> <td class="status">Total:</td> <td width="100%"><?php echo $total; ?> persons</td> </tr> </table> <table width="100%" border=0 cellpadding="3" cellspacing="0" class="list"> <tr> <th><?php echo $AppUI->_('Username'); ?> </td> <th width="60%"><?php echo $AppUI->_('Full Name'); ?> </td> </tr> <?php if (!$total) { showEmptyRow(2, 'padding'); } else { echo $s; } ?> </table>
</th> <th class="last" width="1%"><?php echo $AppUI->_('Hours'); ?> </th> </tr> <?php $pdetail = array(); $pdfdata = array(); $subtotal = 0.0; $total_hours = 0.0; $uname = ''; $cdate = ''; if (count($logs) == 0) { showEmptyRow(5, 'second'); } else { foreach ($logs as $log) { $project_name = $log['project_short_name']; $pdetail[$project_name] = $log['project_name'] . ' -- ' . $log['project_description']; $date = new CDate($log['task_log_date']); if ($uname != $log['contact_first_name'] . ' ' . $log['contact_last_name']) { if ($uname != '') { echo '<tr class="second"><td colspan="5" align="right"><b>Sub total:</b></td>' . '<td align="right"><b>' . sprintf("%.2f", $subtotal) . '<b></td></tr>'; $pdfdata[] = array('', '', '', '', '<r><b>Sub total</b>', '<b>' . sprintf("%.2f", $subtotal) . '</b>'); $subtotal = 0; } $uname = $log['contact_first_name'] . ' ' . $log['contact_last_name']; echo '<tr><td colspan="6"><b>' . $uname . '</b></td></tr>'; $pdfdata[] = array('<s><b>' . $uname . '</b>', '', '', '', '', ''); $cdate = '';