added inline disposition for PDF previews (#3486)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Export\Base\DispositionInlineInterface;
|
||||
use App\Export\ExportItemInterface;
|
||||
use App\Export\ServiceExport;
|
||||
use App\Export\TooManyItemsExportException;
|
||||
@@ -117,6 +118,11 @@ class ExportController extends AbstractController
|
||||
throw $this->createNotFoundException('Unknown export renderer');
|
||||
}
|
||||
|
||||
// display file inline if supported and `markAsExported` is not set
|
||||
if ($renderer instanceof DispositionInlineInterface && !$query->isMarkAsExported()) {
|
||||
$renderer->setDispositionInline(true);
|
||||
}
|
||||
|
||||
$entries = $this->getEntries($query);
|
||||
$response = $renderer->render($entries, $query);
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ final class InvoiceController extends AbstractController
|
||||
$query->setCustomers([$customer]);
|
||||
$model = $this->service->createModel($query);
|
||||
|
||||
return $this->service->renderInvoiceWithModel($model, $this->dispatcher);
|
||||
return $this->service->renderInvoiceWithModel($model, $this->dispatcher, true);
|
||||
} catch (Exception $ex) {
|
||||
$this->logException($ex);
|
||||
$this->flashError('action.update.error', ['%reason%' => $ex->getMessage()]);
|
||||
|
||||
Reference in New Issue
Block a user