Commit a4c039c5 authored by Ghislain Loas's avatar Ghislain Loas

Merge branch 'dev#85748_activation_des_features_80' into 'master'

Dev#85748 activation des features 80

See merge request !2987
parents 13bd2bf2 ccacfa30
Pipeline #6189 passed with stage
in 31 minutes and 38 seconds
- ticket #85748 : Administration : activation des fonctionnalités de la version 8.0 Suricate Semantic.
\ No newline at end of file
<?php
(new Class_Migration_BokehHeight)->run();
\ No newline at end of file
...@@ -262,9 +262,9 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ...@@ -262,9 +262,9 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
['name' => 'site_url', 'label' => $this->_('Url de recherche')] ]]]), ['name' => 'site_url', 'label' => $this->_('Url de recherche')] ]]]),
'NOM_DOMAINE' => Class_AdminVar_Meta::newDefault($this->_('Nom de domaine principal de l\'OPAC, ex: monopac.macommune.fr')), 'NOM_DOMAINE' => Class_AdminVar_Meta::newDefault($this->_('Nom de domaine principal de l\'OPAC, ex: monopac.macommune.fr')),
'CUSTOM_SEARCH_FORM' => Class_AdminVar_Meta::newOnOff($this->_('Activer les formulaires de recherche configurables'))->bePrivate(), 'CUSTOM_SEARCH_FORM' => Class_AdminVar_Meta::newOnOff($this->_('Activer les formulaires de recherche configurables'))->enable(),
'ENABLE_SEARCH_MULTIPLE_RECORD_SELECTION' => Class_AdminVar_Meta::newOnOff($this->_('Activer la sélection multiple de notices dans le résultat de recherche')), 'ENABLE_SEARCH_MULTIPLE_RECORD_SELECTION' => Class_AdminVar_Meta::newOnOff($this->_('Activer la sélection multiple de notices dans le résultat de recherche')),
'AUTHOR_PAGE' => Class_AdminVar_Meta::newOnOff($this->_('Activer les fiches auteurs, tous les liens de recherche vers un auteur basculeront sur la fiche auteur')), 'AUTHOR_PAGE' => Class_AdminVar_Meta::newOnOff($this->_('Activer les fiches auteurs, tous les liens de recherche vers un auteur basculeront sur la fiche auteur'))->enable(),
]; ];
} }
...@@ -310,7 +310,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ...@@ -310,7 +310,7 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'FORCE_HTTPS' => Class_AdminVar_Meta::newOnOff($this->_('Forcer l\'accès au site par le protocole HTTPS. Nécessite l\'installation et la configuration appropriée du serveur Web')), 'FORCE_HTTPS' => Class_AdminVar_Meta::newOnOff($this->_('Forcer l\'accès au site par le protocole HTTPS. Nécessite l\'installation et la configuration appropriée du serveur Web')),
'LOGIN_THROUGH_SIGB_ONLY' => Class_AdminVar_Meta::newOnOff($this->_('Les abonné.e.s peuvent se connecter uniquement via le webservice du SIGB.') 'LOGIN_THROUGH_SIGB_ONLY' => Class_AdminVar_Meta::newOnOff($this->_('Les abonné.e.s peuvent se connecter uniquement via le webservice du SIGB.')
. '<br/>' . '<br/>'
. $this->_('De plus, à la connexion, l\'enregistrement des mots de passes des abonnés est désactivé.'))->bePrivate(), . $this->_('De plus, à la connexion, l\'enregistrement des mots de passes des abonnés est désactivé.')),
'OAUTH_ACCEPT_HTTP' => Class_AdminVar_Meta::newOnOff($this->_('Autoriser l\'accès aux API OAUTH via HTTP (non sécurisé - déconseillé)'), ['value' => 0]), 'OAUTH_ACCEPT_HTTP' => Class_AdminVar_Meta::newOnOff($this->_('Autoriser l\'accès aux API OAUTH via HTTP (non sécurisé - déconseillé)'), ['value' => 0]),
'NB_AFFICH_AVIS_PAR_AUTEUR' => Class_AdminVar_Meta::newDefault($this->_('Nombre d\'avis maximum à afficher par utilisateur.')), 'NB_AFFICH_AVIS_PAR_AUTEUR' => Class_AdminVar_Meta::newDefault($this->_('Nombre d\'avis maximum à afficher par utilisateur.')),
'REGISTER_OK' => Class_AdminVar_Meta::newEncodedData($this->_('Texte visible par l\'internaute après son inscription.')), 'REGISTER_OK' => Class_AdminVar_Meta::newEncodedData($this->_('Texte visible par l\'internaute après son inscription.')),
...@@ -367,9 +367,9 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ...@@ -367,9 +367,9 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'STATUS_REPORT_PUSH_URL' => Class_AdminVar_Meta::newRawText($this->_('URL destinataire du rapport d\'état du système (0 pour désactiver)'), ['value' => 'http://pola.afi-sa.net/smile.php'])->bePrivate(), 'STATUS_REPORT_PUSH_URL' => Class_AdminVar_Meta::newRawText($this->_('URL destinataire du rapport d\'état du système (0 pour désactiver)'), ['value' => 'http://pola.afi-sa.net/smile.php'])->bePrivate(),
'STATUS_REPORT_TAGS' => Class_AdminVar_Meta::newMultiInput($this->_('Liste des tags à ajouter au rapport d\'état du système'))->bePrivate(), 'STATUS_REPORT_TAGS' => Class_AdminVar_Meta::newMultiInput($this->_('Liste des tags à ajouter au rapport d\'état du système'))->bePrivate(),
'FEATURES_TRACKING_ENABLE' => Class_AdminVar_Meta::newOnOff('Affiche les dernières modifications apportés au logiciel Bokeh', ['value' => 1]), 'FEATURES_TRACKING_ENABLE' => Class_AdminVar_Meta::newOnOff('Affiche les dernières modifications apportés au logiciel Bokeh', ['value' => 1]),
'INSPECTOR_GADGET_MARC_XML' => Class_AdminVar_Meta::newOnOff('Affiche le MARC XML de la notice dans Inspector Gadget'), 'INSPECTOR_GADGET_MARC_XML' => Class_AdminVar_Meta::newOnOff('Affiche le MARC XML de la notice dans Inspector Gadget')->enable(),
'BUSINESS_EMAIL' => Class_AdminVar_Meta::newDefault($this->_('Email utilisé pour les demandes d\'accompagnement de mise en place ou d\'utilisation des fonctionnalités du logiciel'), ['value' => 'cial-bib@afi-sa.fr'])->bePrivate(), 'BUSINESS_EMAIL' => Class_AdminVar_Meta::newDefault($this->_('Email utilisé pour les demandes d\'accompagnement de mise en place ou d\'utilisation des fonctionnalités du logiciel'), ['value' => 'cial-bib@afi-sa.fr'])->bePrivate(),
'CODIFICATION_BROWSER' => Class_AdminVar_Meta::newOnOff($this->_('Activer l\'outil de parcours des codifications')), 'CODIFICATION_BROWSER' => Class_AdminVar_Meta::newOnOff($this->_('Activer l\'outil de parcours des codifications'))->enable(),
'TEMPLATING' => Class_AdminVar_Meta::newOnOff('Active l\'accès au magasin de thèmes', 'TEMPLATING' => Class_AdminVar_Meta::newOnOff('Active l\'accès au magasin de thèmes',
['value' => 0])->bePrivate(), ['value' => 0])->bePrivate(),
'GENERATION_SITE' => Class_AdminVar_Meta::newOnOff($this->_('Activation de la génération de site.')), 'GENERATION_SITE' => Class_AdminVar_Meta::newOnOff($this->_('Activation de la génération de site.')),
...@@ -992,6 +992,11 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ...@@ -992,6 +992,11 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
} }
public function isAuthorPageEnabled() {
return Class_AdminVar::isModuleEnabled('AUTHOR_PAGE');
}
public function shouldKeepLastSigbRecord() { public function shouldKeepLastSigbRecord() {
return Class_AdminVar::isModuleEnabled('KEEP_LAST_SIGB_RECORD'); return Class_AdminVar::isModuleEnabled('KEEP_LAST_SIGB_RECORD');
} }
......
...@@ -161,6 +161,12 @@ class Class_AdminVar_Meta { ...@@ -161,6 +161,12 @@ class Class_AdminVar_Meta {
} }
public function setValue($value) {
$this->_attributes['value'] = $value;
return $this;
}
public function bePrivate() { public function bePrivate() {
$this->_attributes['role_level'] = ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN; $this->_attributes['role_level'] = ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN;
return $this; return $this;
...@@ -170,4 +176,12 @@ class Class_AdminVar_Meta { ...@@ -170,4 +176,12 @@ class Class_AdminVar_Meta {
public function isPrivate() { public function isPrivate() {
return ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN == $this->getAttribute('role_level', null); return ZendAfi_Acl_AdminControllerRoles::SUPER_ADMIN == $this->getAttribute('role_level', null);
} }
public function enable() {
if (! $this->isOnOff())
return $this;
return $this->setValue(1);
}
} }
\ No newline at end of file
...@@ -115,7 +115,14 @@ class Class_CosmoVar extends Storm_Model_Abstract { ...@@ -115,7 +115,14 @@ class Class_CosmoVar extends Storm_Model_Abstract {
$_table_name = 'variables', $_table_name = 'variables',
$_table_primary = 'clef', $_table_primary = 'clef',
$_loader_class = 'Class_CosmoVarLoader', $_loader_class = 'Class_CosmoVarLoader',
$_fixed_id = true; $_fixed_id = true,
$_default_attribute_values = ['commentaire' => '',
'type_champ' => 0,
'liste' => '',
'groupe' => 0,
'ordre' => 0,
'verrou' => '',
'hidden' => 0];
public static function get($name) { public static function get($name) {
......
...@@ -48,7 +48,7 @@ class IntBibLoader extends Storm_Model_Loader { ...@@ -48,7 +48,7 @@ class IntBibLoader extends Storm_Model_Loader {
} }
public function isSingleNanook($patrons_closure = null) { public function isSingleNanook() {
return (new Class_IntBib_SingleNanook())->isSingle(Class_IntBib::findAll()); return (new Class_IntBib_SingleNanook())->isSingle(Class_IntBib::findAll());
} }
...@@ -58,6 +58,11 @@ class IntBibLoader extends Storm_Model_Loader { ...@@ -58,6 +58,11 @@ class IntBibLoader extends Storm_Model_Loader {
} }
public function isSingleKoha() {
return (new Class_IntBib_SingleKoha())->isSingle(Class_IntBib::findAll());
}
public function findAllNanookWithPreRegistration() { public function findAllNanookWithPreRegistration() {
$collection = new Storm_Model_Collection(Class_IntBib::findAll()); $collection = new Storm_Model_Collection(Class_IntBib::findAll());
$combo = $collection $combo = $collection
...@@ -109,6 +114,7 @@ class Class_IntBib extends Storm_Model_Abstract { ...@@ -109,6 +114,7 @@ class Class_IntBib extends Storm_Model_Abstract {
const SIGB_PERGAME = 1; const SIGB_PERGAME = 1;
const SIGB_KOHA = 12; const SIGB_KOHA = 12;
const SIGB_NANOOK = 13; const SIGB_NANOOK = 13;
const SIGB_ORPHEE = 3;
const TYPE = 'type'; const TYPE = 'type';
const URL_SERVER = 'url_server'; const URL_SERVER = 'url_server';
...@@ -308,6 +314,11 @@ class Class_IntBib extends Storm_Model_Abstract { ...@@ -308,6 +314,11 @@ class Class_IntBib extends Storm_Model_Abstract {
} }
public function isKoha() {
return static::SIGB_KOHA == $this->getSigb();
}
public function isCommKoha() { public function isCommKoha() {
return Class_IntBib::COM_KOHA == $this->getCommSigb(); return Class_IntBib::COM_KOHA == $this->getCommSigb();
} }
......
<?php
/**
* Copyright (c) 2012-2019, 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 Class_IntBib_SingleKoha extends Class_IntBib_SingleSigb {
protected function _isSigb($library) {
return $library->isKoha();
}
}
\ No newline at end of file
...@@ -20,42 +20,8 @@ ...@@ -20,42 +20,8 @@
*/ */
class Class_Intbib_SingleNanook { class Class_IntBib_SingleNanook extends Class_IntBib_SingleSigb {
protected $_server = null; protected function _isSigb($library) {
return $library->isNanook();
public function isSingle($models) {
if(!$models)
return false;
$this->_server = null;
foreach($models as $library) {
if (!$this->_isLibraryNanook($library))
return false;
}
return true;
}
public function isSinglePatrons($models) {
$aCollection = (new Storm_Model_Collection($models))
->select(function($model)
{
return $model->hasPatronImport();
});
return $this->isSingle($aCollection->getArrayCopy());
}
protected function _isLibraryNanook($library) {
if (!$library->isNanook())
return false;
if (null == $this->_server) {
$this->_server = $library->getUrlServer();
return true;
}
return $this->_server == $library->getUrlServer();
} }
} }
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2019, 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
*/
abstract class Class_IntBib_SingleSigb {
protected $_server = null;
public function isSingle($models) {
if(!$models)
return false;
$this->_server = null;
foreach($models as $library) {
if (!$this->_isSigbAndSameServer($library))
return false;
}
return true;
}
public function isSinglePatrons($models) {
$aCollection = (new Storm_Model_Collection($models))
->select(function($model)
{
return $model->hasPatronImport();
});
return $this->isSingle($aCollection->getArrayCopy());
}
protected function _isSigbAndSameServer($library) {
if (!$this->_isSigb($library))
return false;
if (null == $this->_server) {
$this->_server = $library->getUrlServer();
return true;
}
return $this->_server == $library->getUrlServer();
}
abstract protected function _isSigb($library);
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2019, 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 Class_Migration_BokehHeight {
use Trait_Translator;
public function run() {
Class_AdminVar::set('CODIFICATION_BROWSER', 1);
Class_AdminVar::set('INSPECTOR_GADGET_MARC_XML', 1);
Class_AdminVar::set('CUSTOM_SEARCH_FORM', 1);
Class_AdminVar::set('AUTHOR_PAGE', 1);
$this
->_manageLoginThroughSigbOnly()
->_fixCosmoVarDateMajAlbums();
}
protected function _manageLoginThroughSigbOnly() {
if (Class_IntBib::isSingleNanook() || Class_IntBib::isSingleKoha())
Class_AdminVar::set('LOGIN_THROUGH_SIGB_ONLY', 1);
return $this;
}
protected function _fixCosmoVarDateMajAlbums() {
if (!$model = Class_CosmoVar::find('date_maj_albums'))
$model = Class_CosmoVar::newInstance()
->setClef('date_maj_albums');
$model
->setCommentaire($this->_('Dernière date de mise à jour des albums.'))
->setGroupe(6)
->save();
}
}
\ No newline at end of file
...@@ -59,8 +59,9 @@ class ZendAfi_View_Helper_AdvancedSearch extends ZendAfi_View_Helper_BaseHelper ...@@ -59,8 +59,9 @@ class ZendAfi_View_Helper_AdvancedSearch extends ZendAfi_View_Helper_BaseHelper
protected function _renderDefaultAdvancedSearch() { protected function _renderDefaultAdvancedSearch() {
return $this->view->renderForm($this->_defaultAdvancedSearch(), $form_id = 'advanced_form';
['append' => [$this->_clearFormButton()]]); return $this->view->renderForm($this->_defaultAdvancedSearch($form_id),
['append' => [$this->_clearFormButton($form_id)]]);
} }
...@@ -77,8 +78,8 @@ class ZendAfi_View_Helper_AdvancedSearch extends ZendAfi_View_Helper_BaseHelper ...@@ -77,8 +78,8 @@ class ZendAfi_View_Helper_AdvancedSearch extends ZendAfi_View_Helper_BaseHelper
} }
protected function _defaultAdvancedSearch() { protected function _defaultAdvancedSearch($form_id) {
return $this->_populateForm((new ZendAfi_Form_AdvancedSearch)->loadDefaults()); return $this->_populateForm((new ZendAfi_Form_AdvancedSearch)->loadDefaults(), $form_id);
} }
......
...@@ -525,7 +525,7 @@ abstract class DiMusicRechercheControllerTestCase extends AbstractControllerTest ...@@ -525,7 +525,7 @@ abstract class DiMusicRechercheControllerTestCase extends AbstractControllerTest
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$this->_prepareFixtures(); $this->_prepareFixtures();
$bridges = $this->fixture('Class_Album', $bridges = $this->fixture('Class_Album',
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# -- # --
<?php <?php
/** /**
* Copyright (c) 2012-2018, Agence Française Informatique (AFI). All rights reserved. * Copyright (c) 2012-2019, Agence Française Informatique (AFI). All rights reserved.
* *
* BOKEH is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
...@@ -28,4 +28,3 @@ class ${class_name} { ...@@ -28,4 +28,3 @@ class ${class_name} {
$0 $0
} }
} }
?>
\ No newline at end of file
...@@ -103,6 +103,7 @@ abstract class AbonneControllerLoansHistoryNanookTestCase extends AbstractContro ...@@ -103,6 +103,7 @@ abstract class AbonneControllerLoansHistoryNanookTestCase extends AbstractContro
class AbonneControllerLoansHistoryNanookIndexTest extends AbonneControllerLoansHistoryNanookTestCase { class AbonneControllerLoansHistoryNanookIndexTest extends AbonneControllerLoansHistoryNanookTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$this->dispatch('/abonne/loans-history',true); $this->dispatch('/abonne/loans-history',true);
} }
......
...@@ -276,6 +276,9 @@ class AbonneControllerPretsExportThreePretsTest extends AbonneControllerPretsLis ...@@ -276,6 +276,9 @@ class AbonneControllerPretsExportThreePretsTest extends AbonneControllerPretsLis
class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListThreePretsTestCase { class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListThreePretsTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$this->fixture('Class_CodifAuteur', $this->fixture('Class_CodifAuteur',
['id' => 565, ['id' => 565,
'libelle' => 'QUINROSE']); 'libelle' => 'QUINROSE']);
...@@ -594,6 +597,7 @@ abstract class AbonneControllerPretsListReservationTestCase extends AbstractAbon ...@@ -594,6 +597,7 @@ abstract class AbonneControllerPretsListReservationTestCase extends AbstractAbon
class AbonneControllerPretsListReservationTest extends AbonneControllerPretsListReservationTestCase { class AbonneControllerPretsListReservationTest extends AbonneControllerPretsListReservationTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$this->dispatch('/opac/abonne/reservations', true); $this->dispatch('/opac/abonne/reservations', true);
} }
...@@ -641,7 +645,7 @@ class AbonneControllerPretsListReservationTest extends AbonneControllerPretsList ...@@ -641,7 +645,7 @@ class AbonneControllerPretsListReservationTest extends AbonneControllerPretsList
} }
/** @test */ /** @test */
public function authorShouldBeRowlingAndLinkSearch() { public function authorShouldBeRowlingAndLinkSearch() {
$this->assertXPathContentContains('//tbody/tr[1]//td//a[@href="/recherche/simple/code_rebond/A456/retour_abonne/reservations"]', $this->assertXPathContentContains('//tbody/tr[1]//td//a[@href="/recherche/simple/code_rebond/A456/retour_abonne/reservations"]',
'JOANNE KATHLEEN ROWLING', 'JOANNE KATHLEEN ROWLING',
......
...@@ -172,7 +172,7 @@ class NoticeAjaxControllerNoticeSimilairesSouleymaneTest extends NoticeAjaxContr ...@@ -172,7 +172,7 @@ class NoticeAjaxControllerNoticeSimilairesSouleymaneTest extends NoticeAjaxContr
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
Class_Notice::newInstanceWithId(18787, Class_Notice::newInstanceWithId(18787,
['titres' => 'IRM SOULEY', ['titres' => 'IRM SOULEY',
'auteurs' => 'MOI', 'auteurs' => 'MOI',
......
...@@ -304,6 +304,8 @@ class RechercheControllerViewNoticeWithPreferencesTest extends RechercheControll ...@@ -304,6 +304,8 @@ class RechercheControllerViewNoticeWithPreferencesTest extends RechercheControll
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$time_source = new TimeSourceForTest('2013-12-27 09:00:00'); $time_source = new TimeSourceForTest('2013-12-27 09:00:00');
Class_Notice::setTimeSource($time_source); Class_Notice::setTimeSource($time_source);
...@@ -561,6 +563,7 @@ class RechercheControllerViewNoticeWithPreferencesTest extends RechercheControll ...@@ -561,6 +563,7 @@ class RechercheControllerViewNoticeWithPreferencesTest extends RechercheControll
class RechercheControllerViewNoticeTest extends RechercheControllerNoticeTestCase { class RechercheControllerViewNoticeTest extends RechercheControllerNoticeTestCase {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
Class_AdminVar::set('AUTHOR_PAGE', 0);
$this->dispatch('recherche/viewnotice/id/345', true); $this->dispatch('recherche/viewnotice/id/345', true);
} }
...@@ -572,16 +575,19 @@ class RechercheControllerViewNoticeTest extends RechercheControllerNoticeTestCas ...@@ -572,16 +575,19 @@ class RechercheControllerViewNoticeTest extends RechercheControllerNoticeTestCas
$this->_response->getBody()); $this->_response->getBody());
} }
/** @test */ /** @test */
public function pageShouldContainsOnlyTwoH1() { public function pageShouldContainsOnlyTwoH1() {
$this->assertXPathCount('//h1', 2, $this->_response->getBody()); $this->assertXPathCount('//h1', 2, $this->_response->getBody());
} }
/** @test */ /** @test */
public function pageShouldContainsH1WithTitleAndAuthor() { public function pageShouldContainsH1WithTitleAndAuthor() {
$this->assertXPath('//h1//span[contains(text(), "Cinéma d\'animation")][following-sibling::span[text()="Bernard Génin"]]'); $this->assertXPath('//h1//span[contains(text(), "Cinéma d\'animation")][following-sibling::span[text()="Bernard Génin"]]');
} }
/** @test */ /** @test */
public function tagReseauSociauxShouldBePresent() { public function tagReseauSociauxShouldBePresent() {
$this->assertXPath('//div[@id="reseaux-sociaux"]'); $this->assertXPath('//div[@id="reseaux-sociaux"]');
......
...@@ -2455,4 +2455,13 @@ class UpgradeDB_364_Test extends UpgradeDBTestCase { ...@@ -2455,4 +2455,13 @@ class UpgradeDB_364_Test extends UpgradeDBTestCase {
public function articlesCategoriesShouldBePresent() { public function articlesCategoriesShouldBePresent() {
$this->assertColumn('newsletters', 'articles_categories_ids'); $this->assertColumn('newsletters', 'articles_categories_ids');
} }
} }
\ No newline at end of file
class UpgradeDB_365_Test extends UpgradeDBTestCase {
public function prepare() {}
/** @test */
public function placeholderForBokehHeightMigration() {}
}
<?php
/**
* Copyright (c) 2012-2019, 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 Class_Migration_BokehHeightTest extends ModelTestCase {
/** @test */
public function codificationBrowserShouldBecomeEnabled() {
Class_AdminVar::set('CODIFICATION_BROWSER', 0);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isCodificationBrowserEnabled());
}
/** @test */
public function codificationBrowserDefaultShouldBeEnabled() {
$this->assertTrue(Class_AdminVar::isCodificationBrowserEnabled());
}
/** @test */
public function inspectorGadgetMarcXMLShouldBecomeEnabled() {
Class_AdminVar::set('INSPECTOR_GADGET_MARC_XML', 0);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isInspectorGadgetMarcXmlEnabled());
}
/** @test */
public function inspectorGadgetMarcXMLShouldBeEnabled() {
$this->assertTrue(Class_AdminVar::isInspectorGadgetMarcXmlEnabled());
}
/** @test */
public function customSearchFormShouldBecomeEnabled() {
Class_AdminVar::set('CUSTOM_SEARCH_FORM', 0);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isCustomSearchFormEnabled());
}
/** @test */
public function customSearchFormShouldBeEnabled() {
$this->assertTrue(Class_AdminVar::isCustomSearchFormEnabled());
}
/** @test */
public function authorPageShouldBecomeEnabled() {
Class_AdminVar::set('AUTHOR_PAGE', 0);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isAuthorPageEnabled());
}
/** @test */
public function authorPageShouldBeEnabled() {
$this->assertTrue(Class_AdminVar::isAuthorPageEnabled());
}
/** @test */
public function withSingleKohaLoginThroughSigbOnlyShouldBecomeEnabled() {
Class_AdminVar::set('LOGIN_THROUGH_SIGB_ONLY', 0);
$this->fixture('Class_Intbib',
['id' => 4,
'sigb' => Class_IntBib::SIGB_KOHA,
'comm_params' => ['url_serveur' => 'https://service.local']]);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isLoginThroughSigbOnlyEnabled());
}
/** @test */
public function withSingleNanookLoginThroughSigbOnlyShouldBecomeEnabled() {
Class_AdminVar::set('LOGIN_THROUGH_SIGB_ONLY', 0);
$this->fixture('Class_Intbib',
['id' => 4,
'sigb' => Class_IntBib::SIGB_NANOOK,
'comm_params' => ['url_serveur' => 'https://service.local']]);
(new Class_Migration_BokehHeight)->run();
$this->assertTrue(Class_AdminVar::isLoginThroughSigbOnlyEnabled());
}