');
- $oFilter = new DBObjectSearch($sClass);
+ $oPage->add('

');
+
$oBlock = new DisplayBlock($oFilter, 'summary');
$sBlockId = 'block_'.$this->sId.($bEditMode ? '_edit' : ''); // make a unique id (edition occuring in the same DOM)
$oBlock->Display($oPage, $sBlockId, $aExtraParams);
@@ -794,17 +854,43 @@ class DashletHeader extends Dashlet
$oField = new DesignerTextField('title', 'Title', $this->aProperties['title']);
$oForm->AddField($oField);
+ $oField = new DesignerTextField('icon', 'Icon', $this->aProperties['icon']);
+ $oForm->AddField($oField);
+
$oField = new DesignerTextField('subtitle', 'Subtitle', $this->aProperties['subtitle']);
$oForm->AddField($oField);
- $oField = new DesignerTextField('class', 'Class', $this->aProperties['class']);
+ $oField = new DesignerTextField('query', 'Query', $this->aProperties['query']);
+ $oForm->AddField($oField);
+
+ // Group by field: build the list of possible values (attribute codes + ...)
+ $oSearch = DBObjectSearch::FromOQL($this->aProperties['query']);
+ $sClass = $oSearch->GetClass();
+ $aGroupBy = array();
+ foreach(MetaModel::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
+ {
+ if (!$oAttDef->IsScalar()) continue; // skip link sets
+
+ $sLabel = $oAttDef->GetLabel();
+ if ($oAttDef->IsExternalKey(EXTKEY_ABSOLUTE))
+ {
+ $sLabel = $oAttDef->GetLabel().' (strict)';
+ }
+
+ $aGroupBy[$sAttCode] = $sLabel;
+ }
+ $oField = new DesignerComboField('group_by', 'Group by', $this->aProperties['group_by']);
+ $oField->SetAllowedValues($aGroupBy);
+ $oForm->AddField($oField);
+
+ $oField = new DesignerTextField('values', 'Values (CSV list)', $this->aProperties['values']);
$oForm->AddField($oField);
}
static public function GetInfo()
{
return array(
- 'label' => 'Header with stats',
+ 'label' => 'Header with statistics',
'icon' => 'images/dashlet-header-stats.png',
'description' => 'Header with stats (grouped by...)',
);
@@ -826,7 +912,7 @@ class DashletBadge extends Dashlet
{
$sClass = $this->aProperties['class'];
- $oPage->add('
');
+ $oPage->add('
');
$oFilter = new DBObjectSearch($sClass);
$oBlock = new DisplayBlock($oFilter, 'actions');
diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php
index 0076f1a28..b847013ee 100644
--- a/core/attributedef.class.inc.php
+++ b/core/attributedef.class.inc.php
@@ -209,7 +209,7 @@ abstract class AttributeDefinition
*/
public function GetValueLabel($sValue)
{
- return GetAsHTML($sValue);
+ return $this->GetAsHTML($sValue);
}
public function GetLabel_Obsolete()
diff --git a/css/light-grey.css b/css/light-grey.css
index e7e564185..497b862d8 100644
--- a/css/light-grey.css
+++ b/css/light-grey.css
@@ -1195,6 +1195,11 @@ td.prop_value {
padding-bottom: 10px;
padding-top: 10px;
}
+.main_header img {
+ margin-top: 10px;
+ margin-right: 10px;
+ float:left;
+}
a.summary {
background: none repeat scroll 0 0 transparent;
color: #666666;