X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=topdf.php;h=b1195a4b93e9772d692b0605c2c15cfac5cb6a18;hb=e1703495130c8ed88fe210f50a2a6b453b3c566b;hp=d017299b7ccb5f424afd6ae3f886576518e688a4;hpb=05b0f8e4762b8a2ca2002a8f7545b7ff68cc3925;p=timetracker.git diff --git a/topdf.php b/topdf.php index d017299b..b1195a4b 100644 --- a/topdf.php +++ b/topdf.php @@ -87,6 +87,9 @@ if ($items && 'no_grouping' != $group_by) { $cur_grouped_by = ''; } +// Build a string to use as filename for the files being downloaded. +$filename = strtolower($i18n->getKey('title.report')).'_'.$bean->mValues['start_date'].'_'.$bean->mValues['end_date']; + // Start preparing HTML to build PDF from. $styleHeader = 'style="background-color:#a6ccf7;"'; $styleSubtotal = 'style="background-color:#e0e0e0;"'; @@ -327,7 +330,7 @@ header('Cache-Control: post-check=0, pre-check=0', false); header('Cache-Control: private', false); header('Content-Type: application/pdf'); -header('Content-Disposition: attachment; filename="timesheet.pdf"'); +header('Content-Disposition: attachment; filename="'.$filename.'.pdf"'); // Beginning of TCPDF code here. @@ -404,6 +407,6 @@ $pdf->writeHTML($html, true, false, false, false, ''); // Close and output PDF document. // $pdf->Output('timesheet.pdf', 'I'); // This will display inline in browser. -$pdf->Output('timesheet.pdf', 'D'); // D is for downloads. +$pdf->Output($filename.'.pdf', 'D'); // D is for downloads. // End of of TCPDF code.