diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index 872d6845a96..a27f458d01a 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -82,12 +82,13 @@ class ReceptionStats extends Stats } /** - * Return reception number by month for a year + * Return reception number by month for a year * - * @param int $year Year to scan - * @return array Array with number by month + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array with number by month */ - public function getNbByMonth($year) + public function getNbByMonth($year, $format = 0) { global $user; @@ -101,7 +102,7 @@ class ReceptionStats extends Stats $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getNbByMonth($year, $sql); + $res = $this->_getNbByMonth($year, $sql, $format); return $res; } diff --git a/htdocs/ticket/class/ticketstats.class.php b/htdocs/ticket/class/ticketstats.class.php index 2af0b789c3d..0dd69ac9f15 100644 --- a/htdocs/ticket/class/ticketstats.class.php +++ b/htdocs/ticket/class/ticketstats.class.php @@ -89,12 +89,13 @@ class TicketStats extends Stats } /** - * Renvoie le nombre de facture par mois pour une annee donnee + * Return the number of tickets per month for a given year * - * @param string $year Year to scan - * @return array Array of values + * @param string $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array of values */ - public function getNbByMonth($year) + public function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(datec) as dm, count(*)"; $sql .= " FROM ".$this->from; @@ -103,7 +104,7 @@ class TicketStats extends Stats $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); - $res = $this->_getNbByMonth($year, $sql); + $res = $this->_getNbByMonth($year, $sql, $format); //var_dump($res);print '
'; return $res; }