[3.0] Update Symfony to 7.4 and dependencies, removed deprecated code, removed API password (#5622)
* deactivate deprecated auto-mapping * use native month-picker with fallback on old browser * bump dependencies to new major versions * replace deprecated ARRAY column type with JSON * named arguments * nullable arguments * native lazy ghosts * update routes to use php config * disable PHP < 8.4 * use static RTL configuration * new qr code package * clear out env file * recipe updates * fix deprecations * preset new env variable if not existing * bump maria db version examples * remove deprecated api-token support * fix validator deprecations * remove timesheet category column * fix broken validator autoconfiguration * stabilize tests * fix migration syntax compatibility * fix doctrine deprecation * fix datetime format * remove constructor dependency * only include visible preferences in invoice templates * fix test container dependency * removed ProjectConstraint multi-constraint logic * allow to disable plugins in certain environments * refactor TimesheetConstraint to non-service * activate new interface methods * prevent update issues with .env * improved customer fixture * removed $user->isExportDecimal()
This commit is contained in:
@@ -18,17 +18,11 @@ use App\Pdf\PdfRendererTrait;
|
||||
use App\Project\ProjectStatisticService;
|
||||
use App\Repository\Query\TimesheetQuery;
|
||||
use App\Twig\SecurityPolicy\ExportPolicy;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Exclude;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Twig\Environment;
|
||||
use Twig\Extension\SandboxExtension;
|
||||
|
||||
/**
|
||||
* TODO 3.0 remove default values from constructor parameters and make class final
|
||||
* @final
|
||||
*/
|
||||
#[Exclude]
|
||||
class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
final class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
{
|
||||
use RendererTrait;
|
||||
use PDFRendererTrait;
|
||||
@@ -39,14 +33,14 @@ class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
private readonly Environment $twig,
|
||||
private readonly HtmlToPdfConverter $converter,
|
||||
private readonly ProjectStatisticService $projectStatisticService,
|
||||
private string $id = 'pdf', // deprecated default parameter - TODO 3.0
|
||||
private string $title = 'pdf', // deprecated default parameter - TODO 3.0
|
||||
private string $template = 'export/pdf-layout.html.twig', // deprecated default parameter - TODO 3.0
|
||||
private string $id,
|
||||
private string $title,
|
||||
private string $template,
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function isInternal(): bool
|
||||
public function isInternal(): false
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -66,18 +60,6 @@ class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
protected function getOptions(TimesheetQuery $query): array
|
||||
{
|
||||
$decimal = false;
|
||||
if (null !== $query->getCurrentUser()) {
|
||||
$decimal = $query->getCurrentUser()->isExportDecimal();
|
||||
} elseif (null !== $query->getUser()) {
|
||||
$decimal = $query->getUser()->isExportDecimal();
|
||||
}
|
||||
|
||||
return ['decimal' => $decimal];
|
||||
}
|
||||
|
||||
public function getPdfOptions(): array
|
||||
{
|
||||
return $this->pdfOptions;
|
||||
@@ -107,14 +89,14 @@ class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
$sandbox->enableSandbox();
|
||||
$this->twig->addExtension($sandbox);
|
||||
|
||||
$content = $this->twig->render($this->getTemplate(), array_merge([
|
||||
$content = $this->twig->render($this->getTemplate(), [
|
||||
'entries' => $exportItems,
|
||||
'query' => $query,
|
||||
'summaries' => $summary,
|
||||
'budgets' => $this->calculateProjectBudget($exportItems, $query, $this->projectStatisticService),
|
||||
'decimal' => false,
|
||||
'pdfContext' => $context
|
||||
], $this->getOptions($query)));
|
||||
]);
|
||||
|
||||
$pdfOptions = array_merge($context->getOptions(), $this->getPdfOptions());
|
||||
|
||||
@@ -123,30 +105,6 @@ class PDFRenderer implements DispositionInlineInterface, ExportRendererInterface
|
||||
return $this->createPdfResponse($content, $context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.40.0
|
||||
*/
|
||||
public function setTemplate(string $filename): void
|
||||
{
|
||||
$this->template = '@export/' . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.40.0
|
||||
*/
|
||||
public function setId(string $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.40.0
|
||||
*/
|
||||
public function setTitle(string $title): void
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
|
||||
Reference in New Issue
Block a user