diff --git a/library/ZendAfi/View/Helper/Calendar/Table.php b/library/ZendAfi/View/Helper/Calendar/Table.php index 074e6825288197941c8bb2b84d299676cb31b1d5..e94d680d0c878a34d54bd655f17885fa97838da3 100644 --- a/library/ZendAfi/View/Helper/Calendar/Table.php +++ b/library/ZendAfi/View/Helper/Calendar/Table.php @@ -206,9 +206,9 @@ class ZendAfi_View_Helper_Calendar_Table extends Zend_View_Helper_HtmlElement { ' »', $anchor_class); - $tds_content = $this->view->tag('td', $previews_month, ['class' => 'calendar_title_left_arrow']); - $tds_content.= $this->view->tag('td', $current_month, ['class' => 'calendar_title_month']); - $tds_content.= $this->view->tag('td', $next_month, ['class' => 'calendar_title_right_arrow']); + $tds_content = $this->view->tag('td', '', ['class' => 'calendar_title_left_arrow']); + $tds_content .= $this->view->tag('td', $previews_month . $current_month . $next_month, ['class' => 'calendar_title_month']); + $tds_content .= $this->view->tag('td', '', ['class' => 'calendar_title_right_arrow']); return $this->view->tag('tr', $tds_content, ['class' => 'calendar_title']); } diff --git a/public/opac/js/calendrier.js b/public/opac/js/calendrier.js index a70e163d9f427e209baf618287630adf2f1d65df..6f86838fa3c7e0996ce7cca68a84e6a9fe227098 100644 --- a/public/opac/js/calendrier.js +++ b/public/opac/js/calendrier.js @@ -1,5 +1,5 @@ var ajaxify_calendars = function () { - var month_link = $(".calendar_ajax_ready, .calendar_title_left_arrow a, .calendar_title_right_arrow a, .calendar .month_list a:not(.no_event), .filters a"); + var month_link = $(".calendar_ajax_ready, a.calendar_title_month_clickable:first-child, a.calendar_title_month_clickable:last-child, .calendar .month_list a:not(.no_event), .filters a"); month_link.click(function(event) { var url = $(this).attr('href'); diff --git a/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php b/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php index ac31275605f2f6540108961a2eb2cbb332636473..a9dc2cab49854d64a8bc64c6e4fb229061d5fad0 100644 --- a/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php @@ -342,4 +342,44 @@ class CmsControllerCalendarActionWithDayTest extends AbstractControllerTestCase $this->assertXPath('//div[@class="calendar"]//table//a[contains(@class, "day_clickable")][contains(@href, "date/2014-09-15")]'); } } + +class CmsControllerCalendarActionHeaderTest extends AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $this->cfg_accueil = [ + 'modules' => [ + '1' => [ + 'division' => '1', + 'type_module' => 'CALENDAR', + 'preferences' => [ + 'titre' => 'Rendez-vous', + 'rss_avis' => false, + 'id_categorie' => '12-2', + 'display_cat_select' => true, + 'enabled_filters' => 'date;place;custom_field_2;zork', + 'display_event_info' => 'none' + ] + ] + ], + 'options' => [] + ]; + + + $this->fixture('Class_Profil', + ['id' => 3, + 'browser' => 'opac', + 'libelle' => 'Rendez-vous', + 'cfg_accueil' => $this->cfg_accueil]); + + $this->dispatch('/index/index/id_profil/3'); + } + + /** @test */ + public function calendarHeaderShouldContainsThreeLinks() { + $this->assertXPathCount(3, '//td[@class="calendar_title_month"]/a'); + $this->assertXPathContentContains('//td[@class="calendar_title_month"]/a[1]', '«'); + $this->assertXPathContentContains('//td[@class="calendar_title_month"]/a[3]', '»'); + } +} + ?> \ No newline at end of file