N°2534 - dashboard: bug with autorefresh that deactivates filtering on organizations

This commit is contained in:
acognet
2020-08-12 14:18:05 +02:00
parent e5487edbfb
commit f90105c107
2 changed files with 11 additions and 2 deletions

View File

@@ -200,7 +200,14 @@ class ApplicationContext
}
return implode("&", $aParams);
}
/**
* Returns the params as c[menu]:..., c[org_id]:....
* @return string The params
*/
public function GetForPostParams()
{
return json_encode( $this->aValues);
}
/**
* Returns the context as sequence of input tags to be inserted inside a <form> tag
* @return string The context as a sequence of <input type="hidden" /> tags

View File

@@ -928,6 +928,8 @@ class RuntimeDashboard extends Dashboard
$sExtraParams = json_encode($aAjaxParams);
$iReloadInterval = 1000 * $this->GetAutoReloadInterval();
$sReloadURL = $this->GetReloadURL();
$oAppContext = new ApplicationContext();
$sContext=$oAppContext->GetForPostParams();
$oPage->add_script(
<<<EOF
if (typeof(AutoReloadDashboardId$sDivId) !== 'undefined')
@@ -945,7 +947,7 @@ class RuntimeDashboard extends Dashboard
{
$('.dashboard_contents#$sDivId').block();
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
{ operation: 'reload_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, reload_url: '$sReloadURL'},
{ operation: 'reload_dashboard', dashboard_id: '$sId', file: '$sFile', extra_params: $sExtraParams, c: $sContext, reload_url: '$sReloadURL'},
function(data){
$('.dashboard_contents#$sDivId').html(data);
$('.dashboard_contents#$sDivId').unblock();