From add1aa49a0103a7ea14682fad469c29537ab4278 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Tue, 10 Dec 2013 13:56:29 +0000 Subject: [PATCH] =?UTF-8?q?Calendrier:=20pr=C3=A9paration=20pour=20chargem?= =?UTF-8?q?ent=20Ajax=20de=20la=20liste=20des=20mois?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/ZendAfi/View/Helper/Calendar/MonthList.php | 13 ++++++++++--- .../ZendAfi/View/Helper/Accueil/CalendarTest.php | 8 ++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/library/ZendAfi/View/Helper/Calendar/MonthList.php b/library/ZendAfi/View/Helper/Calendar/MonthList.php index 55f475e52a7..93b8171e72d 100644 --- a/library/ZendAfi/View/Helper/Calendar/MonthList.php +++ b/library/ZendAfi/View/Helper/Calendar/MonthList.php @@ -22,9 +22,14 @@ class ZendAfi_View_Helper_Calendar_MonthList extends Zend_View_Helper_HtmlElemen use Trait_Translator, Trait_TimeSource; protected - $_libelle_months; + $_libelle_months, + $_id_module, + $_id_profil; public function calendar_MonthList($articles, $month, $year, $param) { + $this->_id_module = $param['ID_MODULE']; + $this->_id_profil = Class_Profil::getCurrentProfil()->getId(); + $this->_libelle_months = ['01' => $this->_('JAN'), '02' => $this->_('FEV'), '03' => $this->_('MARS'), @@ -50,8 +55,10 @@ class ZendAfi_View_Helper_Calendar_MonthList extends Zend_View_Helper_HtmlElemen public function renderMonth($year, $month) { return $this->view->tagAnchor($this->view->url(['controller' => 'cms', - 'action' => 'articleviewbydate', - 'd' => $year.'-'.$month], + 'action' => 'calendar', + 'date' => $year.'-'.$month, + 'id_profil' => $this->_id_profil, + 'id_module' => $this->_id_module], null, true), $this->_libelle_months[$month]); } diff --git a/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php b/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php index 34ece760eb3..d140c500841 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/CalendarTest.php @@ -252,7 +252,7 @@ class CalendarViewTodayWithFriseChronoTest extends CalendarViewTodayTestCase { /** @test */ public function linkJANShouldBePresentForNextYear() { $this->assertXPathContentContains($this->html, - '//a[contains(@href, "cms/articleviewbydate/d/2014-01")]', + '//a[contains(@href, "cms/calendar/date/2014-01/id_profil/2/id_module/2")]', 'JAN'); } @@ -260,7 +260,7 @@ class CalendarViewTodayWithFriseChronoTest extends CalendarViewTodayTestCase { /** @test */ public function linkFEVShouldBePresentForNextYear() { $this->assertXPathContentContains($this->html, - '//a[contains(@href, "cms/articleviewbydate/d/2014-02")]', + '//a[contains(@href, "cms/calendar/date/2014-02")]', 'FEV'); } @@ -268,14 +268,14 @@ class CalendarViewTodayWithFriseChronoTest extends CalendarViewTodayTestCase { /** @test */ public function linkAOUTShouldBePresentForCurrentYear() { $this->assertXPathContentContains($this->html, - '//a[contains(@href, "cms/articleviewbydate/d/2013-08")]', + '//a[contains(@href, "cms/calendar/date/2013-08")]', utf8_encode('AOÛT')); } /** @test */ public function linkNOVShouldBePresentForCurrentYear() { $this->assertXPathContentContains($this->html, - '//a[contains(@href, "cms/articleviewbydate/d/2013-11")]', + '//a[contains(@href, "cms/calendar/date/2013-11")]', utf8_encode('NOV')); } -- GitLab