diff --git a/application/dashlet.class.inc.php b/application/dashlet.class.inc.php index 590f3b23a..638baf2d9 100644 --- a/application/dashlet.class.inc.php +++ b/application/dashlet.class.inc.php @@ -458,7 +458,7 @@ abstract class DashletGroupBy extends Dashlet case 'month': $sGroupByLabel = Dict::Format('UI:DashletGroupBy:Prop-GroupBy:Month', $sAttLabel); - $sGroupByExpr = "DATE_FORMAT($sClassAlias.$sAttCode, '%m')"; // 0 -> 31 + $sGroupByExpr = "DATE_FORMAT($sClassAlias.$sAttCode, '%Y-%m')"; // yyyy-mm break; case 'day_of_week': @@ -468,7 +468,7 @@ abstract class DashletGroupBy extends Dashlet case 'day_of_month': $sGroupByLabel = Dict::Format('UI:DashletGroupBy:Prop-GroupBy:DayOfMonth', $sAttLabel); - $sGroupByExpr = "DATE_FORMAT($sClassAlias.$sAttCode, '%e')"; // 0 -> 31 + $sGroupByExpr = "DATE_FORMAT($sClassAlias.$sAttCode, '%m-%d')"; // mm-dd break; default: diff --git a/core/expression.class.inc.php b/core/expression.class.inc.php index e7399a936..6bee1a324 100644 --- a/core/expression.class.inc.php +++ b/core/expression.class.inc.php @@ -879,31 +879,63 @@ class FunctionExpression extends Expression */ public function MakeValueLabel($oFilter, $sValue, $sDefault) { + static $aWeekDayToString = null; + if (is_null($aWeekDayToString)) + { + // Init the correspondance table + $aWeekDayToString = array( + 0 => Dict::S('DayOfWeek-Sunday'), + 1 => Dict::S('DayOfWeek-Monday'), + 2 => Dict::S('DayOfWeek-Tuesday'), + 3 => Dict::S('DayOfWeek-Wednesday'), + 4 => Dict::S('DayOfWeek-Thursday'), + 5 => Dict::S('DayOfWeek-Friday'), + 6 => Dict::S('DayOfWeek-Saturday') + ); + } + static $aMonthToString = null; + if (is_null($aMonthToString)) + { + // Init the correspondance table + $aMonthToString = array( + 1 => Dict::S('Month-01'), + 2 => Dict::S('Month-02'), + 3 => Dict::S('Month-03'), + 4 => Dict::S('Month-04'), + 5 => Dict::S('Month-05'), + 6 => Dict::S('Month-06'), + 7 => Dict::S('Month-07'), + 8 => Dict::S('Month-08'), + 9 => Dict::S('Month-09'), + 10 => Dict::S('Month-10'), + 11 => Dict::S('Month-11'), + 12 => Dict::S('Month-12'), + ); + } + $sRes = $sDefault; if (strtolower($this->m_sVerb) == 'date_format') { $oFormatExpr = $this->m_aArgs[1]; if ($oFormatExpr->Render() == "'%w'") { - static $aWeekDayToString = null; - if (is_null($aWeekDayToString)) - { - // Init the correspondance table - $aWeekDayToString = array( - 0 => Dict::S('DayOfWeek-Sunday'), - 1 => Dict::S('DayOfWeek-Monday'), - 2 => Dict::S('DayOfWeek-Tuesday'), - 3 => Dict::S('DayOfWeek-Wednesday'), - 4 => Dict::S('DayOfWeek-Thursday'), - 5 => Dict::S('DayOfWeek-Friday'), - 6 => Dict::S('DayOfWeek-Saturday') - ); - } if (isset($aWeekDayToString[(int)$sValue])) { $sRes = $aWeekDayToString[(int)$sValue]; } } + elseif ($oFormatExpr->Render() == "'%Y-%m'") + { + // yyyy-mm + $iMonth = (int) substr($sValue, -2); // the two last chars + $sRes = substr($sValue, 0, 4).' '.$aMonthToString[$iMonth]; + } + elseif ($oFormatExpr->Render() == "'%m-%d'") + { + // mm-dd + $iMonth = (int) substr($sValue, 0, 2); // the two first chars + $sRes = $aMonthToString[$iMonth].' '.substr($sValue, -2); + } } return $sRes; } diff --git a/dictionaries/de.dictionary.itop.ui.php b/dictionaries/de.dictionary.itop.ui.php index 4d5bb3e7d..880f2df92 100644 --- a/dictionaries/de.dictionary.itop.ui.php +++ b/dictionaries/de.dictionary.itop.ui.php @@ -946,6 +946,18 @@ Wenn Aktionen mit Trigger verknüpft sind, bekommt jede Aktion eine Auftragsnumm 'DayOfWeek-Thursday' => 'Donnerstag', 'DayOfWeek-Friday' => 'Freitag', 'DayOfWeek-Saturday' => 'Samstag', + 'Month-01' => 'Januar', + 'Month-02' => 'Februar', + 'Month-03' => 'März', + 'Month-04' => 'April', + 'Month-05' => 'Mai', + 'Month-06' => 'Juni', + 'Month-07' => 'Juli', + 'Month-08' => 'August', + 'Month-09' => 'September', + 'Month-10' => 'Oktober', + 'Month-11' => 'November', + 'Month-12' => 'Dezember', 'UI:FillAllMandatoryFields' => 'Bitte füllen Sie alle Pflichtfelder', )); ?> diff --git a/dictionaries/dictionary.itop.ui.php b/dictionaries/dictionary.itop.ui.php index 013853149..ce4491d05 100644 --- a/dictionaries/dictionary.itop.ui.php +++ b/dictionaries/dictionary.itop.ui.php @@ -1123,6 +1123,18 @@ When associated with a trigger, each action is given an "order" number, specifyi 'DayOfWeek-Thursday' => 'Thursday', 'DayOfWeek-Friday' => 'Friday', 'DayOfWeek-Saturday' => 'Saturday', + 'Month-01' => 'January', + 'Month-02' => 'February', + 'Month-03' => 'March', + 'Month-04' => 'April', + 'Month-05' => 'May', + 'Month-06' => 'June', + 'Month-07' => 'July', + 'Month-08' => 'August', + 'Month-09' => 'September', + 'Month-10' => 'October', + 'Month-11' => 'November', + 'Month-12' => 'December', 'UI:Menu:ShortcutList' => 'Create a Shortcut...', 'UI:ShortcutRenameDlg:Title' => 'Rename the shortcut', diff --git a/dictionaries/es_cr.dictionary.itop.ui.php b/dictionaries/es_cr.dictionary.itop.ui.php index a739363f1..9c334d9c9 100644 --- a/dictionaries/es_cr.dictionary.itop.ui.php +++ b/dictionaries/es_cr.dictionary.itop.ui.php @@ -1122,6 +1122,19 @@ Cuando se asocien con un disparador, cada acción recibe un número de "orden", 'DayOfWeek-Thursday' => 'Jueves', 'DayOfWeek-Friday' => 'Viernes', 'DayOfWeek-Saturday' => 'Sábado', + + 'Month-01' => 'Enero', + 'Month-02' => 'Febrero', + 'Month-03' => 'Marzo', + 'Month-04' => 'Abril', + 'Month-05' => 'Mayo', + 'Month-06' => 'Junio', + 'Month-07' => 'Julio', + 'Month-08' => 'Agosto', + 'Month-09' => 'Septiembre', + 'Month-10' => 'Octubre', + 'Month-11' => 'Noviembre', + 'Month-12' => 'Diciembre', )); // diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 0ac8a56d2..ae56fcf58 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -965,6 +965,18 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé 'DayOfWeek-Thursday' => 'Jeudi', 'DayOfWeek-Friday' => 'Vendredi', 'DayOfWeek-Saturday' => 'Samedi', + 'Month-01' => 'Janvier', + 'Month-02' => 'Février', + 'Month-03' => 'Mars', + 'Month-04' => 'Avril', + 'Month-05' => 'Mai', + 'Month-06' => 'Juin', + 'Month-07' => 'Juillet', + 'Month-08' => 'Août', + 'Month-09' => 'Septembre', + 'Month-10' => 'Octobre', + 'Month-11' => 'Novembre', + 'Month-12' => 'Décembre', 'UI:Menu:ShortcutList' => 'Créer un Raccourci...', 'UI:ShortcutListDlg:Title' => 'Créer un raccourci pour la liste',