diff --git a/application/modules/admin/views/scripts/accueil/calendrier.phtml b/application/modules/admin/views/scripts/accueil/calendrier.phtml index 51cf25fbd957bbc4f652d206ffdd984d5df7f3fb..a1cc4c7ecefe646096a5af0b261f4610d6173d0f 100644 --- a/application/modules/admin/views/scripts/accueil/calendrier.phtml +++ b/application/modules/admin/views/scripts/accueil/calendrier.phtml @@ -41,6 +41,15 @@ array('1', '0')) ?> </td> </tr> + <tr> + <td class="droite">Nombre de rendez-vous </td> + <td class="gauche"> + <?php echo $this->formText('nb_events', + $this->preferences['nb_events'], + array('size' => '2', + 'maxlenghth' => '2')) ?> + </td> + </tr> <tr> <td class="droite">Afficher </td> <td class="gauche"> diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index 75a6989209beff1c397c992bfd3a56287402948a..1f0b35e82ba6a1ae9ef8226c6b139a3eb04f8db5 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -244,7 +244,7 @@ class CmsController extends ZendAfi_Controller_IFrameAction { $param["ID_BIB"]=Class_Profil::getCurrentProfil()->getIdSite(); $param["AFFICH_MOIS"]=1; $param["NEWS"]["AFFICH_NEWS"]=1; - $param["NB_NEWS"]=3; + $param["NB_NEWS"]= (int)$preferences["nb_events"]; $param["ALEATOIRE"]=1; $param["ID_MODULE"] = $id_module; $param["ID_CAT"] = $preferences["id_categorie"]; diff --git a/library/Class/Systeme/ModulesAccueil/Calendrier.php b/library/Class/Systeme/ModulesAccueil/Calendrier.php index 495d23505886132192496792d836a0b63d0714e3..c1e0c95ff892966a11fcc6e8d864041c455fa6e0 100644 --- a/library/Class/Systeme/ModulesAccueil/Calendrier.php +++ b/library/Class/Systeme/ModulesAccueil/Calendrier.php @@ -45,7 +45,8 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue // Information à afficher en préfixed du titre de l'article: bib, cat ou none. 'display_event_info'=> false, 'rss_avis' => false, //RSS - 'display_next_event' => '1' //Afficher Prochains rendez-vous + 'display_next_event' => '1',//Afficher Prochains rendez-vous + 'nb_events' => '3' // Nombre de rendez-vous à afficher ); diff --git a/tests/application/modules/admin/controllers/AccueilControllerTest.php b/tests/application/modules/admin/controllers/AccueilControllerTest.php index 8aa33fb7617f6229b77c8fc52afefc8621f92ba9..8685148fa142b15572b896157db7f275db6123b7 100644 --- a/tests/application/modules/admin/controllers/AccueilControllerTest.php +++ b/tests/application/modules/admin/controllers/AccueilControllerTest.php @@ -346,6 +346,12 @@ class AccueilControllerConfigCalendrierTest extends Admin_AbstractControllerTest function checkBoxDisplayNextEventShouldBeChecked() { $this->assertXPath('//input[@type="checkbox"][@name="display_next_event"][@checked="checked"]'); } + + + /** @test */ + public function inputNbEventsShouldDisplayThree() { + $this->assertXPath("//input[@name='nb_events'][@value='3']"); + } }