EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Use router param
Yuriib4106f8ba5cf
diff --git a/application/Espo/Core/Utils/Client/ActionRenderer.php b/application/Espo/Core/Utils/Client/ActionRenderer.phpindex 80c900a943..ee950fbc43 100644--- a/application/Espo/Core/Utils/Client/ActionRenderer.php+++ b/application/Espo/Core/Utils/Client/ActionRenderer.php@@ -59,6 +59,7 @@ class ActionRenderertheme: $params->getTheme(),direction: $params->getDirection(),login: $params->login(),+ useRouter: $params->useRouter(),);$securityParams = $params->getSecurityParams();@@ -88,6 +89,7 @@ class ActionRenderer?string $theme,?Direction $direction,bool $login,+ bool $useRouter,): string {$encodedData = Json::encode($data);@@ -122,7 +124,7 @@ class ActionRendererpageTitle: $pageTitle,theme: $theme,direction: $direction,- useRouter: false,+ useRouter: $useRouter,);return $this->clientManager->render($params);diff --git a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php b/application/Espo/Core/Utils/Client/ActionRenderer/Params.phpindex e732e9bbf8..d6bb4bc1fb 100644--- a/application/Espo/Core/Utils/Client/ActionRenderer/Params.php+++ b/application/Espo/Core/Utils/Client/ActionRenderer/Params.php@@ -50,6 +50,7 @@ class Paramsprivate ?Direction $direction = null;private bool $login = false;private ?SecurityParams $securityParams = null;+ private bool $useRouter = false;/*** @param ?array<string, mixed> $data@@ -81,6 +82,17 @@ class Paramsreturn $obj;}+ /**+ * @since 10.1.0+ */+ public function withUserRouter(bool $useRouter = true): self+ {+ $obj = clone $this;+ $obj->useRouter = $useRouter;++ return $obj;+ }+public function withInitAuth(bool $initAuth = true): self{$obj = clone $this;@@ -246,4 +258,12 @@ class Params{return $this->securityParams;}++ /**+ * @since 10.1.0+ */+ public function useRouter(): bool+ {+ return $this->useRouter;+ }}diff --git a/application/Espo/EntryPoints/LoginAs.php b/application/Espo/EntryPoints/LoginAs.phpindex d79acafa45..cd14dd8d0f 100644--- a/application/Espo/EntryPoints/LoginAs.php+++ b/application/Espo/EntryPoints/LoginAs.php@@ -60,6 +60,7 @@ class LoginAs implements EntryPoint'anotherUser' => $anotherUser,'username' => $request->getQueryParam('username'),])+ ->withUserRouter()->withInitAuth());}