$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
array_push($fields, 'cfl.value as cf_1');
$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
array_push($fields, 'cfl.value as cf_1');
$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
array_push($fields, 'cfl.value as cf_1');
$cf_1_type = $custom_fields->fields[0]['type'];
if ($cf_1_type == CustomFields::TYPE_TEXT) {
array_push($fields, 'cfl.value as cf_1');
if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT)
$group_join = 'left join tt_custom_field_log cfl on (l.id = cfl.log_id and cfl.status = 1) left join tt_custom_field_options cfo on (cfl.value = cfo.id) ';
elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)
if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT)
$group_join = 'left join tt_custom_field_log cfl on (l.id = cfl.log_id and cfl.status = 1) left join tt_custom_field_options cfo on (cfl.value = cfo.id) ';
elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)
if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT)
$group_join = 'left join tt_custom_field_log cfl on (l.id = cfl.log_id and cfl.status = 1) left join tt_custom_field_options cfo on (cfl.value = cfo.id) ';
elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)
if ($custom_fields->fields[0]['type'] == CustomFields::TYPE_TEXT)
$group_join = 'left join tt_custom_field_log cfl on (l.id = cfl.log_id and cfl.status = 1) left join tt_custom_field_options cfo on (cfl.value = cfo.id) ';
elseif ($custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)
// Define some styles to use in email.
$style_title = 'text-align: center; font-size: 15pt; font-family: Arial, Helvetica, sans-serif;';
// Define some styles to use in email.
$style_title = 'text-align: center; font-size: 15pt; font-family: Arial, Helvetica, sans-serif;';
}
$body .= '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
$body .= '<tr>';
$body .= '<td style="'.$tableHeader.'">'.$group_by_header.'</td>';
if ($bean->getAttribute('chduration'))
}
$body .= '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
$body .= '<tr>';
$body .= '<td style="'.$tableHeader.'">'.$group_by_header.'</td>';
if ($bean->getAttribute('chduration'))
if ($bean->getAttribute('chduration')) {
$body .= '<td style="'.$cellRightAlignedSubtotal.'">';
if ($totals['time'] <> '0:00') $body .= $totals['time'];
if ($bean->getAttribute('chduration')) {
$body .= '<td style="'.$cellRightAlignedSubtotal.'">';
if ($totals['time'] <> '0:00') $body .= $totals['time'];
if ($bean->getAttribute('chcf_1'))
$body .= '<td style="'.$tableHeader.'">'.htmlspecialchars($custom_fields->fields[0]['label']).'</td>';
if ($bean->getAttribute('chstart'))
if ($bean->getAttribute('chcf_1'))
$body .= '<td style="'.$tableHeader.'">'.htmlspecialchars($custom_fields->fields[0]['label']).'</td>';
if ($bean->getAttribute('chstart'))
$cur_grouped_by = $record['grouped_by'];
if ($cur_grouped_by != $prev_grouped_by && !$first_pass) {
$body .= '<tr style="'.$rowSubtotal.'">';
$cur_grouped_by = $record['grouped_by'];
if ($cur_grouped_by != $prev_grouped_by && !$first_pass) {
$body .= '<tr style="'.$rowSubtotal.'">';
$subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($bean->getAttribute('chclient')) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($bean->getAttribute('chclient')) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$body .= '<td style="'.$cellRightAligned.'">'.$record['cost'].'</td>';
if ($bean->getAttribute('chpaid')) {
$body .= '<td style="'.$cellRightAligned.'">';
$body .= '<td style="'.$cellRightAligned.'">'.$record['cost'].'</td>';
if ($bean->getAttribute('chpaid')) {
$body .= '<td style="'.$cellRightAligned.'">';
$subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($bean->getAttribute('chclient')) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($bean->getAttribute('chclient')) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
if ($canViewReports || $isClient) $body .= '<td></td>';
if ($bean->getAttribute('chclient')) $body .= '<td></td>';
if ($bean->getAttribute('chproject')) $body .= '<td></td>';
if ($canViewReports || $isClient) $body .= '<td></td>';
if ($bean->getAttribute('chclient')) $body .= '<td></td>';
if ($bean->getAttribute('chproject')) $body .= '<td></td>';
// Define some styles to use in email.
$style_title = 'text-align: center; font-size: 15pt; font-family: Arial, Helvetica, sans-serif;';
// Define some styles to use in email.
$style_title = 'text-align: center; font-size: 15pt; font-family: Arial, Helvetica, sans-serif;';
}
$body .= '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
$body .= '<tr>';
$body .= '<td style="'.$tableHeader.'">'.$group_by_header.'</td>';
if ($report['show_duration'])
}
$body .= '<table border="0" cellpadding="4" cellspacing="0" width="100%">';
$body .= '<tr>';
$body .= '<td style="'.$tableHeader.'">'.$group_by_header.'</td>';
if ($report['show_duration'])
if ($report['show_duration']) {
$body .= '<td style="'.$cellRightAlignedSubtotal.'">';
if ($totals['time'] <> '0:00') $body .= $totals['time'];
if ($report['show_duration']) {
$body .= '<td style="'.$cellRightAlignedSubtotal.'">';
if ($totals['time'] <> '0:00') $body .= $totals['time'];
if ($report['show_custom_field_1'])
$body .= '<td style="'.$tableHeader.'">'.htmlspecialchars($custom_fields->fields[0]['label']).'</td>';
if ($report['show_start'])
if ($report['show_custom_field_1'])
$body .= '<td style="'.$tableHeader.'">'.htmlspecialchars($custom_fields->fields[0]['label']).'</td>';
if ($report['show_start'])
$cur_grouped_by = $record['grouped_by'];
if ($cur_grouped_by != $prev_grouped_by && !$first_pass) {
$body .= '<tr style="'.$rowSubtotal.'">';
$cur_grouped_by = $record['grouped_by'];
if ($cur_grouped_by != $prev_grouped_by && !$first_pass) {
$body .= '<tr style="'.$rowSubtotal.'">';
$subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($report['show_client']) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$subtotal_name = htmlspecialchars($subtotals[$prev_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($report['show_client']) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$body .= '<td style="'.$cellRightAligned.'">'.$record['cost'].'</td>';
if ($report['show_paid']) {
$body .= '<td style="'.$cellRightAligned.'">';
$body .= '<td style="'.$cellRightAligned.'">'.$record['cost'].'</td>';
if ($report['show_paid']) {
$body .= '<td style="'.$cellRightAligned.'">';
$subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($report['show_client']) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
$subtotal_name = htmlspecialchars($subtotals[$cur_grouped_by]['name']);
if ($canViewReports || $isClient) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'user' ? $subtotal_name : '').'</td>';
if ($report['show_client']) $body .= '<td style="'.$cellLeftAlignedSubtotal.'">'.($group_by == 'client' ? $subtotal_name : '').'</td>';
if ($canViewReports || $isClient) $body .= '<td></td>';
if ($report['show_client']) $body .= '<td></td>';
if ($report['show_project']) $body .= '<td></td>';
if ($canViewReports || $isClient) $body .= '<td></td>';
if ($report['show_client']) $body .= '<td></td>';
if ($report['show_project']) $body .= '<td></td>';