diff --git a/app/Resources/views/admin/period/index.html.twig b/app/Resources/views/admin/period/index.html.twig index 1ae7be599..e9b8e0f72 100644 --- a/app/Resources/views/admin/period/index.html.twig +++ b/app/Resources/views/admin/period/index.html.twig @@ -232,14 +232,14 @@ - {% for key,day in days_of_week %} + {% for key,day in period_service.getDaysOfWeekArray() %} {% endfor %} - {% for key,day in days_of_week %} + {% for key,day in period_service.getDaysOfWeekArray() %}
{{ day }}
{% for period in periods_by_day[key] %} {% if ((filling_filter == null) and (beneficiary_filter == null)) diff --git a/app/Resources/views/period/index.html.twig b/app/Resources/views/period/index.html.twig index 71afacd8a..c260f4d95 100644 --- a/app/Resources/views/period/index.html.twig +++ b/app/Resources/views/period/index.html.twig @@ -91,14 +91,14 @@ It display a page with all the avaible periods (a.k.a the "Semaine type") - {% for key,day in days_of_week %} + {% for key,day in period_service.getDaysOfWeekArray() %} {% endfor %} - {% for key,day in days_of_week %} + {% for key,day in period_service.getDaysOfWeekArray() %}
{{ day }}
{% for period in periods_by_day[key] %} {% if (filling_filter == null) diff --git a/src/AppBundle/Controller/AdminPeriodController.php b/src/AppBundle/Controller/AdminPeriodController.php index b0c88a02b..8ac2e1b95 100644 --- a/src/AppBundle/Controller/AdminPeriodController.php +++ b/src/AppBundle/Controller/AdminPeriodController.php @@ -68,7 +68,6 @@ public function indexAction(Request $request, PeriodFormHelper $formHelper) } return $this->render('admin/period/index.html.twig', array( - 'days_of_week' => Period::DAYS_OF_WEEK, 'periods_by_day' => $periodsByDay, 'filter_form' => $form->createView(), 'week_filter' => $week_filter, diff --git a/src/AppBundle/Controller/PeriodController.php b/src/AppBundle/Controller/PeriodController.php index 7cc4e6fa4..fce37e1a1 100644 --- a/src/AppBundle/Controller/PeriodController.php +++ b/src/AppBundle/Controller/PeriodController.php @@ -53,7 +53,6 @@ public function indexAction(Request $request, PeriodFormHelper $formHelper) } return $this->render('period/index.html.twig', array( - 'days_of_week' => Period::DAYS_OF_WEEK, 'periods_by_day' => $periodsByDay, 'filter_form' => $form->createView(), 'week_filter' => $week_filter, diff --git a/src/AppBundle/Entity/Period.php b/src/AppBundle/Entity/Period.php index 35e1b4c82..34d9f6528 100644 --- a/src/AppBundle/Entity/Period.php +++ b/src/AppBundle/Entity/Period.php @@ -16,6 +16,7 @@ class Period { const DAYS_OF_WEEK = ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"]; const DAYS_OF_WEEK_LIST_WITH_INT = ["Lundi" => 0, "Mardi" => 1, "Mercredi" => 2, "Jeudi" => 3, "Vendredi" => 4, "Samedi" => 5, "Dimanche" => 6]; + const WEEK_CYCLE = ["A", "B", "C", "D"]; /** * @var int diff --git a/src/AppBundle/Service/PeriodService.php b/src/AppBundle/Service/PeriodService.php index 1e2e2ead4..9a851e284 100644 --- a/src/AppBundle/Service/PeriodService.php +++ b/src/AppBundle/Service/PeriodService.php @@ -2,14 +2,21 @@ namespace AppBundle\Service; +use AppBundle\Entity\Period; + class PeriodService { public function __construct() { } + public function getDaysOfWeekArray() + { + return Period::DAYS_OF_WEEK; + } + public function getWeekCycleArray() { - return ["A", "B", "C", "D"]; + return Period::WEEK_CYCLE; } }