diff --git a/application/modules/admin/controllers/AccueilController.php b/application/modules/admin/controllers/AccueilController.php index c1732eff2365aa382f35a789dcd37ebc00bd91cf..821536818e7dd41273e8ca99d171676d841817ff 100644 --- a/application/modules/admin/controllers/AccueilController.php +++ b/application/modules/admin/controllers/AccueilController.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ class Admin_AccueilController extends Zend_Controller_Action { private $id_profil; // Profil a modifier @@ -46,10 +46,10 @@ class Admin_AccueilController extends Zend_Controller_Action { $this->id_profil = $this->profil->getId(); } - $this->type_module = $this->_getParam('type_module'); + $this->type_module = $this->_getParam('type_module'); $user = Class_Users::getIdentity(); - + if ((!$user->isAdminBib() && !$user->hasRightConfigFront()) || ($user->isAdminBib() && ($user->getIdSite() !== $this->profil->getIdSite()))) { $this->_redirect('admin/index'); @@ -57,13 +57,13 @@ class Admin_AccueilController extends Zend_Controller_Action { } $this->preferences = ($this->config == 'admin') ? - $this->_extractProperties() : + $this->_extractProperties() : $this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module); $boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : ''; $this->view->preferences = $this->preferences; $this->view->url = $this->_request->getRequestUri(); - + $this->view->combo_templates = ZendAfi_View_Helper_Accueil_Base::getComboTemplates($boite, $this->profil); $this->view->id_profil = $this->profil->getId(); $this->view->id_bib = $this->profil->getIdSite(); @@ -175,7 +175,7 @@ class Admin_AccueilController extends Zend_Controller_Action { public function panierAction() { $this->_simpleAction('PANIER'); } - + public function bibliothequeNumeriqueAction() { if (1 == $this->_getParam('styles_reload')) { @@ -280,15 +280,15 @@ class Admin_AccueilController extends Zend_Controller_Action { } } - + protected function _setTypeDAnalyse(&$enreg) { - $enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ; + $enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ; $enreg['nb_notices'] = (1 < (int)$enreg['nb_notices']) ? (int)$enreg["nb_notices"] : 1; - - $enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ; + + $enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ; $enreg['nb_analyse'] = (int)$enreg['nb_analyse']; if ($enreg['nb_analyse'] < $enreg['nb_notices']) @@ -319,7 +319,7 @@ class Admin_AccueilController extends Zend_Controller_Action { $module_config = $this->profil ->getModuleAccueilConfig($this->id_module, 'KIOSQUE'); $selected_elementId = explode('-', $this->_request->getPost('domaine_panier')); - + if($selected_elementId[0] == 'p') { $module_config['preferences']['id_catalogue'] = 0; $module_config['preferences']['id_panier'] = $selected_elementId[1]; @@ -330,7 +330,7 @@ class Admin_AccueilController extends Zend_Controller_Action { $module_config['preferences']['id_catalogue'] = 0; $module_config['preferences']['id_panier'] = 0; } - + $this->profil ->updateModuleConfigAccueil($this->id_module, $module_config) ->save(); @@ -363,7 +363,7 @@ class Admin_AccueilController extends Zend_Controller_Action { private function _simpleAction($type) { // pour combo des annexes $this->view->ya_annexes = fetchAll("select count(*) from codif_annexe where invisible=0 order by libelle"); - if ($this->_request->isPost()) + if ($this->_request->isPost()) $this->_updateEtRetour($this->_request->getPost(), $type); } @@ -406,7 +406,6 @@ class Admin_AccueilController extends Zend_Controller_Action { */ protected function _updateEtRetour($data, $type) { $enreg = []; - foreach ($data as $clef => $valeur) $enreg[$clef] = addslashes($valeur); @@ -415,7 +414,7 @@ class Admin_AccueilController extends Zend_Controller_Action { $this->view->properties = $this->_compactProperties($enreg); } else { $module_config = $this->profil->getModuleAccueilConfig($this->id_module, $type); - $module_config['preferences'] = $enreg; + $module_config['preferences'] = array_merge($module_config['preferences'], $enreg); $this->profil ->updateModuleConfigAccueil($this->id_module, $module_config) diff --git a/application/modules/admin/views/scripts/accueil/calendrier.phtml b/application/modules/admin/views/scripts/accueil/calendrier.phtml index 26b97f24f269089b9ecf8697c264df69fdad1d03..b7bb6d5ad58506a20ab9586063460b7ab2b9e422 100644 --- a/application/modules/admin/views/scripts/accueil/calendrier.phtml +++ b/application/modules/admin/views/scripts/accueil/calendrier.phtml @@ -1,150 +1,160 @@ -<center> - <h1>Propriétés du calendrier</h1><br> - <div class="formTable"> - <form method="post" action="<?php echo $this->url ?>"> - - <fieldset> - <legend>Affichage</legend> - <table cellspacing="2"> - - <tr> - <td class="droite">Style de boite </td> - <td class="gauche"><?php echo $this->combo_templates ?></td> - </tr> - - - <tr> - <td class="droite">Nombre d'évènements à afficher</td> - <td class="gauche"> - <?php echo $this->formText('nb_events', - $this->preferences['nb_events'], - array('size' => '2', - 'maxlenghth' => '2')) ?> - </td> - </tr> - - </table> - </fieldset> - <br/> - - <fieldset> - <legend>Généralités</legend> - <table cellspacing="2"> - <tr> - <td class="droite">Titre </td> - <td class="gauche"><input type="text" name="titre" size="55" value="<?php print($this->preferences["titre"]); ?>"></td> - </tr> - <tr> - <td class="droite">Proposer un fil Rss </td> - <td class="gauche"> - <?php echo $this->formCheckbox('rss_avis', - $this->preferences['rss_avis'], - null, - array('1', '0')) ?> - </td> - </tr> - </table> - </fieldset> - - <br/> - - <fieldset> - <legend>Affichage de la boite calendrier</legend> - <table cellspacing="2"> - - <tr> - <td class="droite">Afficher le calendrier</td> - <td class="gauche"> - <?php echo $this->formSelect('display_calendar', - $this->preferences['display_calendar'], - '', - ['0' => 'Ne pas afficher', - '1' => 'Calendrier', - '2' => 'Liste des mois']); ?> - </td> - </tr> - - <tr> - <td class="droite">Mode d'affichage des évènements</td> - <td class="gauche"> - <?php - echo $this->formSelect('mode-affichage', - $this->preferences['mode-affichage'], - '', - ['simple' => $this->_('mode liste simple'), - 'article' => $this->_('mode résumé d\'article'), - 'wall' => $this->_('mode mur'), - 'diaporama_navigation' => $this->_('Diaporama avec navigation'), - 'none' => $this->_('Ne pas afficher')]); - echo (new ZendAfi_View_Helper_Admin_PropertiesReader()) - ->setView($this) - ->propertiesReader($this->preferences['mode-affichage'], - $this->preferences); - ?> - </td> - </tr> - - <tr> - <td class="droite"><?php echo $this->_('Filtre sur les évènements'); ?></td> - <td class="gauche"> - <?php echo $this->formSelect('event_filter', - $this->preferences['event_filter'], - '', - ['none' => $this->_('aucun'), - 'month' => $this->_('par mois')]); ?> - </td> - </tr> - - <tr> - <td class="droite">Mode d'affichage des titres</td> - <td class="gauche"> - <?php - echo $this->formSelect('display_event_info', - $this->preferences['display_event_info'], - '', - ['bib' => $this->_('Nom de la bibliothèque'), - 'cat' => $this->_('Catégorie de l\'article'), - 'none' => $this->_('Titre seulement')]); - ?> - </td> - </tr> - </table> - </fieldset> - - <br/> - - <fieldset> - <legend>Affichage en pleine page</legend> - <table cellspacing="2" width="100%"> - <tr> - <td class="droite">Afficher </td> - <td class="gauche"> - <?php - echo $this->formRadioButtons("display_mode", - $this->preferences["display_mode"], - ["Title" => "Date et titre seulement", - "Summary" =>"Date et résumé de l'article", - "FullArticle" =>"Date et article"]); - ?> - </td> - </tr> - - <tr> - <td class="droite">Ordre </td> - <td class="gauche"> - <?php - echo $this->formRadioButtons("display_order", - $this->preferences["display_order"], - ["EventDebut" => "Par date de début d'événement (plus ancien en premier)", - "DebutPublicationDesc" => "Par date de début de publication (plus récent en premier)", - "DateCreationDesc" => "Par date de création (plus récent en premier)"]); - ?> - </td> - </tr> - </table> - </fieldset> - - <br/> +<center> + <h1>Propriétés du calendrier</h1><br> + <div class="formTable"> + <form method="post" action="<?php echo $this->url ?>"> + + <fieldset> + <legend>Affichage</legend> + <table cellspacing="2"> + + <tr> + <td class="droite">Style de boite </td> + <td class="gauche"><?php echo $this->combo_templates ?></td> + </tr> + + + <tr> + <td class="droite">Nombre d'évènements à afficher</td> + <td class="gauche"> + <?php echo $this->formText('nb_events', + $this->preferences['nb_events'], + array('size' => '2', + 'maxlenghth' => '2')) ?> + </td> + </tr> + + </table> + </fieldset> + <br/> + + <fieldset> + <legend>Généralités</legend> + <table cellspacing="2"> + <tr> + <td class="droite">Titre </td> + <td class="gauche"><input type="text" name="titre" size="55" value="<?php print($this->preferences["titre"]); ?>"></td> + </tr> + <tr> + <td class="droite">Proposer un fil Rss </td> + <td class="gauche"> + <?php echo $this->formCheckbox('rss_avis', + $this->preferences['rss_avis'], + null, + array('1', '0')) ?> + </td> + </tr> + </table> + </fieldset> + + <br/> + + <fieldset> + <legend>Affichage de la boite calendrier</legend> + <table cellspacing="2"> + + <tr> + <td class="droite">Afficher le calendrier</td> + <td class="gauche"> + <?php echo $this->formSelect('display_calendar', + $this->preferences['display_calendar'], + '', + ['0' => 'Ne pas afficher', + '1' => 'Calendrier', + '2' => 'Liste des mois']); ?> + </td> + </tr> + + <tr> + <td class="droite">Mode d'affichage des évènements</td> + <td class="gauche"> + <?php + echo $this->formSelect('mode-affichage', + $this->preferences['mode-affichage'], + '', + ['simple' => $this->_('mode liste simple'), + 'article' => $this->_('mode résumé d\'article'), + 'wall' => $this->_('mode mur'), + 'diaporama_navigation' => $this->_('Diaporama avec navigation'), + 'none' => $this->_('Ne pas afficher')]); + echo (new ZendAfi_View_Helper_Admin_PropertiesReader()) + ->setView($this) + ->propertiesReader($this->preferences['mode-affichage'], + $this->preferences); + ?> + </td> + </tr> + + <tr> + <td class="droite"><?php echo $this->_('Filtre sur les évènements'); ?></td> + <td class="gauche"> + <?php echo $this->formSelect('event_filter', + $this->preferences['event_filter'], + '', + ['none' => $this->_('aucun'), + 'month' => $this->_('par mois')]); ?> + </td> + </tr> + + <tr> + <td class="droite">Mode d'affichage des titres</td> + <td class="gauche"> + <?php + echo $this->formSelect('display_event_info', + $this->preferences['display_event_info'], + '', + ['bib' => $this->_('Nom de la bibliothèque'), + 'cat' => $this->_('Catégorie de l\'article'), + 'none' => $this->_('Titre seulement')]); + ?> + </td> + </tr> + + <tr> + <td class="droite"><?php echo $this->_('Activer l\'affichage en pleine page'); ?></td> + <td class="gauche"> + <?php echo $this->formCheckbox('display_full_page', + $this->preferences['display_full_page'], + null, + ['1', '0']); ?> + </td> + </tr> + </table> + </fieldset> + + <br/> + + <fieldset> + <legend>Affichage en pleine page</legend> + <table cellspacing="2" width="100%"> + <tr> + <td class="droite">Afficher </td> + <td class="gauche"> + <?php + echo $this->formRadioButtons("display_mode", + $this->preferences["display_mode"], + ["Title" => "Date et titre seulement", + "Summary" =>"Date et résumé de l'article", + "FullArticle" =>"Date et article"]); + ?> + </td> + </tr> + + <tr> + <td class="droite">Ordre </td> + <td class="gauche"> + <?php + echo $this->formRadioButtons("display_order", + $this->preferences["display_order"], + ["EventDebut" => "Par date de début d'événement (plus ancien en premier)", + "DebutPublicationDesc" => "Par date de début de publication (plus récent en premier)", + "DateCreationDesc" => "Par date de création (plus récent en premier)"]); + ?> + </td> + </tr> + </table> + </fieldset> + + <br/> <fieldset> <legend>Affichage des filtres</legend> @@ -158,38 +168,38 @@ </fieldset> <br> - - <fieldset> - <legend>Filtrage des catégories</legend> - <table cellspacing="2"> - <tr> - <td class="droite">Afficher sélection</td> - <td class="gauche"> - <?php $checked = $this->preferences["display_cat_select"] ? "checked='checked'" : ""; ?> - <input type="checkbox" name="display_cat_select" <?php echo $checked ?> > - </td> - </tr> - </table> - - <div id='table_selection'> - <?php - echo $this->treeSelect( - '', - $this->preferences["id_categorie"], - true, - $this->url(array('module' => 'admin', - 'controller' => 'bib', - 'action' => 'articles', - 'id_bib' => $this->id_bib, - 'categories_only' => 1)), - "form"); - ?> - </div> - - </table> - </fieldset> - - <?php echo $this->formSubmit("Valider","Valider",array("class" => "bouton")) ?> - </form> - </div> -</center> + + <fieldset> + <legend>Filtrage des catégories</legend> + <table cellspacing="2"> + <tr> + <td class="droite">Afficher sélection</td> + <td class="gauche"> + <?php $checked = $this->preferences["display_cat_select"] ? "checked='checked'" : ""; ?> + <input type="checkbox" name="display_cat_select" <?php echo $checked ?> > + </td> + </tr> + </table> + + <div id='table_selection'> + <?php + echo $this->treeSelect( + '', + $this->preferences["id_categorie"], + true, + $this->url(array('module' => 'admin', + 'controller' => 'bib', + 'action' => 'articles', + 'id_bib' => $this->id_bib, + 'categories_only' => 1)), + "form"); + ?> + </div> + + </table> + </fieldset> + + <?php echo $this->formSubmit("Valider","Valider",array("class" => "bouton")) ?> + </form> + </div> +</center> diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index a02ff3d27b84005cf59a6f6ea7492f7d579ee2bf..28c8c460eb4996df382567a060a6dbcafa7d2c93 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -300,6 +300,7 @@ class CmsController extends Zend_Controller_Action { $param['EVENT_FILTER'] = $preferences['event_filter']; $param['ENABLED_FILTERS'] = $preferences['enabled_filters']; $param['PLACE'] = $this->_getParam('place'); + $param['DISPLAY_FULL_PAGE'] = $preferences['display_full_page']; $param['CUSTOM_FIELDS'] = []; foreach ($this->getRequest()->getParams() as $name => $value) { diff --git a/library/Class/Profil.php b/library/Class/Profil.php index a995ff34aba5d63d2b24b73d58a81f49a93857ec..a5c5717c8ab0ccfe5f8d7ba3359d1ccc48695eb5 100644 --- a/library/Class/Profil.php +++ b/library/Class/Profil.php @@ -1859,16 +1859,6 @@ class Class_Profil extends Storm_Model_Abstract { } return null; } - - - public function isContentDivision($division) { - return $division == 2; - } - - - public function getDivisionByIdModule($id_module) { - return $this->getCfgAccueilAsArray()['modules'][$id_module]['division']; - } } ?> diff --git a/library/Class/Systeme/ModulesAccueil/Calendrier.php b/library/Class/Systeme/ModulesAccueil/Calendrier.php index 8b9ac8f4d2eb94849b70805506f88f78b92dcbdc..a98e7d7537302614eec2f02a3a3caacca98153fe 100644 --- a/library/Class/Systeme/ModulesAccueil/Calendrier.php +++ b/library/Class/Systeme/ModulesAccueil/Calendrier.php @@ -52,6 +52,7 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue 'display_next_event' => '1',//Afficher Prochains rendez-vous 'display_order' => 'EventDebut', //Tri des articles 'display_mode' => 'Title', // Mode d'affichage Title, Summary, FullArticle, + 'display_full_page' => 1, // Transforme les url en render/ajax si 0 'nb_events' => '3', // Nombre de rendez-vous à afficher 'display_calendar' => '1', // Mode d'affichage du calendrier: 0 (caché) / 1 (calendrier) / 2 (frise chrono) 'mode-affichage' => 'simple', // mode d'affichage des prochains événements dans la boite: none (aucun) / simple (titre + catégorie ou bib) / article (résumé article) diff --git a/library/ZendAfi/View/Helper/Accueil/Calendar.php b/library/ZendAfi/View/Helper/Accueil/Calendar.php index c0da608cda33ed7ab668efa292de2ad03a319c76..1c46a977cc548dd43ddaa77360277fe8311151de 100644 --- a/library/ZendAfi/View/Helper/Accueil/Calendar.php +++ b/library/ZendAfi/View/Helper/Accueil/Calendar.php @@ -52,10 +52,7 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_B if ($this->preferences['rss_avis']) $this->rss_interne = $this->_getRSSurl('cms', 'calendarrss'); - $param = []; - - $param['DATE'] = array_isset('display_date', $this->preferences) ? $this->preferences['display_date'] : ''; $param['URL']=''; $param['ID_BIB']=Class_Profil::getCurrentProfil()->getIdSite(); @@ -70,6 +67,7 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_B $param['DISPLAY_CALENDAR'] = $this->preferences['display_calendar']; $param['EVENT_FILTER'] = array_isset('event_filter', $this->preferences) ? $this->preferences['event_filter'] : ''; $param['ENABLED_FILTERS'] = $this->preferences['enabled_filters']; + $param['DISPLAY_FULL_PAGE'] = $this->preferences['display_full_page']; $this->contenu = $this->view->calendarContent($param); diff --git a/library/ZendAfi/View/Helper/Calendar/Table.php b/library/ZendAfi/View/Helper/Calendar/Table.php index a6eab01f63a2a6e16db1501274fcdb822ade5802..e17bd4fcbcc28e5a7e02866699da42b889cbbf96 100644 --- a/library/ZendAfi/View/Helper/Calendar/Table.php +++ b/library/ZendAfi/View/Helper/Calendar/Table.php @@ -32,7 +32,6 @@ class ZendAfi_View_Helper_Calendar_Table extends Zend_View_Helper_HtmlElement { $this->year = $year; $this->param = $param; $this->id_module = $param['ID_MODULE']; - $this->division = Class_Profil::getCurrentProfil()->getDivisionByIdModule($this->id_module); $this->today = date("dmY", $this->getTimeSource()->time()); $this->WEEK_DAYS = array($this->_("dim"), @@ -214,7 +213,7 @@ class ZendAfi_View_Helper_Calendar_Table extends Zend_View_Helper_HtmlElement { protected function buildUrl($url = []) { - if(Class_Profil::getCurrentProfil()->isContentDivision($this->division)) { + if (!$this->param['DISPLAY_FULL_PAGE']) { $url['action'] = 'calendar'; if(isset($url['d'])){ @@ -312,10 +311,7 @@ class ZendAfi_View_Helper_Calendar_Table extends Zend_View_Helper_HtmlElement { $cell_classes = implode(' ', array_unique($day_classes)); if (in_array('day_clickable', $day_classes)) { - $options = - Class_Profil::getCurrentProfil()->isContentDivision($this->division) - ? ['class' => $cell_classes] - : ['class' => $cell_classes, 'target' => '_parent']; + $options = ['class' => $cell_classes, 'target' => '_parent']; $table_cell.= $this->view->tagAnchor($this->getURL('EVENTS',$day), $today_click, $options); } else { $table_cell .= $this->view->tag('span', $day,['class' => $cell_classes]); diff --git a/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php b/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php index 5fd9fd26b1579aade2efb4be97ae5209f37ca9f5..6f6fb99fcd047b045b1a210b6c9b165d10f9cbd7 100644 --- a/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php +++ b/tests/application/modules/admin/controllers/AccueilControllerCalendarTest.php @@ -57,7 +57,8 @@ abstract class Admin_AccueilControllerCalendarTestCase extends Admin_AbstractCon 'display_cat_select' => '', 'enabled_filters' => 'date;place;custom_field_1', 'id_categorie' => '', - 'event_filter' => 'none' + 'event_filter' => 'none', + 'display_full_page' => 1 ]]) ->beCurrentProfil(); @@ -123,11 +124,44 @@ class Admin_AccueilControllerCalendarTestWithDefaultDiaporamaNavigation extends /** @test */ - public function firstListShouldContainsMonthPlaceAndPublic() { + public function firstListShouldContainsPublic() { $this->assertXPathContentContains('//div[@id="input_enabled_filters"]/div[1]/ul/li[@data-value="custom_field_1"]', 'Public'); + } + + + /** @test */ + public function firstListShouldContainsMonthPlace() { $this->assertXPathContentContains('//div[@id="input_enabled_filters"]/div[1]/ul/li[@data-value="date"]', 'Mois'); + } + + + /** @test */ + public function firstListShouldContainsPlace() { $this->assertXPathContentContains('//div[@id="input_enabled_filters"]/div[1]/ul/li[@data-value="place"]', 'Lieu'); } + + + /** @test */ + public function checkBoxDisableDisplayFullPageShouldBePresent () { + $this->assertXPath('//div[@class="formTable"]//fieldset//input[@type="checkbox"][@name="display_full_page"]'); + } +} + + + + +class Admin_AccueilControllerCalendarPostTest extends Admin_AccueilControllerCalendarTestCase { + public function setUp() { + parent::setUp(); + $this->postDispatch('admin/accueil/calendrier?config=accueil&id_profil=1&id_module=1&type_module=CALENDAR', + ['display_full_page' => 0]); + } + + + /** @test */ + public function displayFullDayShouldHaveBeenSaved() { + $this->assertequals(0, Class_Profil::find(1)->getCfgAccueilAsArray()['modules'][1]['preferences']['display_full_page']); + } } diff --git a/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php b/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php index b0d8c27fba59e18848b0898d732b6679bae248c7..a255427b25ccd74a29787c8acd9ecd455beed211 100644 --- a/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerCalendarActionTest.php @@ -37,7 +37,8 @@ abstract class CmsControllerCalendarActionTestCase extends AbstractControllerTes 'display_cat_select' => true, 'enabled_filters' => 'date;place;custom_field_2;zork', 'display_event_info' => 'none', - 'mode-affichage' => 'article']]], + 'mode-affichage' => 'article', + 'display_full_page' => false]]], 'options' => []]; @@ -332,13 +333,13 @@ class CmsControllerCalendarActionWithDayTest extends CmsControllerCalendarAction $this->dispatch('cms/calendar/date/2014-09-30/id_profil/3/id_module/1/opac/render/ajax', true); } + /** @test */ public function newsOfThe30thShouldBePresent() { $this->assertXPathContentContains('div[@class="calendar"]//article//header//h2//a', 'News of the 30th september'); } - /** @test **/ public function newsOfThe15ThSeptemberEventShouldNotBPresent() { $this->assertNotXPathContentContains('div[@class="calendar"]//article//header', 'News of the 15th september'); diff --git a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php index 646828be4c0d79c14b22a080c8640a3d5cbdc2ba..7088a2c2e5bf5a4ccd9983cf2f191714289fd217 100644 --- a/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php +++ b/tests/application/modules/opac/controllers/ProfilOptionsControllerTest.php @@ -2060,16 +2060,17 @@ class ProfilOptionsControllerProfilBoiteCalendarWithNoFilterTest extends ProfilO -class ProfilOptionsControllerBoiteCalendarInMainColShouldUseAjaxLink extends ProfilOptionsControllerProfilBoiteCalendarWithFilterTestCase { +class ProfilOptionsControllerWidgetCalendarWithDisplayFullPageDeactivateShouldUseAjaxLink extends ProfilOptionsControllerProfilBoiteCalendarWithFilterTestCase { public function setUp() { parent::setUp(); - $cfg_accueil = ['modules' => ['45' => ['division' => '2', + $cfg_accueil = ['modules' => ['45' => ['division' => '1', 'type_module' => 'CALENDAR', 'preferences' => ['display_calendar' => '1', 'mode-affichage' => 'simple', - 'display_event_info' => 'bib']]]]; + 'display_event_info' => 'bib', + 'display_full_page' => 0]]]]; $this->profil_with_calendar = Class_Profil::getCurrentProfil() ->setBrowser('opac')