diff --git a/application/modules/opac/controllers/JavaController.php b/application/modules/opac/controllers/JavaController.php index afcb5cee0ba277780070ea571840fd37d5ed65fe..1709d5790ce5856e34cc838865ba6e98fc0fffe9 100644 --- a/application/modules/opac/controllers/JavaController.php +++ b/application/modules/opac/controllers/JavaController.php @@ -50,9 +50,13 @@ class JavaController extends Zend_Controller_Action { // Kiosque de notices //------------------------------------------------------------------------------- function kiosqueAction() { + session_write_close(); // Preferences du module $id_module=$this->_getParam("id_module"); - $preferences=$this->view->profil->getModuleAccueilPreferences($id_module); + + $preferences = array_merge(Class_Systeme_ModulesAccueil::getInstance()->getValeursParDefaut('KIOSQUE'), + $this->view->profil->getModuleAccueilPreferences($id_module)); + $this->view->preferences=$preferences; // Lire les notices diff --git a/tests/application/modules/opac/controllers/JavaControllerTest.php b/tests/application/modules/opac/controllers/JavaControllerTest.php index 330f5c9f8f6b135001119b8ab1df879431a83dc7..4b4625b85f718cc63c15fd9d49dfe3c9b240ba17 100644 --- a/tests/application/modules/opac/controllers/JavaControllerTest.php +++ b/tests/application/modules/opac/controllers/JavaControllerTest.php @@ -56,6 +56,7 @@ class JavaControllerWidthDefaultKiosqueTest extends AbstractControllerTestCase { + class JavaControllerWithKiosqueMurPageTest extends AbstractControllerTestCase { public function setUp() { parent::setUp(); @@ -110,4 +111,41 @@ class JavaControllerWithKiosqueMurAndPanierDeletedTest extends AbstractControlle } + + +class JavaControllerKiosqueSlideShowWidthWrongParamsTest extends AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $cfg_accueil = ['modules' => ['1' => ['division' => 1, + 'type_module' => 'MENU']], + 'options' => []]; + + + + $this->profil = Class_Profil::newInstanceWithId(5345, ['browser' => 'opac', + 'libelle' => 'Profil cache', + 'cfg_acceuil' => $cfg_accueil]); + + + $this->mock_sql = Storm_Test_ObjectWrapper::mock(); + Zend_Registry::set('sql', $this->mock_sql); + + + $this->mock_sql + ->whenCalled('fetchAll') + ->with("select notices.id_notice, notices.editeur, notices.annee, notices.date_creation, notices.date_maj, notices.facettes, notices.clef_oeuvre from notices where url_vignette > '' and url_vignette != 'NO' order by date_creation DESC LIMIT 0,50", + false) + ->answers([]) + ->beStrict(); + + $this->dispatch('java/kiosque?id_module=1&id_profil=5345', true); + } + + + /** @test */ + public function vueShouldDefaultsToDiaporama() { + $this->assertXPathContentContains('//script', 'slideshow'); + } +} + ?> \ No newline at end of file