$pname = db_loadResult($sql); } else { $pname = $AppUI->_('All Projects'); } $font_dir = $dPconfig['root_dir'] . "/lib/ezpdf/fonts"; $temp_dir = $dPconfig['root_dir'] . "/files/temp"; $base_url = $dPconfig['base_url']; require $AppUI->getLibraryClass('ezpdf/class.ezpdf'); $pdf =& new Cezpdf($paper = 'A4', $orientation = 'landscape'); $pdf->ezSetCmMargins(1, 2, 1.5, 1.5); $pdf->selectFont("{$font_dir}/Helvetica.afm"); $pdf->ezText(dPgetConfig('company_name'), 12); $date = new CDate(); $pdf->ezText("\n" . $date->format($df), 8); $last_week = new CDate($date); $last_week->subtractSpan(new Date_Span(array(7, 0, 0, 0))); $pdf->selectFont("{$font_dir}/Helvetica-Bold.afm"); $pdf->ezText("\n" . $AppUI->_('Project Completed Task Report'), 12); $pdf->ezText("{$pname}", 15); $pdf->ezText($AppUI->_('Tasks Completed Since') . " " . $last_week->format($df), 10); $pdf->ezText("\n"); $pdf->selectFont("{$font_dir}/Helvetica.afm"); $title = null; $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' => 95), 2 => array('justification' => 'center', 'width' => 75), 3 => array('justification' => 'center', 'width' => 75), 4 => array('justification' => 'center', 'width' => 75))); $hasResources = $AppUI->isActiveModule('resources'); $perms =& $AppUI->acl(); if ($hasResources) { $hasResources = $perms->checkModule('resources', 'view'); } // Build the data to go into the table. $pdfdata = array();
$days = $period_value; } else { if ($day_word == $AppUI->_("Week")) { $days = 7 * $period_value; } else { if ($day_word == $AppUI->_("Month")) { $days = 30 * $period_value; } } } $start_date = new CDate($ts); $end_date = new CDate($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 CDate($list_start_date) : new CDate(); $end_date = intval($list_end_date) ? new CDate($list_end_date) : new CDate(); } if (!$list_start_date) { $start_date->subtractSpan(new Date_Span("14,0,0,0")); } $end_date->setTime(23, 59, 59); ?> <script language="javascript"> Calendar.enabled = true; </script>