*/ /** * Klasa stInvoiceFrontendActions. * * @package stInvoicePlugin * @subpackage actions */ class stOrderPrintPdfActions extends stActions { public function executeShow() { sfLoader::loadHelpers('Helper'); sfLoader::loadHelpers('Partial'); sfLoader::loadHelpers('stPartial'); $order_id = $this->getRequestParameter('id',null); $download = $this->getRequestParameter('download',false); $culture = $this->getRequestParameter('culture', $this->getUser()->getCulture()); if (!$order_id) { return sfView::NONE; } $order = OrderPeer::retrieveByPK($order_id); if (!$order) { return sfView::NONE; } $pdf = new stOrderPrintPdf($order); $pdf->setCulture($culture); $pdf->forceDownload($download); $response = $this->getResponse(); $response->clearHttpHeaders(); $response->setHttpHeader('Content-Type', 'application/pdf'); $response->setHttpHeader('Content-Disposition', 'attachment;filename="'.$order->getNumber().'.pdf'); return $this->renderText($pdf->renderOrder()); } }