diff --git a/application/dashlet.class.inc.php b/application/dashlet.class.inc.php index a614cc156..ce6645269 100644 --- a/application/dashlet.class.inc.php +++ b/application/dashlet.class.inc.php @@ -2097,8 +2097,20 @@ class DashletHeaderDynamic extends Dashlet $sQuery = $this->aProperties['query']; $sGroupBy = $this->aProperties['group_by']; - $oQuery = $this->oModelReflection->GetQuery($sQuery); - $sClass = $oQuery->GetClass(); + $aValueLabels = []; + $aValues = []; + try { + $oQuery = $this->oModelReflection->GetQuery($sQuery); + $sClass = $oQuery->GetClass(); + $aValues = $this->GetValues(); + foreach ($aValues as $sValue) { + $aValueLabels[] = $this->oModelReflection->GetValueLabel($sClass, $sGroupBy, $sValue); + } + } + catch (UnknownClassOqlException $e) { + $aValueLabels[] = $e->GetUserFriendlyDescription(); + $aValues[] = 1; + } $oIconSelect = $this->oModelReflection->GetIconSelectionField('icon'); $sIconPath = utils::HtmlEntities($oIconSelect->MakeFileUrl($sIcon)); @@ -2111,20 +2123,18 @@ class DashletHeaderDynamic extends Dashlet $sBlockId = 'block_fake_'.$this->sId.($bEditMode ? '_edit' : ''); // make a unique id (edition occuring in the same DOM) $iTotal = 0; - $aValues = $this->GetValues(); $sHtml .= '
| '.$sValueLabel.' | '; } $sHtml .= '
|---|
| '.$iCount.' | '; }