// Output the PDF // make the PDF file if ($project_id != 0) { $project = new CProject(); $project->load($project_id); $pname = 'Project: ' . $project->project_name; } else { $pname = $AppUI->_('All Projects'); } if ($err = db_error()) { $AppUI->setMsg($err, UI_MSG_ERROR); $AppUI->redirect('m=' . $m); } $date = new w2p_Utilities_Date(); $last_week = new w2p_Utilities_Date($date); $last_week->subtractSpan(new Date_Span(array(7, 0, 0, 0))); $title = $AppUI->_('Tasks Completed Since') . ' ' . $last_week->format($df); $options = array('showLines' => 2, 'showHeadings' => 1, 'fontSize' => 9, 'rowGap' => 4, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '750', 'shaded' => 0, 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'left', 'width' => 120), 2 => array('justification' => 'center', 'width' => 120), 3 => array('justification' => 'center', 'width' => 75), 4 => array('justification' => 'center', 'width' => 75))); $hasResources = $AppUI->isActiveModule('resources'); $perms =& $AppUI->acl(); if ($hasResources) { $hasResources = canView('resources'); } // Build the data to go into the table. $pdfdata = array(); $columns = array(); $columns[] = '<b>' . $AppUI->_('Task Name') . '</b>'; $columns[] = '<b>' . $AppUI->_('Owner') . '</b>'; $columns[] = '<b>' . $AppUI->_('Assigned Users') . '</b>'; if ($hasResources) { $columns[] = '<b>' . $AppUI->_('Assigned Resources') . '</b>';
$sign = -1; } $day_word = strtok(' '); if ($day_word == $AppUI->_('Day')) { $days = $period_value; } elseif ($day_word == $AppUI->_('Week')) { $days = 7 * $period_value; } elseif ($day_word == $AppUI->_('Month')) { $days = 30 * $period_value; } $start_date = new w2p_Utilities_Date($ts); $end_date = new w2p_Utilities_Date($ts); if ($sign > 0) { $end_date->addSpan(new Date_Span(array($days, 0, 0, 0))); } else { $start_date->subtractSpan(new Date_Span(array($days, 0, 0, 0))); } $do_report = 1; } else { // create Date objects from the datetime fields $start_date = intval($log_start_date) ? new w2p_Utilities_Date($log_start_date) : new w2p_Utilities_Date(); $end_date = intval($log_end_date) ? new w2p_Utilities_Date($log_end_date) : new w2p_Utilities_Date(); } if (!$log_start_date) { $start_date->subtractSpan(new Date_Span('14,0,0,0')); } $end_date->setTime(23, 59, 59); if (function_exists('styleRenderBoxTop')) { echo styleRenderBoxTop(); } ?>
$sign = -1; } $day_word = strtok(' '); if ($day_word == $AppUI->_('Day')) { $days = $period_value; } elseif ($day_word == $AppUI->_('Week')) { $days = 7 * $period_value; } elseif ($day_word == $AppUI->_('Month')) { $days = 30 * $period_value; } $start_date = new w2p_Utilities_Date($ts); $end_date = new w2p_Utilities_Date($ts); if ($sign > 0) { $end_date->addSpan(new Date_Span("{$days},0,0,0")); } else { $start_date->subtractSpan(new Date_Span("{$days},0,0,0")); } $do_report = 1; } else { // create Date objects from the datetime fields $start_date = intval($list_start_date) ? new w2p_Utilities_Date($list_start_date) : new w2p_Utilities_Date(); $end_date = intval($list_end_date) ? new w2p_Utilities_Date($list_end_date) : new w2p_Utilities_Date(); } if (!$list_start_date) { $start_date->subtractSpan(new Date_Span('14,0,0,0')); } $end_date->setTime(23, 59, 59); if (function_exists('styleRenderBoxTop')) { echo styleRenderBoxTop(); } ?>