diff --git a/pages/ajax.render.php b/pages/ajax.render.php index e3ffa6fb4..3fe68ed5b 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1104,28 +1104,28 @@ EOF $aUpdatedDecoded[] = $sDecodedProp; } - $oDashlet->FromParams($aCurrentValues); - $sPrevClass = get_class($oDashlet); - $oDashlet = $oDashlet->Update($aValues, $aUpdatedDecoded); - $sNewClass = get_class($oDashlet); - if ($sNewClass != $sPrevClass) { - $oPage->add_ready_script("$('#dashlet_$sDashletId').dashlet('option', {dashlet_class: '$sNewClass'});"); - } - if ($oDashlet->IsRedrawNeeded()) { - $oBlock = $oDashlet->DoRender($oPage, true, false, $aExtraParams); - $sHtml = ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock); - $sHtml= json_encode($sHtml); - $oPage->add_script("$('#dashlet_$sDashletId').html({$sHtml});"); - } - if ($oDashlet->IsFormRedrawNeeded()) { - $oForm = $oDashlet->GetForm(); // Rebuild the form since the values/content changed - $oForm->SetSubmitParams(utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php', array('operation' => 'update_dashlet_property', 'extra_params' => $aExtraParams)); - $sHtml = addslashes($oForm->RenderAsPropertySheet($oPage, true, '.itop-dashboard')); - $sHtml= json_encode($sHtml); - $oPage->add_script("$('#dashlet_$sDashletId').html({$sHtml});"); - } + $oDashlet->FromParams($aCurrentValues); + $sPrevClass = get_class($oDashlet); + $oDashlet = $oDashlet->Update($aValues, $aUpdatedDecoded); + $sNewClass = get_class($oDashlet); + if ($sNewClass != $sPrevClass) { + $oPage->add_ready_script("$('#dashlet_$sDashletId').dashlet('option', {dashlet_class: '$sNewClass'});"); } - break; + if ($oDashlet->IsRedrawNeeded()) { + $oBlock = $oDashlet->DoRender($oPage, true, false, $aExtraParams); + $sHtml = ConsoleBlockRenderer::RenderBlockTemplateInPage($oPage, $oBlock); + $sHtml= json_encode($sHtml); + $oPage->add_script("$('#dashlet_$sDashletId').html({$sHtml});"); + } + if ($oDashlet->IsFormRedrawNeeded()) { + $oForm = $oDashlet->GetForm(); // Rebuild the form since the values/content changed + $oForm->SetSubmitParams(utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php', array('operation' => 'update_dashlet_property', 'extra_params' => $aExtraParams)); + $sHtml = $oForm->RenderAsPropertySheet($oPage, true, '.itop-dashboard'); + $sHtml= json_encode($sHtml); + $oPage->add_script("$('#dashlet_$sDashletId').html({$sHtml});"); + } + } + break; case 'dashlet_creation_dlg': $sOQL = utils::ReadParam('oql', '', false, 'raw_data'); diff --git a/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml b/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml index e881069eb..c50abe52b 100644 --- a/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml +++ b/tests/php-unit-tests/unitary-tests/application/applicationextension/Delta/application-extension-usages-in-snippets.xml @@ -291,7 +291,6 @@ class ExampleFor_iQueryModifier implements \iQueryModifier public function GetFieldExpression(QueryBuilderContext &$oBuild, $sClass, $sAttCode, $sColId, Expression $oFieldSQLExp, SQLQuery &$oSelect) { - // Do nothing, we just need the class to exists for the unit test return $oFieldSQLExp; } }