N°2634 / N°2735 Fix dashlets identifiers : was causing prb on widget init, prefs save

Dashlet id now includes :
* "CUSTOM-" if dashlet is contained in a custom dashboard, nothing elsewhere
* the ID of the dashboard
  - for menus : menu id escaped for HTML
  - for AttributeDashboard : <class>__<field>
* the row / cell / dashlet idx

Examples :
CUSTOM-UserRequestOverview_IDrow1-col0-0
Organization__overview_IDrow1-col0-12
This commit is contained in:
Pierre Goiffon
2020-02-13 18:11:22 +01:00
parent 76982a2846
commit cf83bc7364
5 changed files with 24 additions and 5 deletions

View File

@@ -825,6 +825,8 @@ class RuntimeDashboard extends Dashboard
$aRenderParams = $aExtraParams;
}
$aRenderParams['bCustomized'] = $this->bCustomized;
parent::Render($oPage, $bEditMode, $aRenderParams);
if (isset($aExtraParams['query_params']['this->object()']))
@@ -1092,9 +1094,11 @@ EOF
{
$aRenderParams = $aExtraParams;
}
$aRenderParams['dashboard_div_id'] = $aExtraParams['dashboard_div_id'];
$sJSExtraParams = json_encode($aExtraParams);
$oPage->add('<div id="dashboard_editor">');
$oPage->add('<div class="ui-layout-center">');
$this->SetCustomFlag(true);
$this->Render($oPage, true, $aRenderParams);
$oPage->add('</div>');
$oPage->add('<div class="ui-layout-east">');