public function render($return = false) { $this->_pdf = new \GO\Base\Util\Pdf(); $this->_pdf->title = $this->name(); if (!empty($_REQUEST['startdate'])) { $this->_pdf->subtitle = $_REQUEST['startdate']; if (!empty($_REQUEST['enddate'])) { $this->_pdf->subtitle .= " - " . $_REQUEST['enddate']; } } $this->_pdf->AddPage(); $this->_addTimeEntries(); if ($this->project) { $findParams = GO\Base\Db\FindParams::newInstance(); $findParams->getCriteria()->addCondition("path", $this->project->path . '/%', 'LIKE'); $findParams->getCriteria()->addCondition("id", $this->project->id, 'LIKE', 't', false); $stmt = GO\Projects2\Model\Project::model()->find($findParams); if ($stmt->rowCount()) { $this->_pdf->Ln(10); $this->_pdf->h2(GO::t('timeEntriesPerProject', 'projects2')); foreach ($stmt as $project) { $this->_addTimeEntries($project); } } } else { $this->_addHolidays(); } if ($return) { return $this->_pdf->Output($this->filename . ".pdf", 'I'); } else { \GO\Base\Util\Http::outputDownloadHeaders(new \GO\Base\Fs\File($this->filename . ".pdf")); echo $this->_pdf->Output($this->filename . ".pdf", 'I'); } }
public function render($return = false) { $this->_pdf = new Pdf('L'); // $this->_pdf->font_size=8; $this->_pdf->title = $this->name(); if ($this->project) { $this->_pdf->title .= ': ' . $this->project->path; } if (!empty($_REQUEST['startdate'])) { $this->_pdf->subtitle = $_REQUEST['startdate']; if (!empty($_REQUEST['enddate'])) { $this->_pdf->subtitle .= " - " . $_REQUEST['enddate']; } } $this->_pdf->AddPage(); $this->_addProjects(); if ($return) { return $this->_pdf->Output($this->filename . ".pdf", 'I'); } else { Http::outputDownloadHeaders(new File($this->filename . ".pdf")); echo $this->_pdf->Output($this->filename . ".pdf", 'I'); } }
public function render($return = false) { $this->_pdf = new \GO\Base\Util\Pdf(); $this->_pdf->title = \GO::t('projectReport', 'projects2'); if (!empty($_REQUEST['startdate'])) { $this->_pdf->subtitle = $_REQUEST['startdate']; if (!empty($_REQUEST['enddate'])) { $this->_pdf->subtitle .= " - " . $_REQUEST['enddate']; } } $this->_pdf->AddPage(); $this->_addProjectInfo(); $this->_addTasks(); $this->_addTimeEntries(); $this->_addExpenses(); // $this->_addMileage(); // exit; if ($return) { return $this->_pdf->Output($this->filename . ".pdf", 'I'); } else { \GO\Base\Util\Http::outputDownloadHeaders(new \GO\Base\Fs\File($this->filename . ".pdf")); echo $this->_pdf->Output($this->filename . ".pdf", 'I'); } }