Dashboard: improved the group by on two columns (to be continued)

SVN:trunk[2074]
This commit is contained in:
Romain Quetiez
2012-05-30 14:51:01 +00:00
parent ad1b2901be
commit 5cfc82437f
4 changed files with 118 additions and 54 deletions

View File

@@ -823,7 +823,41 @@ class FunctionExpression extends Expression
{
$this->m_aArgs[$key] = $oExpr->RenameParam($sOldName, $sNewName);
}
}
}
/**
* Make the most relevant label, given the value of the expression
*
* @param DBObjectSearch oFilter The context in which this expression has been used
* @param string sValue The value returned by the query, for this expression
* @param string sDefault The default value if no relevant label could be computed
* @return The label
*/
public function MakeValueLabel($oFilter, $sValue, $sDefault)
{
$sRes = $sDefault;
if (strtolower($this->m_sVerb) == 'date_format')
{
$oFormatExpr = $this->m_aArgs[1];
if ($oFormatExpr->Render() == "'%w'")
{
static $aWeekDayToString = array(
0 => 'Sunday',
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
);
if (isset($aWeekDayToString[(int)$sValue]))
{
$sRes = $aWeekDayToString[(int)$sValue];
}
}
}
return $sRes;
}
}
class IntervalExpression extends Expression