diff --git a/application/modules/admin/controllers/ModulesController.php b/application/modules/admin/controllers/ModulesController.php index 3f04aa2620ed2483e746aa09b5fceb5f12d37746..cac000c616c9f01b43095ef594ef26878402654f 100644 --- a/application/modules/admin/controllers/ModulesController.php +++ b/application/modules/admin/controllers/ModulesController.php @@ -119,7 +119,10 @@ class Admin_ModulesController extends Zend_Controller_Action { } // Redirection sur le bon formulaire $viewRenderer = $this->getHelper('ViewRenderer'); - $viewRenderer->renderScript('modules/cms_all.phtml'); + if ($this->action == "articleviewbydate") + $viewRenderer->renderScript('modules/cms_'.$this->action.'.phtml'); + else + $viewRenderer->renderScript('modules/cms_all.phtml'); } @@ -233,7 +236,7 @@ class Admin_ModulesController extends Zend_Controller_Action { } // viewnotice -> Consolidation des onglets (si de nouveaux ont ete ajoutes) - if($this->action=="viewnotice") $this->noticeConsolidationOnglets(); + if ($this->action=="viewnotice") $this->noticeConsolidationOnglets(); // Redirection sur le bon formulaire $viewRenderer = $this->getHelper('ViewRenderer'); diff --git a/application/modules/opac/views/scripts/cms/articleviewbydate.phtml b/application/modules/opac/views/scripts/cms/articleviewbydate.phtml index ca261d5667eb1ad524ceea20b72f6721bba28d8c..daea7a2c9b37c99fa7c7837e18fa9ade7256bcb2 100644 --- a/application/modules/opac/views/scripts/cms/articleviewbydate.phtml +++ b/application/modules/opac/views/scripts/cms/articleviewbydate.phtml @@ -1,5 +1,5 @@ <a name="Top"></a> -<?php $this->openBoite("Calendrier"); ?> +<?php $this->openBoite($this->_current_module["preferences"]["titre"]); ?> <div class="calendar_event_list articleviewbydate"> <?php if (0 < count($this->articles)) { ?> diff --git a/library/Class/Systeme/ModulesAppli.php b/library/Class/Systeme/ModulesAppli.php index 10a2d767510a774afcab74e242b2272008c1207a..7d5fe425b58d6e199e006a146826d415738c93e0 100644 --- a/library/Class/Systeme/ModulesAppli.php +++ b/library/Class/Systeme/ModulesAppli.php @@ -66,7 +66,7 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract { 'resultat' => array('libelle' => 'Résultat', 'popup_width' => 710, 'popup_height' => 620), 'resultatsimple' => array('libelle' => 'Résultat', 'titre' => 'test', 'popup_width' => 710, 'popup_height' => 620), 'viewnotice' => array('libelle' => 'Notice', 'popup_width' => 700, 'popup_height' => 720), - 'saisie' => array('libelle' => 'Nouvelle recherchere', 'popup_width' => 800, 'popup_height' => 400)), + 'saisie' => array('libelle' => 'Nouvelle recherche', 'popup_width' => 800, 'popup_height' => 400)), 'noticeajax' => array( '*' => array('libelle' => 'Notice', 'popup_width' => 500, 'popup_height' => 300), @@ -74,7 +74,8 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract { ), 'cms' => array( - '*' => array('libelle' => 'Articles', 'popup_width' => 500, 'popup_height' => 200) + '*' => array('libelle' => 'Articles', 'popup_width' => 500, 'popup_height' => 200), + 'articleviewbydate' => array('libelle' => 'Calendrier', 'popup_width' => 500, 'popup_height' => 300) ), 'rss' => array( @@ -290,7 +291,9 @@ class Class_Systeme_ModulesAppli extends Class_Systeme_ModulesAbstract { $ret = array(); switch ((string)$action) { - case "articleviewbydate" : $ret["barre_nav"] = "Calendrier"; + case "articleviewbydate" : + $ret["barre_nav"] = "Calendrier"; + $ret["titre"] = "Calendrier"; break; default: $ret["barre_nav"] = "Article"; break; diff --git a/tests/application/modules/admin/controllers/ModulesControllerTest.php b/tests/application/modules/admin/controllers/ModulesControllerTest.php index 13a52f18658745811db4e3cc16bcaed4f67c4d49..f256281c90d3fbd0233a503f47ac78a79763e5a8 100644 --- a/tests/application/modules/admin/controllers/ModulesControllerTest.php +++ b/tests/application/modules/admin/controllers/ModulesControllerTest.php @@ -49,7 +49,6 @@ class ModulesControllerRechercheTest extends Admin_AbstractControllerTestCase { class ModulesControllerVariousConfigTest extends Admin_AbstractControllerTestCase { - public function setUp() { parent::setUp(); $this->dispatch('/admin/modules/auth?config=site&type_module=auth&id_profil=1&action1=boitelogin&action2='); @@ -192,4 +191,15 @@ class ModulesControllerConfigRechercheResultatWithPreferencesTest extends Admin_ } } + + + +class ModulesControllerCmsArticleViewByDateTest extends Admin_AbstractControllerTestCase { + /** @test */ + function inputForTitreShouldBePresent() { + $this->dispatch('/admin/modules/cms?config=site&id_profil=2&type_module=cms&action1=articleviewbydate&action2=', true); + $this->assertXPath('//input[@type="text"][@name="titre"]'); + } +} + ?> diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index d3a86cca344687e6e14d89050087cec5b8451625..747515ab1843defe23a7a221583cd7e8837c5841 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -317,6 +317,12 @@ class CmsControllerArticleViewByDateWithOnlyArticlePortailTest extends AbstractC public function emptyBibliothequeLibelleShouldNotBeDisplayedAsPortail() { $this->assertNotXpathContentContains('//h2', 'Portail', $this->_response->getBody()); } + + + /** @test */ + public function titreBoiteShouldBeCalendrier() { + $this->assertXPathContentContains('//div[@class="titre"]', 'Calendrier'); + } } @@ -328,6 +334,9 @@ class CmsControllerArticleViewByDateCategorie23AndNoProfilParamTest extends Abst public function setUp() { parent::setUp(); + Class_Profil::getCurrentProfil() + ->setCfgModules(['cms' => ['articleviewbydate' => ['titre' => 'Agenda de la bib']]]); + $this->_article_loader = Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Article') ->whenCalled('getArticlesByPreferences') ->answers(array()) @@ -348,6 +357,12 @@ class CmsControllerArticleViewByDateCategorie23AndNoProfilParamTest extends Abst function contenuShouldContainsAucunContenu() { $this->assertXPathContentContains('//div', 'Aucun contenu', $this->_response->getBody()); } + + + /** @test */ + public function titreBoiteShouldBeAgendaDeLaBib() { + $this->assertXPathContentContains('//div[@class="titre"]', 'Agenda de la bib'); + } }