diff --git a/src/Afup/Barometre/Report/CompanySizeReport.php b/src/Afup/Barometre/Report/CompanySizeReport.php index 461a8750..fa4d21c1 100644 --- a/src/Afup/Barometre/Report/CompanySizeReport.php +++ b/src/Afup/Barometre/Report/CompanySizeReport.php @@ -17,7 +17,8 @@ public function execute() ->addSelect('COUNT(response.id) as nbResponse') ->addGroupBy('response.companySize'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/CompanyTypeReport.php b/src/Afup/Barometre/Report/CompanyTypeReport.php index 1fe720fd..68367df2 100644 --- a/src/Afup/Barometre/Report/CompanyTypeReport.php +++ b/src/Afup/Barometre/Report/CompanyTypeReport.php @@ -17,7 +17,8 @@ public function execute() ->addSelect('COUNT(response.id) as nbResponse') ->addGroupBy('response.companyType'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/ExperienceSalaryReport.php b/src/Afup/Barometre/Report/ExperienceSalaryReport.php index 927a3eb1..768d3d03 100644 --- a/src/Afup/Barometre/Report/ExperienceSalaryReport.php +++ b/src/Afup/Barometre/Report/ExperienceSalaryReport.php @@ -17,7 +17,8 @@ public function execute() ->setParameter(':minResult', $this->minResult) ->groupBy('response.experience'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/GenderReport.php b/src/Afup/Barometre/Report/GenderReport.php index a6d85007..535ef3fd 100644 --- a/src/Afup/Barometre/Report/GenderReport.php +++ b/src/Afup/Barometre/Report/GenderReport.php @@ -19,7 +19,8 @@ public function execute() ->groupBy('response.gender') ->orderBy('nbResponse', 'desc'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/JobTitleReport.php b/src/Afup/Barometre/Report/JobTitleReport.php index 13f2ecda..fc6a2e66 100644 --- a/src/Afup/Barometre/Report/JobTitleReport.php +++ b/src/Afup/Barometre/Report/JobTitleReport.php @@ -14,7 +14,8 @@ public function execute() ->addSelect('COUNT(response.id) as nbResponse') ->addGroupBy('response.jobTitle'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/PhpVersionReport.php b/src/Afup/Barometre/Report/PhpVersionReport.php index e2b13a7a..a8aeabad 100644 --- a/src/Afup/Barometre/Report/PhpVersionReport.php +++ b/src/Afup/Barometre/Report/PhpVersionReport.php @@ -17,7 +17,8 @@ public function execute() ->setParameter(':minResult', $this->minResult) ->groupBy('response.phpVersion'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/RemoteUsageReport.php b/src/Afup/Barometre/Report/RemoteUsageReport.php index 921e26f5..7d178915 100644 --- a/src/Afup/Barometre/Report/RemoteUsageReport.php +++ b/src/Afup/Barometre/Report/RemoteUsageReport.php @@ -18,6 +18,7 @@ public function execute() ->orderBy('nbResponse', 'desc'); $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/SalaryReport.php b/src/Afup/Barometre/Report/SalaryReport.php index 4e908e7d..2508b60a 100644 --- a/src/Afup/Barometre/Report/SalaryReport.php +++ b/src/Afup/Barometre/Report/SalaryReport.php @@ -25,7 +25,7 @@ public function execute() foreach ($this->queryBuilder->execute() as $row) { $slice = $row['salarySlice']; $results[$slice] = array( - 'count' => $row['nbResponse'] + 'nbResponse' => $row['nbResponse'], ); } @@ -41,7 +41,7 @@ public function execute() $max = max(array_keys($results)); - if ($max != $min) { + if ($max !== $min) { $baseResults = array_fill($min, $max - $min, $baseResult); } else { $baseResults = array(); @@ -56,6 +56,7 @@ public function execute() } $this->data = $results; + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/SalarySatisfactionReport.php b/src/Afup/Barometre/Report/SalarySatisfactionReport.php index d0f85720..64b33219 100644 --- a/src/Afup/Barometre/Report/SalarySatisfactionReport.php +++ b/src/Afup/Barometre/Report/SalarySatisfactionReport.php @@ -21,7 +21,8 @@ public function execute() ->groupBy('response.salarySatisfaction') ->orderBy('salarySatisfaction', 'desc'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/SpecialityReport.php b/src/Afup/Barometre/Report/SpecialityReport.php index 875a5a41..a3149848 100644 --- a/src/Afup/Barometre/Report/SpecialityReport.php +++ b/src/Afup/Barometre/Report/SpecialityReport.php @@ -30,7 +30,8 @@ public function execute() ->addGroupBy('specialityName') ->addOrderBy('nbResponse', 'desc'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/Barometre/Report/StatusReport.php b/src/Afup/Barometre/Report/StatusReport.php index 01a2a65c..d3b1f7b2 100644 --- a/src/Afup/Barometre/Report/StatusReport.php +++ b/src/Afup/Barometre/Report/StatusReport.php @@ -18,7 +18,8 @@ public function execute() ->addSelect('COUNT(response.id) as nbResponse') ->addGroupBy('response.status'); - $this->data = $this->queryBuilder->execute(); + $this->data = $this->queryBuilder->execute()->fetchAll(); + $this->data = $this->addPercentResponse($this->data); } /** diff --git a/src/Afup/BarometreBundle/Resources/views/Report/company_size.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/company_size.html.twig index a8631f36..ded9e3aa 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/company_size.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/company_size.html.twig @@ -6,6 +6,7 @@ {{ 'report.view.company_size' | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -13,6 +14,7 @@ {{ row.companySize|enum_label('company_size') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/company_type.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/company_type.html.twig index bca83e75..0e47793d 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/company_type.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/company_type.html.twig @@ -6,6 +6,7 @@ {{ "report.view.company_type" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -13,6 +14,7 @@ {{ row.companyType|enum_label('company_type') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/experience_salary.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/experience_salary.html.twig index aa67eba7..95052a60 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/experience_salary.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/experience_salary.html.twig @@ -6,6 +6,7 @@ {{ 'report.view.experience' | trans }} {{ "report.view.annual_salary" | trans }} + {{ "report.view.response_percent" | trans }} @@ -13,6 +14,7 @@ {{ row.experience|enum_label('experience') }} {{ row.annualSalary|round(-2)|number_format_decimal }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/gender.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/gender.html.twig index 9dd66220..c39fdcc6 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/gender.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/gender.html.twig @@ -16,6 +16,7 @@ {{ "report.gender.label" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} {{ "report.view.average_salary" | trans }} @@ -29,6 +30,7 @@ {{ row.gender|enum_label('gender') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {{ row.averageSalary|number_format(null, '', ' ') }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/job_title.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/job_title.html.twig index 8b3798c7..24b4f54b 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/job_title.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/job_title.html.twig @@ -6,6 +6,7 @@ {{ "report.view.job_title" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -13,6 +14,7 @@ {{ row.jobTitle|enum_label('job_title') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/php_version.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/php_version.html.twig index 33aead0d..82486206 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/php_version.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/php_version.html.twig @@ -12,6 +12,7 @@ {{ "report.view.php_version" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -22,6 +23,7 @@ data-graph-name="{{ row.phpVersion|enum_label('php_version') }}" class="text-right">{{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/remote_usage.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/remote_usage.html.twig index 882316d3..285917aa 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/remote_usage.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/remote_usage.html.twig @@ -6,6 +6,7 @@ {{ "report.view.remote_usage" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -13,6 +14,7 @@ {{ row.remoteUsage|enum_label('remote_usage') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/salary.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/salary.html.twig index e610ab8b..431acc94 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/salary.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/salary.html.twig @@ -8,6 +8,7 @@ {{ "report.view.gross_annual_salary" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -18,7 +19,8 @@ - {{ row.salarySliceTo|number_format }} - {{ row.count }} + {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/salary_satisfaction.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/salary_satisfaction.html.twig index adbeeef7..d93d19f1 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/salary_satisfaction.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/salary_satisfaction.html.twig @@ -18,6 +18,7 @@ {{ "report.view.salary_satisfaction" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -30,6 +31,7 @@ {{ row.salarySatisfaction|enum_label('salary_satisfaction') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/speciality.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/speciality.html.twig index b38ad608..3fdaa3c2 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/speciality.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/speciality.html.twig @@ -8,6 +8,7 @@ {{ "report.view.speciality" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -15,6 +16,7 @@ {{ row.specialityName }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %} diff --git a/src/Afup/BarometreBundle/Resources/views/Report/status.html.twig b/src/Afup/BarometreBundle/Resources/views/Report/status.html.twig index 8603f75e..1bf5f15c 100644 --- a/src/Afup/BarometreBundle/Resources/views/Report/status.html.twig +++ b/src/Afup/BarometreBundle/Resources/views/Report/status.html.twig @@ -6,6 +6,7 @@ {{ "report.view.status" | trans }} {{ "report.view.response_number" | trans }} + {{ "report.view.response_percent" | trans }} @@ -15,6 +16,7 @@ {{ row.status|enum_label('status') }} {{ row.nbResponse }} + {{ row.percentResponse|round(2) }} {% endfor %}