diff --git a/library/Class/Calendar.php b/library/Class/Calendar.php index 7bb01ce65d0f933598b0fa25309752b41bb5fcc5..cc66a1a5a4be1998fe1172b453be65d0016c6751 100644 --- a/library/Class/Calendar.php +++ b/library/Class/Calendar.php @@ -268,6 +268,20 @@ class Class_Calendar { } + public function getHumanDate() { + if ($this->day) + return Class_Date::getHumanDate($this->day, 'dd/MM/yyyy'); + + if ($day = $this->_getParam('day')) + return Class_Date::getHumanDate($day . '-01', 'MM/yyyy'); + + if ($date = $this->_getParam('date')) + return Class_Date::getHumanDate($date . '-01', 'MM/yyyy'); + + return ''; + } + + public function getMonth() { return $this->month; } @@ -306,12 +320,18 @@ class Class_Calendar { public function isDisplayNoCalendar() { - return 0 == $this->preferences['display_calendar']; + return isset($this->preferences['display_calendar']) + ? 0 == $this->preferences['display_calendar'] + : true; } public function getActiveFilters() { - if (empty($filters = $this->getEnabledFilters())) + $available_filters = (new Class_Systeme_ModulesAccueil_Calendrier)->getAvailableFilters(); + + $filters = array_keys($available_filters); + + if (empty($filters)) return []; $active_filters = $this->getCustomFields(); diff --git a/library/Class/Systeme/ModulesAccueil.php b/library/Class/Systeme/ModulesAccueil.php index 9f09d4e6630877f703c899f72022f664dc71da3c..0a014b7b6758ce896486ff1e987b4b48956bf7ce 100644 --- a/library/Class/Systeme/ModulesAccueil.php +++ b/library/Class/Systeme/ModulesAccueil.php @@ -109,8 +109,10 @@ class Class_Systeme_ModulesAccueil extends Class_Systeme_ModulesAbstract { /** @return array */ public static function getModules() { if (null !== static::$_modules) - return static::$_modules = array_merge(static::$_modules, - Class_Template::current()->getWidgets()); + return static::$_modules; + + if ($widgets_templates = Class_Template::current()->getWidgets()) + return static::$_modules = $widgets_templates; $defaults = ['News', 'Critiques', @@ -147,9 +149,6 @@ class Class_Systeme_ModulesAccueil extends Class_Systeme_ModulesAbstract { if (Class_Adminvar::isActivityEnabled()) static::$_modules[Class_Systeme_ModulesAccueil_Activities::CODE] = new Class_Systeme_ModulesAccueil_Activities; - static::$_modules = array_merge(static::$_modules, - Class_Template::current()->getWidgets()); - return static::$_modules; } diff --git a/library/Class/Systeme/ModulesAccueil/Calendrier.php b/library/Class/Systeme/ModulesAccueil/Calendrier.php index d3ff2169a141a89833d4aa0a7c54f10c7eb7d7a2..72c58a72981996cdf3e492cfb53c4d8018114c71 100644 --- a/library/Class/Systeme/ModulesAccueil/Calendrier.php +++ b/library/Class/Systeme/ModulesAccueil/Calendrier.php @@ -60,8 +60,8 @@ class Class_Systeme_ModulesAccueil_Calendrier extends Class_Systeme_ModulesAccue public function getAvailableFilters() { - $available_filters = ['date' => $this->_('Mois'), - 'day' => $this->_('Date de début'), + $available_filters = ['day' => $this->_('Date'), + 'date' => $this->_('Mois'), 'place' => $this->_('Lieu')]; $custom_fields = Class_CustomField_Model::getModel('Article')->getFields(); diff --git a/library/Class/Template.php b/library/Class/Template.php index a17a580d65023db6c58bb046c5823f9e5ee7cccd..24718cb38c0fdebc7c4bb1234d4b31dda5fef24a 100644 --- a/library/Class/Template.php +++ b/library/Class/Template.php @@ -116,6 +116,7 @@ class Class_Template { $try_profile = $this->_findOrCreateTryProfileFrom($profile); $try_profile->save(); + Class_Profil::setCurrentProfil($try_profile); $try_profile = $this->_patchProfile($try_profile); $try_profile->save(); return $try_profile->getId(); @@ -189,11 +190,26 @@ class Class_Template { } + public function customProfileForm($form) { + return $this; + } + + + public function customProfilePageForm($form) { + return $this; + } + + public function handleFooter() { return false; } + public function handleSideColumn() { + return true; + } + + public function handleRecordView() { return false; } diff --git a/library/ZendAfi/Form/Configuration/Profile.php b/library/ZendAfi/Form/Configuration/Profile.php index 10e386a3a7ba2bf4d12587678a1ed4e9ab4a1621..59abcf779401cf95b4b5aeb22dc1bfd2f017d3b4 100644 --- a/library/ZendAfi/Form/Configuration/Profile.php +++ b/library/ZendAfi/Form/Configuration/Profile.php @@ -405,6 +405,7 @@ class ZendAfi_Form_Configuration_Profile extends ZendAfi_Form { 'admin_group', ['legend' => $this->_('Administration')]) ; + + Class_Template::current()->customProfileForm($this); } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/library/ZendAfi/Form/Configuration/Profile/Page.php b/library/ZendAfi/Form/Configuration/Profile/Page.php index ade8e0c239cda2a2e03d3a49d725e9dbde99a324..3e000619d4018e64e4a2b92e7fc06b7f372956f9 100644 --- a/library/ZendAfi/Form/Configuration/Profile/Page.php +++ b/library/ZendAfi/Form/Configuration/Profile/Page.php @@ -66,6 +66,7 @@ class ZendAfi_Form_Configuration_Profile_Page extends ZendAfi_Form { 'page_css'], 'display_group', ['legend' => $this->_('Affichage')]); - } -} -?> \ No newline at end of file + + Class_Template::current()->customProfilePageForm($this); + } +} \ No newline at end of file diff --git a/library/ZendAfi/Form/Decorator/ProfileComposition.php b/library/ZendAfi/Form/Decorator/ProfileComposition.php index 9982b2e36dc20bc33752dd83d1bf6dc3704a6c6f..c0ed7abac145df2a93b773d0d4332977b1deae2b 100644 --- a/library/ZendAfi/Form/Decorator/ProfileComposition.php +++ b/library/ZendAfi/Form/Decorator/ProfileComposition.php @@ -22,8 +22,11 @@ class ZendAfi_Form_Decorator_ProfileComposition extends Zend_Form_Decorator_Abstract { public function render($content) { - return $this->_element->getView()->profileComposition($this->_element->getName(), - $this->_element->getValue(), - $this->_element->getAttribs()); + return + $this->_element + ->getView() + ->profileComposition($this->_element->getName(), + $this->_element->getValue(), + $this->_element->getAttribs()); } } \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/Accueil/Kiosque.php b/library/ZendAfi/View/Helper/Accueil/Kiosque.php index 802d8d8c5ffb3eb3e48022b1d687cb111c712856..572c7561d0c47af2f80dfb5b56bab7825cfccd32 100644 --- a/library/ZendAfi/View/Helper/Accueil/Kiosque.php +++ b/library/ZendAfi/View/Helper/Accueil/Kiosque.php @@ -260,9 +260,11 @@ class ZendAfi_View_Helper_Accueil_Kiosque extends ZendAfi_View_Helper_Accueil_Ba $url_options = array_merge(['controller' => 'recherche', 'action' => 'simple'], $this->preferences); + $url_options['tri'] = ($this->preferences['tri']) ? $tris[$this->preferences['tri']] : $tris[0]; + unset($url_options['preferences']); return $this->view->tagAnchor($this->view->url($url_options, null, true), htmlentities($titre)); diff --git a/library/ZendAfi/View/Helper/Filters/Strategy/Calendar.php b/library/ZendAfi/View/Helper/Filters/Strategy/Calendar.php index 4400408d89e1a67c203b003ecee22dbe824f36ea..4579ae01391ab6299a8fe338ee397f65c799849a 100644 --- a/library/ZendAfi/View/Helper/Filters/Strategy/Calendar.php +++ b/library/ZendAfi/View/Helper/Filters/Strategy/Calendar.php @@ -29,4 +29,21 @@ class ZendAfi_View_Helper_Filters_Strategy_Calendar return $this->view->calendar_TableFilter($calendar); } + + + protected function _renderTitle() { + $title = parent::_renderTitle(); + + return ($day = $this->_getSelectedDay()) + ? $title . $this->_tag('span', ' : ' . $day) + : $title; + } + + + protected function _getSelectedDay() { + if (!$calendar = $this->_settings->getCalendar()) + return ''; + + return $calendar->getHumanDate(); + } } diff --git a/library/ZendAfi/View/Helper/ProfileComposition.php b/library/ZendAfi/View/Helper/ProfileComposition.php index 2fba3ae5ac6b77c1413be8d770adf64dbace1165..4deb63a05e70ea29015ef20f37e473bf54156e17 100644 --- a/library/ZendAfi/View/Helper/ProfileComposition.php +++ b/library/ZendAfi/View/Helper/ProfileComposition.php @@ -108,7 +108,9 @@ class ZendAfi_View_Helper_ProfileComposition extends ZendAfi_View_Helper_BaseHel protected function _getSideColumn() { - return $this->_getDivisionColumn(5, $this->_('Division flottante')); + return Class_Template::current()->handleSideColumn() + ? $this->_getDivisionColumn(5, $this->_('Division flottante')) + : ''; } diff --git a/library/templates/Intonation/Library/FormCustomizer.php b/library/templates/Intonation/Library/FormCustomizer.php index 0d3156afeedb340f107a44da3c4e95283cf49f6b..166bf9650047b0b5e78431e35789e9408e68880c 100644 --- a/library/templates/Intonation/Library/FormCustomizer.php +++ b/library/templates/Intonation/Library/FormCustomizer.php @@ -60,6 +60,16 @@ class Intonation_Library_FormCustomizer { } + public function getProfileForm($form) { + return (new Intonation_Library_FormCustomizer_Profile($this->_template, $form))->getForm(); + } + + + public function getProfilePageForm($form) { + return (new Intonation_Library_FormCustomizer_ProfilePage($this->_template, $form))->getForm(); + } + + protected function _getStrategyFor($form) { $strategies = ['ZendAfi_Form_Configuration_Widget_Login' => 'FormStyle', 'ZendAfi_Form_Configuration_Widget_Search' => 'FormStyle']; diff --git a/library/templates/Intonation/Library/FormCustomizer/Abstract.php b/library/templates/Intonation/Library/FormCustomizer/Abstract.php index b5450f6403db3a5d5144cc6b40e5a2b00951ef70..1249beb81da32816786ec2e124a379effe67e7a4 100644 --- a/library/templates/Intonation/Library/FormCustomizer/Abstract.php +++ b/library/templates/Intonation/Library/FormCustomizer/Abstract.php @@ -38,7 +38,7 @@ class Intonation_Library_FormCustomizer_Abstract { public function __construct($template, $form) { $this->_template = $template; - $this->_form=$form; + $this->_form = $form; } diff --git a/library/templates/Intonation/Library/FormCustomizer/Profile.php b/library/templates/Intonation/Library/FormCustomizer/Profile.php new file mode 100644 index 0000000000000000000000000000000000000000..ebb2cfbe6c5e955636b2c35885f99eeb13fddcf8 --- /dev/null +++ b/library/templates/Intonation/Library/FormCustomizer/Profile.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright (c) 2012-2018, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class Intonation_Library_FormCustomizer_Profile extends Intonation_Library_FormCustomizer_Abstract { + + public function getForm() { + $display_settings_group = $this->_form->getDisplayGroup('profil_display_settings'); + $display_settings_group->clearElements(); + $this->_form->removeDisplayGroup('profil_display_settings'); + + $banner_group = $this->_form->getDisplayGroup('banner_group'); + $banner_group->clearElements(); + $this->_form->removeDisplayGroup('banner_group'); + + return $this->_form; + } +} \ No newline at end of file diff --git a/library/templates/Intonation/Library/FormCustomizer/ProfilePage.php b/library/templates/Intonation/Library/FormCustomizer/ProfilePage.php new file mode 100644 index 0000000000000000000000000000000000000000..8b5ad42ca177f027e7ceb65b0563e9dd39d25e32 --- /dev/null +++ b/library/templates/Intonation/Library/FormCustomizer/ProfilePage.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright (c) 2012-2018, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class Intonation_Library_FormCustomizer_ProfilePage extends Intonation_Library_FormCustomizer_Abstract { + + public function getForm() { + $display_settings_group = $this->_form->getDisplayGroup('display_group'); + $display_settings_group->clearElements(); + $this->_form->removeDisplayGroup('display_group'); + return $this->_form; + } +} \ No newline at end of file diff --git a/library/templates/Intonation/Library/FormCustomizer/Widget/FormStyle.php b/library/templates/Intonation/Library/FormCustomizer/Widget/FormStyle.php index 18e583b887b007b677360b24d3f46a4e431fc336..1e28bf5fbc980e9023ed94958ca6c6e2f9aa4b68 100644 --- a/library/templates/Intonation/Library/FormCustomizer/Widget/FormStyle.php +++ b/library/templates/Intonation/Library/FormCustomizer/Widget/FormStyle.php @@ -29,7 +29,6 @@ class Intonation_Library_FormCustomizer_Widget_FormStyle extends Intonation_Libr 'multiOptions' => ['default' => $this->_('Formulaire standard'), 'inline' => $this->_('Formulaire en ligne'), 'toggle' => $this->_('Formulaire à bascule')]]); - } diff --git a/library/templates/Intonation/Library/ProfilePatcher.php b/library/templates/Intonation/Library/ProfilePatcher.php index 6ec76023be0333167a927aa976f3e9c1c505e2b6..9efc0f2c5c9c491424dd2f4f658afb1b3f7d88de 100644 --- a/library/templates/Intonation/Library/ProfilePatcher.php +++ b/library/templates/Intonation/Library/ProfilePatcher.php @@ -41,9 +41,11 @@ class Intonation_Library_ProfilePatcher { protected function _upgradeProfile() { $this->_profile - ->setSkin(''); - - $this->_profile + ->setCfgSiteParam('skin', '') + ->setCfgSiteParam('nb_divisions', '3') + ->setCfgSiteParam('largeur_division1', '10') + ->setCfgSiteParam('largeur_division2', '10') + ->setCfgSiteParam('largeur_division3', '10') ->setCfgSiteParam('barre_nav_on', '') ->setCfgSiteParam('accessibilite_on', '') ->setCfgSiteParam('hauteur_banniere', '') diff --git a/library/templates/Intonation/Library/Widget/Accessibility/Definition.php b/library/templates/Intonation/Library/Widget/Accessibility/Definition.php index a99f4f9d60c52b4313a443d820aacc65382dfe81..cb491ba9db0a90fb5273fc5a2a49045c2de4dc84 100644 --- a/library/templates/Intonation/Library/Widget/Accessibility/Definition.php +++ b/library/templates/Intonation/Library/Widget/Accessibility/Definition.php @@ -28,7 +28,7 @@ class Intonation_Library_Widget_Accessibility_Definition extends Class_Systeme_M FULL = 'full'; protected - $_group = Class_Systeme_ModulesAccueil::GROUP_SITE, + $_group = Class_Systeme_ModulesAccueil::GROUP_ABONNE, $_isPhone = false; diff --git a/library/templates/Intonation/Library/Widget/Carousel/Library/Definition.php b/library/templates/Intonation/Library/Widget/Carousel/Library/Definition.php index e306be60c5231d6fb6a389745aa5b5c491cc55ed..616ab59c4d52f5d37000980dfefed543af2c993d 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Library/Definition.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Library/Definition.php @@ -24,7 +24,7 @@ class Intonation_Library_Widget_Carousel_Library_Definition extends Intonation_L const CODE = 'LIBRARY'; - protected $_group = Class_Systeme_ModulesAccueil::GROUP_SITE; + protected $_group = Class_Systeme_ModulesAccueil::GROUP_INFO; public function __construct() { diff --git a/library/templates/Intonation/Library/Widget/Carousel/Record/Definition.php b/library/templates/Intonation/Library/Widget/Carousel/Record/Definition.php index c16f78ce9fd65face58b6e70325f9323efe05957..30b1d0d1ac7c24e4f1920c4ff89a25912722b028 100644 --- a/library/templates/Intonation/Library/Widget/Carousel/Record/Definition.php +++ b/library/templates/Intonation/Library/Widget/Carousel/Record/Definition.php @@ -24,7 +24,7 @@ class Intonation_Library_Widget_Carousel_Record_Definition extends Intonation_Li const CODE = 'KIOSQUE'; - protected $_group = Class_Systeme_ModulesAccueil::GROUP_RECH; + protected $_group = Class_Systeme_ModulesAccueil::GROUP_INFO; public function __construct() { diff --git a/library/templates/Intonation/Library/Widget/Language/Definition.php b/library/templates/Intonation/Library/Widget/Language/Definition.php new file mode 100644 index 0000000000000000000000000000000000000000..7f4ea5abda60829d47da87b66007970f4bba8789 --- /dev/null +++ b/library/templates/Intonation/Library/Widget/Language/Definition.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved. + * + * BOKEH is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * BOKEH is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with BOKEH; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +class Intonation_Library_Widget_Language_Definition extends Class_Systeme_ModulesAccueil_Langue { + + protected $_group = Class_Systeme_ModulesAccueil::GROUP_ABONNE; +} \ No newline at end of file diff --git a/library/templates/Intonation/Library/Widget/Login/Definition.php b/library/templates/Intonation/Library/Widget/Login/Definition.php index 3ed8b77a52ff4c450e1405dc48f2b31a052d581a..a22b9b9673a8be146aa2c5b4f912dc6de7ea193b 100644 --- a/library/templates/Intonation/Library/Widget/Login/Definition.php +++ b/library/templates/Intonation/Library/Widget/Login/Definition.php @@ -21,6 +21,10 @@ class Intonation_Library_Widget_Login_Definition extends Class_Systeme_ModulesAccueil_Login { + + protected + $_group = Class_Systeme_ModulesAccueil::GROUP_ABONNE; + public function __construct() { parent::__construct(); $this->_view_helper = 'Intonation_Library_Widget_Login_View'; diff --git a/library/templates/Intonation/Library/Widget/Notify/Definition.php b/library/templates/Intonation/Library/Widget/Notify/Definition.php index d3431e050517af13a54b8af0df7c625c1eeea688..2067a8b112e1c04f214a4935849ff1d7d37fa79c 100644 --- a/library/templates/Intonation/Library/Widget/Notify/Definition.php +++ b/library/templates/Intonation/Library/Widget/Notify/Definition.php @@ -24,7 +24,7 @@ class Intonation_Library_Widget_Notify_Definition extends Class_Systeme_ModulesA const CODE = 'NOTIFY'; protected - $_group = Class_Systeme_ModulesAccueil::GROUP_SITE, + $_group = Class_Systeme_ModulesAccueil::GROUP_ABONNE, $_isPhone = false; diff --git a/library/templates/Intonation/Library/Widget/Share/Definition.php b/library/templates/Intonation/Library/Widget/Share/Definition.php index c4ba7cbb367d1511052dc1e8b020c13b075f663c..19e8973053bda989e0771a1a4ac2cebf504646a8 100644 --- a/library/templates/Intonation/Library/Widget/Share/Definition.php +++ b/library/templates/Intonation/Library/Widget/Share/Definition.php @@ -26,7 +26,7 @@ class Intonation_Library_Widget_Share_Definition extends Class_Systeme_ModulesAc CODE = 'SHARE'; protected - $_group = Class_Systeme_ModulesAccueil::GROUP_SITE, + $_group = Class_Systeme_ModulesAccueil::GROUP_ABONNE, $_isPhone = false; diff --git a/library/templates/Intonation/Template.php b/library/templates/Intonation/Template.php index 2c63f83af56855c7f9ab8a2ee80313cd392310e2..b1f74d2e468a4ceccbdf9ea88affcbde32d02f43 100644 --- a/library/templates/Intonation/Template.php +++ b/library/templates/Intonation/Template.php @@ -58,6 +58,11 @@ class Intonation_Template extends Class_Template { } + public function handleSideColumn() { + return false; + } + + public function handleRecordView() { return true; } @@ -120,16 +125,29 @@ class Intonation_Template extends Class_Template { return $this->_widgets_cache = [Intonation_Library_Widget_Nav_Definition::CODE => new Intonation_Library_Widget_Nav_Definition, + Intonation_Library_Widget_Breadcrumb_Definition::CODE => new Intonation_Library_Widget_Breadcrumb_Definition, + Intonation_Library_Widget_Notify_Definition::CODE => new Intonation_Library_Widget_Notify_Definition, + Intonation_Library_Widget_Login_Definition::CODE => new Intonation_Library_Widget_Login_Definition, + Intonation_Library_Widget_Search_Definition::CODE => new Intonation_Library_Widget_Search_Definition, + Intonation_Library_Widget_Accessibility_Definition::CODE => new Intonation_Library_Widget_Accessibility_Definition, + Intonation_Library_Widget_Share_Definition::CODE => new Intonation_Library_Widget_Share_Definition, + Intonation_Library_Widget_Image_Definition::CODE => new Intonation_Library_Widget_Image_Definition, + Intonation_Library_Widget_AdminTools_Definition::CODE => new Intonation_Library_Widget_AdminTools_Definition, + Intonation_Library_Widget_Credits_Definition::CODE => new Intonation_Library_Widget_Credits_Definition, + Intonation_Library_Widget_Scroll_Definition::CODE => new Intonation_Library_Widget_Scroll_Definition, + + Intonation_Library_Widget_Language_Definition::CODE => new Intonation_Library_Widget_Language_Definition, + Intonation_Library_Widget_Carousel_Record_Definition::CODE => new Intonation_Library_Widget_Carousel_Record_Definition, Intonation_Library_Widget_Carousel_Article_Definition::CODE => new Intonation_Library_Widget_Carousel_Article_Definition, @@ -137,7 +155,8 @@ class Intonation_Template extends Class_Template { Intonation_Library_Widget_Carousel_Review_Definition::CODE => new Intonation_Library_Widget_Carousel_Review_Definition, Intonation_Library_Widget_Carousel_Library_Definition::CODE => new Intonation_Library_Widget_Carousel_Library_Definition, - Intonation_Library_Widget_Carousel_Agenda_Definition::CODE => new Intonation_Library_Widget_Carousel_Agenda_Definition + + Intonation_Library_Widget_Carousel_Agenda_Definition::CODE => new Intonation_Library_Widget_Carousel_Agenda_Definition, ]; } @@ -172,6 +191,18 @@ class Intonation_Template extends Class_Template { } + public function customProfileForm($form) { + $helper = new Intonation_Library_FormCustomizer($this); + return $helper->getProfileForm($form); + } + + + public function customProfilePageForm($form) { + $helper = new Intonation_Library_FormCustomizer($this); + return $helper->getProfilePageForm($form); + } + + public function getTagEditSection($id_section, $view) { $section = (new Class_Systeme_Widget_Section) ->setId($id_section) diff --git a/library/templates/Intonation/View/CalendarContent.php b/library/templates/Intonation/View/CalendarContent.php index 7acf4f4d26e39fe7c4ca7638647679315dfc00d0..1b2ec018128b82bcdb450823a587cecc976fdb2e 100644 --- a/library/templates/Intonation/View/CalendarContent.php +++ b/library/templates/Intonation/View/CalendarContent.php @@ -37,4 +37,21 @@ class Intonation_View_CalendarContent extends ZendAfi_View_Helper_CalendarConten return $this->view->div(['class' => 'calendar'], implode($html)); } + + + protected function renderFilters() { + $enabled_filters = (new Class_Systeme_ModulesAccueil_Calendrier)->getAvailableFilters(); + $enabled_filters = array_keys($enabled_filters); + + $filter_settings = new Class_FilterSettings(new Class_Systeme_ModulesAccueil_Calendrier()); + + $filter_settings + ->setFilters($enabled_filters) + ->setSelectedFilters($this->calendar->getActiveFilters()) + ->setModelLabel('Article') + ->setUrlParams($this->calendar->getBaseUrl()) + ->setCalendar($this->calendar); + + return $this->view->filters_Render($filter_settings); + } } diff --git a/public/admin/css/config_accueil.css b/public/admin/css/config_accueil.css index 9f72249d55e3a1bc32911f79170701fa4543ea70..725fdaec57a1a331ae4d975ae8498efdef60c3a0 100644 --- a/public/admin/css/config_accueil.css +++ b/public/admin/css/config_accueil.css @@ -59,6 +59,12 @@ width: 66%; } + +.profile_composition .drag_drop_container > [data-division="4"]:first-child { + display: block; + margin: auto; +} + .profile_composition .drag_drop_container > [data-division="2"][data-divisions="3"] { width: 50%; } diff --git a/tests/application/modules/admin/controllers/WidgetControllerTest.php b/tests/application/modules/admin/controllers/WidgetControllerTest.php index dff49f0fc34eca46a4ca943868c50b66d881ab03..351d4b8586da3db45072bee60b2493150bb522d6 100644 --- a/tests/application/modules/admin/controllers/WidgetControllerTest.php +++ b/tests/application/modules/admin/controllers/WidgetControllerTest.php @@ -395,7 +395,7 @@ class WidgetControllerCalendarTest extends WidgetControllerDispatchWidgetConfigu /** @test */ public function secondListShouldContainsStartDate() { - $this->assertXPathContentContains('//div[@id="input_enabled_filters"]/div[2]/ul/li[@data-value="day"]', 'Date de début'); + $this->assertXPathContentContains('//div[@id="input_enabled_filters"]/div[2]/ul/li[@data-value="day"]', 'Date'); } diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index 66275ac1ed4739b6333080e4891d486b9d08dcfd..b2592449879475f8277eafc6fabd3355309d7949 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -25,6 +25,11 @@ abstract class TemplatesEnabledTestCase extends Admin_AbstractControllerTestCase parent::setUp(); Class_AdminVar::set('TEMPLATING', 1); } + + public function tearDown() { + parent::tearDown(); + Class_Systeme_ModulesAccueil::reset(); + } } @@ -258,14 +263,6 @@ abstract class TemplatesIntonationTestCase extends TemplatesEnabledTestCase { 'type_module' => 'NOTIFY', 'preferences' => []], - '6' => ['division' => 6, - 'type_module' => 'TAGS', - 'preferences' => []], - - '7' => ['division' => 5, - 'type_module' => 'TAGS', - 'preferences' => []], - '8' => ['division' => 1, 'type_module' => 'RECH_SIMPLE', 'preferences' => ['boite' => ['card'], @@ -366,6 +363,7 @@ abstract class TemplatesIntonationTestCase extends TemplatesEnabledTestCase { ->answers([]); (new Intonation_Template)->tryOn($profile); + Class_Systeme_ModulesAccueil::reset(); } } @@ -471,8 +469,8 @@ class TemplatesDispatchIntonationTest extends TemplatesIntonationTestCase { /** @test */ - public function asidesShouldHaveClassColMd3() { - $this->assertXPathCount('//aside[contains(@class, "col")]', 3); + public function shouldContainsTwoSideColumn() { + $this->assertXPathCount('//aside[contains(@class, "col")]', 2); } @@ -529,6 +527,7 @@ class TemplatesDispatchEditMenuHTest extends TemplatesIntonationTestCase { public function setUp() { parent::setUp(); + Class_Profil::setCurrentProfil(Class_Profil::find(2)); $this->dispatch('/admin/widget/edit-menu/id/H/id_profil/72', true); } @@ -558,6 +557,7 @@ class TemplatesDispatchEditBreadcrumbWidgetTest extends TemplatesIntonationTestC public function setUp() { parent::setUp(); + Class_Profil::setCurrentProfil(Class_Profil::find(2)); $this->dispatch('/admin/widget/edit-widget/id/4/id_profil/72', true); } @@ -1459,6 +1459,7 @@ class TemplatesDispatchEditAccessibilityWidgetTest extends TemplatesIntonationTe public function setUp() { parent::setUp(); + Class_Profil::setCurrentProfil(Class_Profil::find(2)); $this->dispatch('/admin/widget/edit-widget/id/11/id_profil/72', true); } @@ -3548,7 +3549,88 @@ class TemplatesDispatchAgendaWidgetTest extends TemplatesIntonationTestCase { /** @test */ public function cmsCalendarShouldRenderFilters() { - $this->dispatch('/opac/cms/calendar/id_profil/72/id/21', true); - $this->assertXPathContentContains('//div//a[contains(@href, "/cms/calendar/")]', 'Janvier'); + $this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/render/ajax', true); + $this->assertXPathContentContains('//div[contains(@class, "filters")]//a[contains(@href, "/cms/calendar/")]', + 'Janvier'); + } + + + /** @test */ + public function cmsCalendarShouldRenderSelectedDayInFilterTitle() { + $this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/day/2019-06-01/render/ajax', true); + $this->assertXPathContentContains('//div[contains(@class, "filters")]//button/span', + '01/06/2019'); + } + + + /** @test */ + public function cmsCalendarShouldRenderSelectedMonthInFilterTitle() { + $this->dispatch('/opac/cms/calendar/id_profil/72/id_module/21/day/2019-06/render/ajax', true); + $this->assertXPathContentContains('//div[contains(@class, "filters")]//button/span', + '06/2019'); + } +} + + + +class TemplatesDispatchEditProfileTest extends TemplatesIntonationTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/admin/profil/edit/id_profil/72'); + } + + /** @test */ + public function formShouldNotContainsAffichage() { + $this->assertNotXPathContentContains('//form//fieldset/legend', 'Affichage'); + } + + + /** @test */ + public function formShouldNotContainsBanniere() { + $this->assertNotXPathContentContains('//form//fieldset/legend', 'Banniere'); + } + + + /** @test */ + public function formShouldNotContainsInputCSS() { + $this->assertNotXPath('//form//input[@name="header_css"]'); + } + + + /** @test */ + public function formShouldNotContainsCouleurTexteBandeau() { + $this->assertNotXPath('//form//input[@name="couleur_texte_bandeau"]'); + } +} + + + +class TemplatesDispatchProfilAccueilTest extends TemplatesIntonationTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/admin/profil/accueil/id_profil/72'); + } + + /** @test */ + public function formShouldNotContainsAffichage() { + $this->assertNotXPathContentContains('//form//fieldset/legend', 'Affichage'); + } + + + /** @test */ + public function formShouldNotContainsDivisionFlottante() { + $this->assertNotXPathContentContains('//form//h5', 'Division flottante'); + } + + + /** @test */ + public function formShouldNotContainsInputCSS() { + $this->assertNotXPath('//form//input[@name="page_css"]'); + } + + + /** @test */ + public function formShouldContainsDataDivisions3() { + $this->assertXPath('//form//div[@data-divisions="3"]'); } } \ No newline at end of file