diff --git a/sources/application/UI/Base/Component/DataTable/DataTable.php b/sources/application/UI/Base/Component/DataTable/DataTable.php index dd7baaf0d..5f85093b1 100644 --- a/sources/application/UI/Base/Component/DataTable/DataTable.php +++ b/sources/application/UI/Base/Component/DataTable/DataTable.php @@ -7,6 +7,7 @@ namespace Combodo\iTop\Application\UI\Base\Component\DataTable; +use ApplicationContext; use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock; use Combodo\iTop\Application\UI\Base\tJSRefreshCallback; use DataTableConfig; @@ -71,7 +72,19 @@ class DataTable extends UIContentBlock */ public function SetAjaxUrl(string $sAjaxUrl): void { - $this->sAjaxUrl = $sAjaxUrl; + if (strlen($sAjaxUrl) > 0) + { + $oAppContext = new ApplicationContext(); + if(strpos ($sAjaxUrl,'?')) { + $this->sAjaxUrl = $sAjaxUrl."&".$oAppContext->GetForLink(); + } else { + $this->sAjaxUrl = $sAjaxUrl."?".$oAppContext->GetForLink(); + } + } + else + { + $this->sAjaxUrl = $sAjaxUrl; + } } /** diff --git a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php index 625e4e5da..8b318b813 100644 --- a/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php +++ b/sources/application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php @@ -780,7 +780,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory "select_mode" => $sSelectMode, ]); - + $oAppContext = new ApplicationContext(); $aOptions = array_merge($aOptions, [ "language" => [ @@ -815,7 +815,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory "columns" => $aColumnsDefinitions, "allColumns" => $aColumns, 'ajax' => '$.fn.dataTable.pipeline( { - "url": "ajax.render.php", + "url": "ajax.render.php?'.$oAppContext->GetForLink().'", "data": '.$sAjaxData.', "method": "post", "pages": 5 // number of pages to cache diff --git a/sources/application/search/searchform.class.inc.php b/sources/application/search/searchform.class.inc.php index 8b120ed00..623818860 100644 --- a/sources/application/search/searchform.class.inc.php +++ b/sources/application/search/searchform.class.inc.php @@ -248,7 +248,7 @@ class SearchForm 'criterion_outer_selector' => "#fs_{$sSearchFormId}_criterion_outer", 'result_list_outer_selector' => "#{$aExtraParams['result_list_outer_selector']}", 'data_config_list_selector' => "#{$aExtraParams['result_list_outer_selector']}", - 'endpoint' => utils::GetAbsoluteUrlAppRoot().'pages/ajax.searchform.php', + 'endpoint' => utils::GetAbsoluteUrlAppRoot().'pages/ajax.searchform.php?'.$sContext, 'init_opened' => $bOpen, 'auto_submit' => $bAutoSubmit, 'list_params' => $aListParams,