From 8d5cf83934c676fb3b95d44d7c319aa5e87381cc Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@git-test.afi-sa.fr> Date: Mon, 11 Jun 2012 14:41:15 +0000 Subject: [PATCH] ajout options PACK_MOBILE --- .gitattributes | 1 - .../ModulesAccueil/BibliothequeNumerique.php | 6 +++ library/Class/Systeme/ModulesAccueil/News.php | 3 ++ .../View/Helper/Telephone/RechSimple.php | 42 ------------------- .../controllers/IndexControllerTest.php | 30 ++++++++++++- 5 files changed, 38 insertions(+), 44 deletions(-) delete mode 100644 library/ZendAfi/View/Helper/Telephone/RechSimple.php diff --git a/.gitattributes b/.gitattributes index 0d2da5c3450..4e7f37ce2ed 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2038,7 +2038,6 @@ library/ZendAfi/View/Helper/Telephone/Kiosque.php -text library/ZendAfi/View/Helper/Telephone/ListeNotices.php -text library/ZendAfi/View/Helper/Telephone/News.php -text library/ZendAfi/View/Helper/Telephone/Pager.php -text -library/ZendAfi/View/Helper/Telephone/RechSimple.php -text library/ZendAfi/View/Helper/Telephone/Tags/NoticeDetaillee.php -text library/ZendAfi/View/Helper/Telephone/Tags/ResumeAvis.php -text library/ZendAfi/View/Helper/Telephone/Tags/Toolbar.php -text diff --git a/library/Class/Systeme/ModulesAccueil/BibliothequeNumerique.php b/library/Class/Systeme/ModulesAccueil/BibliothequeNumerique.php index 2c009481eb4..0e69056d300 100644 --- a/library/Class/Systeme/ModulesAccueil/BibliothequeNumerique.php +++ b/library/Class/Systeme/ModulesAccueil/BibliothequeNumerique.php @@ -71,5 +71,11 @@ class Class_Systeme_ModulesAccueil_BibliothequeNumerique extends Class_Systeme_M public function getOrderModes() { return $this->_orderModes; } + + + /** @return boolean */ + public function isVisibleForProfil($profil) { + return Class_AdminVar::isBibNumEnabled(); + } } ?> \ No newline at end of file diff --git a/library/Class/Systeme/ModulesAccueil/News.php b/library/Class/Systeme/ModulesAccueil/News.php index 6b90f42cb26..123d2f95c37 100644 --- a/library/Class/Systeme/ModulesAccueil/News.php +++ b/library/Class/Systeme/ModulesAccueil/News.php @@ -37,6 +37,9 @@ class Class_Systeme_ModulesAccueil_News extends Class_Systeme_ModulesAccueil_Nul /** @var bool */ protected $_isPhone = true; + /** @var bool */ + protected $_isPackMobile = false; + /** @var array */ protected $_defaultValues = array( 'titre' => 'Articles', // Titre de la boite diff --git a/library/ZendAfi/View/Helper/Telephone/RechSimple.php b/library/ZendAfi/View/Helper/Telephone/RechSimple.php deleted file mode 100644 index 32516b20b38..00000000000 --- a/library/ZendAfi/View/Helper/Telephone/RechSimple.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. - * - * AFI-OPAC 2.0 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). - * - * AFI-OPAC 2.0 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 AFI-OPAC 2.0; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// OPAC3 - Recherche -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -class ZendAfi_View_Helper_Telephone_RechSimple extends ZendAfi_View_Helper_Accueil_Base { - -//--------------------------------------------------------------------- -// Main routine -//--------------------------------------------------------------------- - public function getHtml() { - $html = sprintf('<form method="post" action="%s" >', $this->view->url(array('controller' => 'recherche', - 'action' => 'simple'))); - - $html .= sprintf('<input data-mini="true" type="search" placeholder="%s" name="expressionRecherche" x-webkit-speech="x-webkit-speech">', - $this->preferences["exemple"]); - - $html .= '</form>'; - - $this->contenu = $html; - return $this->getHtmlArray(); - - } -} \ No newline at end of file diff --git a/tests/application/modules/telephone/controllers/IndexControllerTest.php b/tests/application/modules/telephone/controllers/IndexControllerTest.php index a9ffe0a516d..d4f3e41b318 100644 --- a/tests/application/modules/telephone/controllers/IndexControllerTest.php +++ b/tests/application/modules/telephone/controllers/IndexControllerTest.php @@ -84,13 +84,16 @@ abstract class AbstractIndexControllerTelephoneWithModulesTest extends Telephone -class IndexControllerTelephoneWithoutPackMobileTest extends AbstractIndexControllerTelephoneWithModulesTest { +class IndexControllerTelephoneWithoutPackMobileButBibNumTest extends AbstractIndexControllerTelephoneWithModulesTest { public function setUp() { parent::setUp(); Class_AdminVar::getLoader()->newInstanceWithId('PACK_MOBILE') ->setValeur(0); + Class_AdminVar::getLoader()->newInstanceWithId('BIB_NUMERIQUE') + ->setValeur(1); + $this->dispatch('/', true); } @@ -123,6 +126,31 @@ class IndexControllerTelephoneWithoutPackMobileTest extends AbstractIndexControl public function boiteLoginShouldNotBePresent() { $this->assertNotXPath('//form[contains(@action, "auth/boitelogin")]'); } + + + /** @test */ + function boiteCalendrierShouldNotBePresent() { + $this->assertNotXPathContentContains('//h2', 'Agenda'); + } + + + /** @test */ + function boiteCritiquesShouldNotBePresent() { + $this->assertNotXPathContentContains('//div[@class="titre"]', 'Critiques'); + } + + + /** @test */ + function bibNumeriqueShouldBeVisible() { + $this->assertXPathContentContains('//div[@class="titre"]', 'Mes albums'); + } + + + /** @test */ + function boiteNewsShouldBeVisible() { + $this->assertXPath('//ul[@class="listview-news"]'); + } + } -- GitLab