public function GetPropertiesFields(DesignerForm $oForm) { $oField = new DesignerTextField('title', Dict::S('UI:DashletHeaderDynamic:Prop-Title'), $this->aProperties['title']); $oForm->AddField($oField); $oField = $this->oModelReflection->GetIconSelectionField('icon', Dict::S('UI:DashletHeaderDynamic:Prop-Icon'), $this->aProperties['icon']); $oForm->AddField($oField); $oField = new DesignerTextField('subtitle', Dict::S('UI:DashletHeaderDynamic:Prop-Subtitle'), $this->aProperties['subtitle']); $oForm->AddField($oField); $oField = new DesignerTextField('query', Dict::S('UI:DashletHeaderDynamic:Prop-Query'), $this->aProperties['query']); $oField->SetMandatory(); $oForm->AddField($oField); try { // Group by field: build the list of possible values (attribute codes + ...) $oQuery = $this->oModelReflection->GetQuery($this->aProperties['query']); $sClass = $oQuery->GetClass(); $aGroupBy = array(); foreach ($this->oModelReflection->ListAttributes($sClass, 'AttributeEnum,AttributeFinalClass') as $sAttCode => $sAttType) { if (is_subclass_of($sAttType, 'AttributeFinalClass') || $sAttType == 'AttributeFinalClass') { if (!$this->oModelReflection->HasChildrenClasses($sClass)) { continue; } } $sLabel = $this->oModelReflection->GetLabel($sClass, $sAttCode); $aGroupBy[$sAttCode] = $sLabel; } $oField = new DesignerComboField('group_by', Dict::S('UI:DashletHeaderDynamic:Prop-GroupBy'), $this->aProperties['group_by']); $oField->SetMandatory(); $oField->SetAllowedValues($aGroupBy); } catch (Exception $e) { $oField = new DesignerTextField('group_by', Dict::S('UI:DashletHeaderDynamic:Prop-GroupBy'), $this->aProperties['group_by']); $oField->SetReadOnly(); } $oForm->AddField($oField); $oField = new DesignerComboField('values', Dict::S('UI:DashletHeaderDynamic:Prop-Values'), $this->aProperties['values']); $oField->MultipleSelection(true); if (isset($sClass) && $this->oModelReflection->IsValidAttCode($sClass, $this->aProperties['group_by'])) { $aValues = $this->oModelReflection->GetAllowedValues_att($sClass, $this->aProperties['group_by']); $oField->SetAllowedValues($aValues); } else { $oField->SetReadOnly(); } $oForm->AddField($oField); }