Skip to content
Snippets Groups Projects
Commit 4354d8db authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT Committed by Patrick Barroca
Browse files

hotline#116552 : whitepage web newsletter box included in Menu Home Page and user is not connected

parent 35f95d2a
Branches
Tags
1 merge request!3627hotline#116552 : whitepage web newsletter box included in Menu Home Page and user is not connected
Pipeline #11033 passed with stage
in 47 minutes and 15 seconds
- ticket #116552 : Magasin de thème : page blanche quand une boîte newsletter est incluse dans un menu de la page accueil
\ No newline at end of file
......@@ -38,11 +38,9 @@ class Intonation_Library_View_Wrapper_Newsletter extends Intonation_Library_View
public function getMainLink() {
if (!$current_user = Class_Users::getIdentity())
return '';
if ($current_user->isNewsletterDisabled())
return '';
if ((!$current_user = Class_Users::getIdentity())
|| $current_user->isNewsletterDisabled())
return null;
$params = $this->_model->hasRecipient($current_user)
? ['Url' => $this->_view->url(['controller' => 'abonne',
......
......@@ -30,17 +30,17 @@ class Intonation_View_CardifyWithOverlay extends ZendAfi_View_Helper_BaseHelper
protected function _cardWithPicture($element) {
$title = $element->getMainTitle();
$title = $this->_tag('div',
$title,
['class' => 'card-title']);
if (!$main_link = $element->getMainLink())
return '';
$title = $element->getMainTitle();
$title = $this->view->div(['class' => 'card-title'], $title);
$content = [$title];
if ($author_name = $element->getSecondaryTitle())
$content [] = $this->view->div(['class' => 'card-subtitle'],
$element->getSecondaryIco() . $this->view->div(['class' => 'd-inline'], $author_name));
$element->getSecondaryIco()
. $this->view->div(['class' => 'd-inline'], $author_name));
$doc_type = Class_Template::current()
->getIco($this->view,
......@@ -50,18 +50,15 @@ class Intonation_View_CardifyWithOverlay extends ZendAfi_View_Helper_BaseHelper
$content = implode($content) . $doc_type;
$main_link = $element
->getMainLink()
$main_link
->setText($content)
->setInlineText(1)
->setImage('');
$link = $this->view->tagAction($main_link);
$overlay = $this->_tag('div',
$element->getContentForJSSearch()
. $link,
['class' => 'card-block card-img-overlay rounded text-center text-white']);
$overlay = $this->view->div(['class' => 'card-block card-img-overlay rounded text-center text-white'],
$element->getContentForJSSearch() . $link);
$img = $this->view->tagMedia($element,
['class' => 'text-center img_as_background'],
......
{
"id": 64,
"id_profil": 64,
"browser": "opac",
"libelle": "Biblioth\u00e8ques Chemill\u00e9-en-Anjou",
"commentaire": "Bienvenue sur le portail des biblioth\u00e8ques de Chemill\u00e9-en-Anjou",
"titre_site": "Biblioth\u00e8ques Chemill\u00e9-en-Anjou",
"ref_tags": "m\u00e9diath\u00e8que ; biblioth\u00e8ques ;",
"ref_description": "",
"cfg_accueil": {
"modules": {
"15": {
"type_module": "MENU",
"preferences": {
"titre": "Menu volant",
"menu": "64-3",
"layout": "horizontal",
"boite": [
"admin_tools_invert_colors",
"no_border",
"no_border_radius",
"no_shadow",
"position_fixed_top_right",
"tdm_flying_widget",
"z_index_11"
],
"profile_id": "64",
"TerredumilieuExpandBreakpoint": "always",
"TerredumilieuWidthXsmall": "6",
"TerredumilieuWidthMedium": "4",
"TerredumilieuWidthLarge": "3",
"TerredumilieuVisibilityIndex": "1",
"TerredumilieuVisibilityRecherche": "1",
"TerredumilieuVisibilityAbonne": "1",
"TerredumilieuVisibilityCms": "1",
"TerredumilieuVisibilityBlog": "1",
"TerredumilieuVisibilityAuth": "1"
},
"division": "4",
"id_module": "15",
"profile_id": "64"
}
},
"use_parent_css": "1",
"sitemap": "1"
},
"cfg_menus": {
"3": {
"type_menu": "MENU",
"libelle": "Menu volant",
"menus": [
{
"type_module": "MODULE_ACCUEIL_NEWSLETTERS",
"type_menu": "MODULE_ACCUEIL_NEWSLETTERS",
"id_module": "5",
"preferences": {
"layout": "wall",
"rendering": "card-overlay",
"size": "1",
"all_layout": "list",
"all_rendering": "card-horizontal",
"titre": "Lettre d'information : je m'abonne",
"order": "titre asc",
"boite": [
"titre_petit"
],
"TerredumilieuExpandBreakpoint": "sm",
"TerredumilieuWidthXsmall": "3",
"TerredumilieuWidthLarge": "6",
"TerredumilieuVisibilityIndex": "1",
"TerredumilieuVisibilityRecherche": "1",
"TerredumilieuVisibilityAbonne": "1",
"TerredumilieuVisibilityCms": "1",
"TerredumilieuVisibilityBlog": "1",
"TerredumilieuVisibilityAuth": "1",
"TerredumilieuShowHeader": "1",
"TerredumilieuShowContent": "1",
"TerredumilieuShowFooter": "1"
}
}
],
"children": "MODULE_ACCUEIL_NEWSLETTERS;",
"preferences": {
"type_module": "MENU",
"type_menu": "MENU",
"libelle": "Menu volant",
"children": "MODULE_ACCUEIL_NEWSLETTERS;"
}
}
},
"template": "TERREDUMILIEU"
}
<?php
/**
* Copyright (c) 2012-2020, 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
*/
require_once 'TemplatesTest.php';
/** @see http://forge.afi-sa.fr/issues/116552 */
class TemplatesWidgetInMenusNewsletterLoggedOutTest extends TemplatesIntonationTestCase {
/** @test */
public function pageShouldContainswidgetNewsletterInMenu() {
// widgets in menu is an activable feature, otherwise widget are ignored in menu rendering
Class_AdminVar::set('MENU_BOITE', 1);
(new Class_Profil_Import($this->fixture('Class_Profil', ['id' => 7])))
->import(__DIR__ . '/116552_profile_widget_in_menu.json');
$this->fixture('Class_Newsletter',
['id' => 42,
'titre' => 'The answer',
'mail_subject' => 'The answer']);
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('/opac/index/index/id_profil/7');
$this->assertXPathContentContains('//li[@class="nav-item"]//div[@id="boite_3-0"]//div[contains(@class, "widget-header")]',
'Lettre d\'information : je m\'abonne',
$this->_response->getBody());
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment