mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Merge remote-tracking branch 'origin/support/2.7' into develop
# Conflicts: # application/transaction.class.inc.php # application/ui.extkeywidget.class.inc.php # composer.json # composer.lock # js/utils.js # lib/composer/InstalledVersions.php # lib/composer/installed.json # lib/composer/installed.php # lib/pear/archive_tar/Archive/Tar.php # lib/pear/archive_tar/package.xml # setup/wizardsteps.class.inc.php # sources/Controller/AjaxRenderController.php
This commit is contained in:
@@ -31,12 +31,40 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
*/
|
||||
abstract class AbstractController extends Controller
|
||||
{
|
||||
/**
|
||||
* Unlike {@see \Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait::redirectToRoute()}, this method directly calls the route controller without creating a redirection client side
|
||||
*
|
||||
* Default route params will be preserved (see N°4356)
|
||||
*
|
||||
* @param string $sRouteName
|
||||
* @param array $aRouteParams
|
||||
* @param array $aQueryParameters
|
||||
* @param bool $bPreserveDefaultRouteParams if true will merge in aRouteParams the default parameters defined for the specified route
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @since 2.7.6 3.0.0 N°4356 method creation
|
||||
*/
|
||||
protected function ForwardToRoute($sRouteName, $aRouteParams, $aQueryParameters, $bPreserveDefaultRouteParams = true)
|
||||
{
|
||||
$oRouteCollection = $this->get('router')->getRouteCollection();
|
||||
$aRouteDefaults = $oRouteCollection->get($sRouteName)->getDefaults();
|
||||
|
||||
if ($bPreserveDefaultRouteParams) {
|
||||
$aRouteParams = array_merge($aRouteDefaults, $aRouteParams);
|
||||
}
|
||||
|
||||
return $this->forward($aRouteDefaults['_controller'], $aRouteParams, $aQueryParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sRouteName
|
||||
* @param array $aRouteParams
|
||||
* @param array $aQueryParameters
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @deprecated 2.7.6 N°4356 use {@see ForwardToRoute} instead !
|
||||
*/
|
||||
protected function ForwardFromRoute($sRouteName, $aRouteParams, $aQueryParameters)
|
||||
{
|
||||
@@ -51,6 +79,8 @@ abstract class AbstractController extends Controller
|
||||
* @param string $sRouteName
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @deprecated 2.7.6 N°4356 use {@see ForwardToRoute} instead !
|
||||
*/
|
||||
protected function GetControllerNameFromRoute($sRouteName)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ class CreateBrickController extends BrickController
|
||||
$aRouteParams['ar_token'] = ContextManipulatorHelper::PrepareAndEncodeRulesToken($aRules);
|
||||
}
|
||||
|
||||
return $this->ForwardFromRoute('p_object_create', $aRouteParams, $oRequest->query->all());
|
||||
return $this->ForwardToRoute('p_object_create', $aRouteParams, $oRequest->query->all());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ class ObjectController extends BrickController
|
||||
'sObjectClass' => get_class($oTargetObject),
|
||||
);
|
||||
|
||||
return $this->ForwardFromRoute('p_object_create', $aRouteParams, $oRequest->query->all());
|
||||
return $this->ForwardToRoute('p_object_create', $aRouteParams, $oRequest->query->all());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1198,7 +1198,7 @@ class ObjectController extends BrickController
|
||||
'sObjectField' => 'contents',
|
||||
);
|
||||
|
||||
$oResponse = $this->forward($this->GetControllerNameFromRoute('p_object_document_download'), $aRouteParams, $oRequest->query->all());
|
||||
$oResponse = $this->ForwardToRoute('p_object_document_download', $aRouteParams, $oRequest->query->all());
|
||||
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user