mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°331 - L'ordre de tri des tickets change au rechargement auto - add ability to give to Menu how to refresh the panel
This commit is contained in:
@@ -1727,7 +1727,7 @@ class MenuBlock extends DisplayBlock
|
||||
}
|
||||
$sClass = $this->m_oFilter->GetClass();
|
||||
$oSet = new CMDBObjectSet($this->m_oFilter);
|
||||
$sRefreshAction = '';
|
||||
$sRefreshAction = $aExtraParams['sRefreshAction']??'';
|
||||
$aActions = [];
|
||||
if ((!isset($aExtraParams['selection_mode']) || $aExtraParams['selection_mode'] == "") && $this->m_sStyle != 'listInObject') {
|
||||
$oAppContext = new ApplicationContext();
|
||||
@@ -1780,7 +1780,7 @@ class MenuBlock extends DisplayBlock
|
||||
}
|
||||
} else {
|
||||
$id = $oObj->GetKey();
|
||||
if (utils::ReadParam('operation') == 'details') {
|
||||
if (empty($sRefreshAction) && utils::ReadParam('operation') == 'details') {
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
|
||||
$sRefreshAction = "window.location.reload();";
|
||||
} else {
|
||||
|
||||
@@ -158,4 +158,9 @@ class DataTable extends UIContentBlock
|
||||
{
|
||||
$this->aOptions = $aOptions;
|
||||
}
|
||||
|
||||
public function GetJSRefresh():array{
|
||||
return ["$('#".$this->sId."').DataTable().clearPipeline();
|
||||
$('#".$this->sId."').DataTable().ajax.reload(null, false);"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
if (!isset($aExtraParams['menu']) || $aExtraParams['menu']) {
|
||||
$oMenuBlock = new MenuBlock($oSet->GetFilter(), $sStyle);
|
||||
$aExtraParams['sRefreshAction'] = $oDataTable->GetJSRefresh()[0];
|
||||
$oBlockMenu = $oMenuBlock->GetRenderContent($oPage, $aExtraParams, $sListId);
|
||||
} else {
|
||||
$oBlockMenu = new UIContentBlock();
|
||||
|
||||
Reference in New Issue
Block a user