From e2b9c113132b752f6a3aa598ff8af2526be83051 Mon Sep 17 00:00:00 2001 From: efalcy <efalcy@afi-sa.fr> Date: Wed, 13 Oct 2021 17:10:31 +0200 Subject: [PATCH] dev@142667_supprimer_la_pub_mybibapp : delete mybibapp teaser --- VERSIONS_WIP/142667 | 1 + .../admin/views/scripts/index/index.phtml | 7 +- .../View/Helper/Admin/MyBibAppTeaser.php | 149 ------------------ .../admin/controllers/IndexControllerTest.php | 13 +- 4 files changed, 6 insertions(+), 164 deletions(-) create mode 100644 VERSIONS_WIP/142667 delete mode 100644 library/ZendAfi/View/Helper/Admin/MyBibAppTeaser.php diff --git a/VERSIONS_WIP/142667 b/VERSIONS_WIP/142667 new file mode 100644 index 00000000000..f6f89a5f6a0 --- /dev/null +++ b/VERSIONS_WIP/142667 @@ -0,0 +1 @@ + - ticket #142667 : administration : suppression de la pub mybibapp \ No newline at end of file diff --git a/application/modules/admin/views/scripts/index/index.phtml b/application/modules/admin/views/scripts/index/index.phtml index 30a5a87a7fa..f51e8277de2 100644 --- a/application/modules/admin/views/scripts/index/index.phtml +++ b/application/modules/admin/views/scripts/index/index.phtml @@ -1,10 +1,5 @@ -<?php echo $this->renderBokehVersion();?> +<?php echo $this->renderBokehVersion(); -<?php -if ($this->is_request_secure) - echo $this->myBibAppTeaser(); -?> -<?php echo $this->tag('h2', $this->_('Enquête de satisfaction')); $form_link = Class_IntBib::isSingleNanook() diff --git a/library/ZendAfi/View/Helper/Admin/MyBibAppTeaser.php b/library/ZendAfi/View/Helper/Admin/MyBibAppTeaser.php deleted file mode 100644 index 73d031efe41..00000000000 --- a/library/ZendAfi/View/Helper/Admin/MyBibAppTeaser.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php -/** - * Copyright (c) 2012-2014, 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 ZendAfi_View_Helper_Admin_MyBibAppTeaser extends ZendAfi_View_Helper_BaseHelper { - public function myBibAppTeaser() { - Class_ScriptLoader::getInstance()->addInlineStyle($this->_css()); - return $this->_tag('div', - $this->_renderContent(), - ['id' => 'mybibapp_teaser']); - - } - - protected function _css() { - return ' - #mybibapp_teaser { - display: grid; - grid-gap: 10px; - grid-template-columns: repeat(auto-fill, 150px); - } - - #mybibapp_teaser > a { - align-self: end; - } - - #mybibapp_teaser > a:first-child() { - grid-column: 1/3; - grid-row: 1; - } - - #mybibapp_teaser > a:nth-child(2) { - grid-column: 1; - grid-row: 2; - } - - #mybibapp_teaser > a:nth-child(3) { - grid-column: 2; - grid-row: 2; - } - - #mybibapp_teaser > div { - grid-column: 3/-1; - grid-row: 1/3; - } - - #mybibapp_teaser ul { - margin-left:20px; - } - - #mybibapp_teaser li { - list-style: circle; - } - - #mybibapp_teaser div p img { - vertical-align: bottom; - margin-right: 5px - }'; - } - - protected function _iconLink($url, $title, $icon, $width) { - return - $this->_tag('a', - $this->_tag('img', - null, - ['src' => URL_SHARED_IMG . '/mybibapp/' . $icon, - 'width' => $width]), - ['title' => $title, - 'href' => $url, - 'target' => '_blank']); - } - - protected function _renderContent() { - return - $this->_iconLink('https://www.mybibapp.fr', - $this->_('Accéder à la présentation de MyBibApp'), - 'banner_alpha_1024.png', - 300) - . - $this->_iconLink('https://play.google.com/store/apps/details?id=fr.afi_sa.MyBibApp', - $this->_('Télécharger MyBibApp pour Google Android'), - 'mybibapp_android.png', - 150) - . - $this->_iconLink('https://apps.apple.com/fr/app/mybibapp/id1463572666', - $this->_('Télécharger MyBibApp pour Apple iOS'), - 'mybibapp_apple.png', - 150) - . - $this->_tag('div', - $this->_renderDescription()); - } - - - protected function _renderMyBibAppLink() { - return $this->_tag('a', - 'MyBibApp', - ['target' => '_blank', - 'href' => 'https://www.mybibapp.fr']); - } - - - - protected function _renderDescription() { - return - $this->_('%s, application mobile libre et gratuite, permet à vos abonnés d\'accéder aux services de votre réseau :', - $this->_renderMyBibAppLink()) - . - $this->_tag('ul', - implode( - array_map(function($content) { return $this->_tag('li', $content); }, - [ - $this->_('récupération de la liste de ses prêts et réservations'), - $this->_('gestion de plusieurs cartes et comptes (famille, école, ...) au sein d\'une même application'), - $this->_('accéder au site de la médiathèque automatiquement authentifié'), - $this->_('consulter notice et enrichissements (bande-annonce, pré-écoute, ...) d\'un document en scannant son identifiant'), - $this->_('... et plus encore !') - ]))) - . - $this->_tag('p', - $this->_tag('img', null, ['src' => URL_SHARED_IMG . '/buttons/bouton_vert.png']) - . $this->_('Votre portail est compatible !')) - . - $this->_tag('p', - $this->_('Pour référencer votre portail dans %s, ou pour toute information complémentaire, contactez-nous par courriel : ' - . - $this->_tag('a', - 'cial-bib@afi-sa.fr', - ['href' => 'mailto:cial-bib@afi-sa.fr?subject=[MyBibApp] ' . $this->_('Demande d\'informations')]), - $this->_renderMyBibAppLink())); - } -} \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/IndexControllerTest.php b/tests/application/modules/admin/controllers/IndexControllerTest.php index bd899537a5a..ddfc63928ba 100644 --- a/tests/application/modules/admin/controllers/IndexControllerTest.php +++ b/tests/application/modules/admin/controllers/IndexControllerTest.php @@ -43,11 +43,12 @@ abstract class Admin_IndexControllerTestCase extends Admin_AbstractControllerTes class Admin_IndexControllerWithHTTPSTest extends Admin_IndexControllerTestCase { + /** @test */ - public function pageShouldDisplayMyBibAppTeaser() { + public function pageShouldntDisplayMyBibAppTeaserAnymore() { $_SERVER['HTTPS'] = 'on'; $this->dispatch('/admin/index/index', true); - $this->assertXPath('//div[@id="mybibapp_teaser"]'); + $this->assertNotXPath('//div[@id="mybibapp_teaser"]'); } @@ -146,12 +147,6 @@ class Admin_IndexControllerTest extends Admin_IndexControllerTestCase { } - /** @test */ - public function withoutHTTPSShouldNotDisplayMyBibAppTeaser() { - $this->assertNotXPath('//div[@id="mybibapp_teaser"]'); - } - - /** @test */ public function fileBokeh74ShouldBeLoaded() { $this->assertXPath('//link[contains(@href, "bokeh74/global.css")]'); @@ -909,4 +904,4 @@ class Admin_IndexControllerDispatchWithNoFixturesMyOpacTest extends Admin_Abstra public function threeLinksShouldBePresent() { $this->assertXPathCount(3, '//div[@class="modules"]//div[@class="test_my_opac"]/ul/li/a'); } -} \ No newline at end of file +} -- GitLab