diff --git a/VERSIONS_HOTLINE/65451 b/VERSIONS_HOTLINE/65451 new file mode 100644 index 0000000000000000000000000000000000000000..94d54c6ec441c4185cc2d062eb706cf5ac51e5ca --- /dev/null +++ b/VERSIONS_HOTLINE/65451 @@ -0,0 +1,2 @@ + - ticket #65451 : Administration : Correction du parémtrage des entrées de menu "sélection d'articles". + \ No newline at end of file diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index e1cca78a7d1aecf31cb0184f1452210cb185dbb6..fea7a01214b5f46b7233d01647fc44b1495fc478 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -288,28 +288,22 @@ class CmsController extends ZendAfi_Controller_Action { * @param array $preferences */ protected function _viewArticlesByPreferences($preferences) { - $articles = Class_Article::getLoader() - ->getArticlesByPreferences($preferences); - - $articles = Class_Article::getLoader()->filterByLocaleAndWorkflow($articles); + $articles = Class_Article::getArticlesByPreferences($preferences); + $articles = Class_Article::filterByLocaleAndWorkflow($articles); $articles = Class_Article::filterByDay(strtotime($this->_getParam('d')), $articles); - + //var_dump($preferences);exit; $this->view->articles = $articles; - if (array_key_exists('titre', $preferences)) { - $this->view->title = $preferences['titre']; - } + if (array_key_exists('libelle', $preferences)) + $this->view->titreAdd(($this->view->titre = $preferences['libelle'])); - foreach($articles as $article) { - $this->view->titreAdd($article->getTitre()); - } + $this->view->show_content = + (isset($preferences['summary_content']) + && isset($preferences['display_mode']) + && ($preferences['display_mode'] == 'Summary')) + ? $preferences['summary_content'] + : 'FullContent'; - if (isset($preferences['summary_content']) && isset($preferences['display_mode']) && ($preferences['display_mode'] == 'Summary')) { - $this->view->show_content = $preferences['summary_content']; - } else { - $this->view->show_content = 'FullContent'; - } - - $this->renderScript('cms/articlesview.phtml'); + $this->renderScript('cms/articlesview.phtml'); } } \ No newline at end of file diff --git a/application/modules/opac/views/scripts/cms/article_partial.phtml b/application/modules/opac/views/scripts/cms/article_partial.phtml index 932136e1f8d07f7f610316ff6171d69bd048c344..679ae2f3b94432284404d180fff8ad7278222a3f 100644 --- a/application/modules/opac/views/scripts/cms/article_partial.phtml +++ b/application/modules/opac/views/scripts/cms/article_partial.phtml @@ -3,11 +3,14 @@ if (!isset($this->show_content)) { $this->show_content = 'FullContent'; } -$helper = $this->show_content == 'FullContent' - ? $this->getHelper('Article_RenderFullContent') - : $this->getHelper('Article_RenderSummary'); +$helper = $this->getHelper('Article_RenderFullContent'); -echo $helper->beRenderInBoite() - ->renderArticle($this->article, 'article'); +if($this->show_content == 'Summary') + $helper = $this->getHelper('Article_RenderSummary'); + +if($this->show_content == 'TitlesOnly') + $helper = $this->getHelper('Article_RenderTitleOnly'); -?> + +echo $helper->beRenderInBoite() + ->renderArticle($this->article, 'article'); \ No newline at end of file diff --git a/library/Class/Systeme/ModulesMenu/News.php b/library/Class/Systeme/ModulesMenu/News.php index 8b66d0fc4efa49062d91fcfd4bbe915c7c473cec..3e1465c39bd2a90dd48fbd70db6db93faab07d4f 100644 --- a/library/Class/Systeme/ModulesMenu/News.php +++ b/library/Class/Systeme/ModulesMenu/News.php @@ -29,11 +29,15 @@ class Class_Systeme_ModulesMenu_News extends Class_Systeme_ModulesMenu_Null { $_popupHeight = 400, $_isPhone = false, $_isPackMobile = false, - $_defaultValues = ['id_categorie' => '', + $_defaultValues = ['libelle' => '', + 'use_profil' => '', + 'id_categorie' => '', 'id_items' => '', 'nb_aff' => '5', 'nb_analyse' => '10', - 'display_order' => 'Selection']; + 'display_order' => 'DateCreationDesc', + 'display_mode' => 'Submenu', + 'summary_content' => 'FullContent']; public function __construct() { diff --git a/library/ZendAfi/Form/Configuration/Menu/News.php b/library/ZendAfi/Form/Configuration/Menu/News.php index c1991bacc8e53b09e36620e99612f76f5d07cbae..b62a68d22d79248717a662de569d655da0995742 100644 --- a/library/ZendAfi/Form/Configuration/Menu/News.php +++ b/library/ZendAfi/Form/Configuration/Menu/News.php @@ -24,6 +24,15 @@ class ZendAfi_Form_Configuration_Menu_News public function init() { parent::init(); + + Class_ScriptLoader::getInstance() + ->addJQueryReady( + 'radioToggleVisibilityForElement("input[name=\'display_order\']", $("#nb_aff").closest("tr"), ["DateCreationDesc", "DebutPublicationDesc", "EventDebut", "Random", "CommentCount"]);' + + . 'radioToggleVisibilityForElement("input[name=\'display_order\']", $("#nb_analyse").closest("tr"), "Random");' + . 'formSelectToggleVisibilityForElement("#display_mode", $("#summary_content").closest("tr"), "Summary");' + ); + $this->addElement('radio', 'display_order', ['label' => $this->_('Ordre d\'affichage'), @@ -41,18 +50,18 @@ class ZendAfi_Form_Configuration_Menu_News ->addElement('select', 'display_mode', - ['label' => $this->_('Cliquer sur le menu ouvre'), + ['label' => $this->_('Afficher la sélection'), 'value' => 'Submenu', - 'multiOptions' => ['Submenu' => $this->_('sous-menu'), - 'Summary' => $this->_('sommaire')]]) + 'multiOptions' => ['Submenu' => $this->_('Oui'), + 'Summary' => $this->_('Non')]]) ->addElement('select', 'summary_content', - ['label' => $this->_('Contenu du sommaire'), + ['label' => $this->_('Configuration du lien'), 'value' => 'Summary', - 'multioptions' => ['Summary' => $this->_('résumé'), - 'TitlesOnly' => $this->_('titres seulement'), - 'FullContent' => $this->_('Articles complets')]]); + 'multioptions' => ['Summary' => $this->_('Accéder aux résumés'), + 'TitlesOnly' => $this->_('Accéder aux titres seulement'), + 'FullContent' => $this->_('Accéder aux articles complets')]]); } diff --git a/library/ZendAfi/View/Helper/Article/RenderAbstract.php b/library/ZendAfi/View/Helper/Article/RenderAbstract.php index 28adc8325d890ea497e97961757b702bb9342e23..f5e28c8ea28a4671013f80767901a5723ebe3323 100644 --- a/library/ZendAfi/View/Helper/Article/RenderAbstract.php +++ b/library/ZendAfi/View/Helper/Article/RenderAbstract.php @@ -132,6 +132,4 @@ abstract class ZendAfi_View_Helper_Article_RenderAbstract extends ZendAfi_View_H public function renderArticleInfo($article) { return $this->view->tagArticleInfo($article); } -} - -?> \ No newline at end of file +} \ No newline at end of file