mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
N°2198 Fix "invalid filter" error when refreshing "Requests assigned to me"
This commit is contained in:
@@ -1172,16 +1172,21 @@ EOF
|
||||
}
|
||||
if (($bAutoReload) && ($this->m_sStyle != 'search')) // Search form do NOT auto-reload
|
||||
{
|
||||
$sFilter = addslashes(str_replace('"', "'", $this->m_oFilter->serialize())); // Used either for asynchronous or auto_reload
|
||||
$sExtraParams = addslashes(str_replace('"', "'", json_encode($aExtraParams))); // JSON encode, change the style of the quotes and escape them
|
||||
// Used either for asynchronous or auto_reload
|
||||
$sFilter = addslashes(str_replace("'", "\'", $this->m_oFilter->serialize()));
|
||||
$sExtraParams = addslashes(str_replace("'", "\'", json_encode($aExtraParams)));
|
||||
|
||||
$oPage->add_script('if (typeof window.oAutoReloadBlock == "undefined") {
|
||||
window.oAutoReloadBlock = {};
|
||||
}
|
||||
if (typeof window.oAutoReloadBlock[\''.$sId.'\'] != "undefined") {
|
||||
clearInterval(window.oAutoReloadBlock[\''.$sId.'\']);
|
||||
}
|
||||
window.oAutoReloadBlock[\''.$sId.'\'] = setInterval("ReloadBlock(\''.$sId.'\', \''.$this->m_sStyle.'\', \"'.$sFilter.'\", \"'.$sExtraParams.'\")", '.$iReloadInterval.');');
|
||||
$oPage->add_script(
|
||||
<<<JS
|
||||
if (typeof window.oAutoReloadBlock == "undefined") {
|
||||
window.oAutoReloadBlock = {};
|
||||
}
|
||||
if (typeof window.oAutoReloadBlock['$sId'] != "undefined") {
|
||||
clearInterval(window.oAutoReloadBlock['$sId']);
|
||||
}
|
||||
window.oAutoReloadBlock['$sId'] = setInterval("ReloadBlock('$sId', '{$this->m_sStyle}', '$sFilter', '$sExtraParams')", '$iReloadInterval');
|
||||
JS
|
||||
);
|
||||
}
|
||||
|
||||
return $sHtml;
|
||||
|
||||
@@ -199,7 +199,7 @@ function ReloadBlock(divId, sStyle, sSerializedFilter, sExtraParams) {
|
||||
$('#'+divId).block();
|
||||
|
||||
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php?style='+sStyle,
|
||||
{operation: 'ajax', filter: sSerializedFilter, extra_params: sExtraParams},
|
||||
{operation: 'ajax', filter: sSerializedFilter, encoding: 'serialize', extra_params: sExtraParams},
|
||||
function (data) {
|
||||
$('#'+divId).empty();
|
||||
$('#'+divId).append(data);
|
||||
|
||||
Reference in New Issue
Block a user