commit12
This commit is contained in:
@@ -25,7 +25,13 @@ final class RequireCompanyContext
|
||||
abort_unless(is_string($token) && hash_equals($selection['token'] ?? '', $token), 409, 'O contexto mudou. Reabra o formulário antes de guardar.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
app(\App\Shared\Context\RequireModuleContext::class)->check($request, $this->context);
|
||||
$response = $next($request);
|
||||
if ($request->isMethod('GET') && in_array($request->path(), ['supplier-payables','supplier-payments'], true) && $response->isSuccessful()) {
|
||||
$bar = '<nav aria-label="Contexto SGF" style="padding:12px;background:#edf4f3;color:#163e38"><strong>Módulo activo: Compras</strong> · <a href="/" data-sgf-module-back>Voltar à navegação SGF</a></nav><script src="/sgf-module-context.js" defer></script>';
|
||||
$response->setContent(preg_replace('/(<body\b[^>]*>)/i', '$1'.$bar, $response->getContent(), 1));
|
||||
}
|
||||
return $response;
|
||||
} finally {
|
||||
$this->context->clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user