Release 2.37 (#5546)
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Configuration\SamlConfigurationInterface;
|
||||
use App\Saml\SamlAuthFactory;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
|
||||
@@ -76,7 +77,7 @@ final class SamlController extends AbstractController
|
||||
throw new \RuntimeException('SAML login failed');
|
||||
}
|
||||
|
||||
return $this->redirect($url);
|
||||
return new RedirectResponse($url);
|
||||
}
|
||||
|
||||
#[Route(path: '/metadata', name: 'saml_metadata')]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Entity\ExportableItem;
|
||||
use App\Entity\ExportTemplate;
|
||||
use App\Export\Base\DispositionInlineInterface;
|
||||
@@ -114,7 +115,7 @@ final class ExportController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(path: '/data', name: 'export_data', methods: ['POST'])]
|
||||
public function export(Request $request): Response
|
||||
public function export(Request $request, SystemConfiguration $systemConfiguration): Response
|
||||
{
|
||||
$query = $this->getDefaultQuery();
|
||||
|
||||
@@ -132,6 +133,9 @@ final class ExportController extends AbstractController
|
||||
throw $this->createNotFoundException('Unknown export renderer');
|
||||
}
|
||||
|
||||
$oldMaxExecTime = \ini_get('max_execution_time');
|
||||
ini_set('max_execution_time', $systemConfiguration->getExportTimeout());
|
||||
|
||||
// display file inline if supported and `markAsExported` is not set
|
||||
if ($renderer instanceof DispositionInlineInterface && !$query->isMarkAsExported()) {
|
||||
$renderer->setDispositionInline(true);
|
||||
@@ -144,6 +148,8 @@ final class ExportController extends AbstractController
|
||||
$this->export->setExported($entries);
|
||||
}
|
||||
|
||||
ini_set('max_execution_time', $oldMaxExecTime);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
abstract class TimesheetAbstractController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
protected TimesheetRepository $repository,
|
||||
protected EventDispatcherInterface $dispatcher,
|
||||
protected TimesheetService $service,
|
||||
protected SystemConfiguration $configuration,
|
||||
protected TagRepository $tagRepository
|
||||
protected readonly TimesheetRepository $repository,
|
||||
protected readonly EventDispatcherInterface $dispatcher,
|
||||
protected readonly TimesheetService $service,
|
||||
protected readonly SystemConfiguration $configuration,
|
||||
protected readonly TagRepository $tagRepository
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -263,7 +263,14 @@ abstract class TimesheetAbstractController extends AbstractController
|
||||
|
||||
$entries = $this->repository->getTimesheetResult($query);
|
||||
|
||||
return $exporter->render($entries->getResults(), $query);
|
||||
$oldMaxExecTime = \ini_get('max_execution_time');
|
||||
ini_set('max_execution_time', $this->configuration->getExportTimeout());
|
||||
|
||||
$response = $exporter->render($entries->getResults(), $query);
|
||||
|
||||
ini_set('max_execution_time', $oldMaxExecTime);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
protected function multiUpdate(Request $request): Response
|
||||
|
||||
Reference in New Issue
Block a user