Skip to content
Snippets Groups Projects
Commit 5e6056ac authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #77068 : first commit for Orthodidacte Dashboard + migration

parent b0707b71
Branches
Tags
2 merge requests!2746Hotline,!2725Hotline#77068 orthodidacte probleme de connexion suite changement de mot de passe
Pipeline #4545 failed with stage
in 41 minutes and 31 seconds
- ticket #77068 : Orthodidacte : problème de connexion suite changement de mot de passe ?
\ No newline at end of file
<?php
(new Class_Migration_DigitalResource_Orthodidacte)->run();
\ No newline at end of file
......@@ -212,8 +212,6 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'PLANETNEMO' => Class_AdminVar_Meta::newOnOff($this->_('Activation de la ressource numérique PlanetNemo'))->bePrivate(),
'ORTHODIDACTE' => Class_AdminVar_Meta::newDefault($this->_('Adresse du serveur de la ressource numérique Orthodidacte'))->bePrivate(),
'LECTURA_DOMAIN' => Class_AdminVar_Meta::newDefault($this->_('Domaine utilisée par le serveur lectura pour authentification')),
'KIDILANGUES_VERSION' => Class_AdminVar_Meta::newCombo($this->_('Version de Kidilangues.'),
......
<?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 Class_Migration_DigitalResource_Orthodidacte extends Class_Migration_DigitalResource_Abstract {
protected function _getOldRightToken() {
return 28;
}
protected function _getAdminVarMapping() {
return ['ORTHODIDACTE' => 'Orthodidacte_SSO_URL'];
}
protected function _getConfig() {
return Orthodidacte_Config::getInstance();
}
protected function _getOldMenuName() {
return 'ORTHODIDACTE';
}
protected function _getOldBatchName() {
return '';
}
}
\ No newline at end of file
......@@ -143,7 +143,6 @@ class Class_UserGroup extends Storm_Model_Abstract {
const RIGHT_ACCES_KIDILANGUES = 25;
const RIGHT_ACCES_PNB_DILICOM = 26;
const RIGHT_ACCES_PLANETNEMO = 27;
const RIGHT_ACCESS_ORTHODIDACTE = 28;
const RIGHT_ACCESS_LESOCIAL = 29;
const RIGHT_ACCESS_CITEDELAMUSIQUE = 31;
......@@ -185,7 +184,6 @@ class Class_UserGroup extends Storm_Model_Abstract {
self::RIGHT_ACCES_MYCOW => 'Bibliothèque numérique: accéder à MyCOW.EU',
self::RIGHT_ACCES_PLANETNEMO => 'Bibliothèque numérique: accéder à planetnemo.fr',
self::RIGHT_ACCES_KIDILANGUES => 'Bibliothèque numérique: accéder à Kidilangues',
self::RIGHT_ACCESS_ORTHODIDACTE => 'Bibliothèque numérique: accéder à Orthodidacte.com',
self::RIGHT_ACCESS_LESOCIAL => 'Bibliothèque numérique: accéder à Le Social',
self::RIGHT_ACCESS_CITEDELAMUSIQUE => 'Bibliothèque numérique: accéder à La Cité de la musique',
self::RIGHT_ACCES_PNB_DILICOM => 'Bibliothèque numérique: autoriser le prêt numérique Dilicom',
......
<?php
/**
* Copyright (c) 2012-2017, 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 Orthodidacte_Config extends Class_DigitalResource_Config {
public function getConfig() {
return ['Introduction' => $this->_('Orthodidacte constitue une nouvelle approche pour apprendre l’orthographe et la grammaire de la langue française en ligne.'),
'HelpLink' => 'http://wiki.bokeh-library-portal.org/index.php/Orthodidacte',
'Url' => 'https://www.orthodidacte.com/',
'Icon' => 'http://bokeh-library-portal.org/userfiles/media/ressources_numeriques/logo_orthodidacte_pastille.png',
'SsoAction' => true,
'MenuLabel' => $this->_('Lien vers Orthodidacte'),
'ModuleMenu' => $this->withNameSpace('ModuleMenu'),
'AdminVars' => ['SSO_URL' => Class_AdminVar_Meta::newDefault($this->_('URL SSO de la plateforme Orthodidacte'))->bePrivate()]
];
}
public function isEnabled() {
return $this->getAdminVar('SSO_URL');
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2017, 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 Orthodidacte_Plugin_IndexController extends Class_DigitalResource_Controller {}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012-2017, 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 OrthodicadteDashboardTest extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
/** @test */
public function shouldBeActivated() {
Class_AdminVar::set('Orthodidacte_SSO_URL', 'https://www.orthodidacte.com/');
$this->dispatch('/Orthodidacte_Plugin', true);
$this->assertXPathContentContains('//div', 'Activ');
}
}
class OrthodicadteMigrationTest extends ModelTestCase {
protected
$_storm_default_to_volatile = true,
$_migration;
public function setUp() {
parent::setUp();
Class_DigitalResource::resetInstance();
$cfg_menus = ['H' => ['libelle' => 'Menu horizontal',
'picto' => 'vide.gif',
'menus' => [
['type_menu' => 'MENU',
'libelle' => 'Pratique',
'picto' => 'bookmark.png',
'preferences' => [],
'sous_menus' => [
['type_menu' => 'ACCUEIL',
'libelle' => 'Accueil',
'picto' => 'vide.gif',
'preferences' => [],
'sous_menus' => ''],
['type_menu' => 'ORTHODIDACTE',
'libelle' => 'Lien vers Orthodidacte',
'preferences' => [],
'picto' => 'vide.gif'] ]]]]];
$cfg_menus_without_Orthodidacte = ['H' => ['libelle' => 'Menu horizontal',
'picto' => 'vide.gif',
'menus' => [
['type_menu' => 'MENU',
'libelle' => 'Pratique',
'picto' => 'bookmark.png',
'preferences' => [],
'sous_menus' => [
['type_menu' => 'ACCUEIL',
'libelle' => 'Accueil',
'picto' => 'vide.gif',
'preferences' => [],
'sous_menus' => ''] ]]]]];
$profil_adulte = $this->fixture('Class_Profil',
['id' => 22,
'parent_id' => null])
->setBrowser('opac')
->setLibelle('Profil Adulte')
->setCfgMenus($cfg_menus);
$profil_without_Orthodidacte = $this->fixture('Class_Profil',
['id' => 23,
'rewrite_url' => 'adulte'])
->setBrowser('opac')
->setLibelle('Profil Adulte')
->setCfgMenus($cfg_menus_without_Orthodidacte);
Class_Profil::setCurrentProfil($profil_adulte);
$this->fixture('Class_UserGroup',
['id' => 2,
'libelle' => 'team ONE',
'rights_token' => pow(2, 28)]);
Class_AdminVar::set('ORTHODIDACTE', 'https://orthodidacte.com');
$this->_migration = (new Class_Migration_DigitalResource_Orthodidacte())
->setMemoryCleaner(function(){})
->run();
}
public function tearDown() {
Class_DigitalResource::resetInstance();
parent::tearDown();
}
/** @test */
public function oldAdminVarShouldBeDeleted() {
$this->assertNull(Class_AdminVar::get('ORTHODIDACTE'));
}
/** @test */
public function newAdminVarShouldBeSet() {
$this->assertEquals('https://orthodidacte.com', Class_AdminVar::get('Orthodidacte_SSO_URL'));
}
/** @test */
public function profilMenuShouldContainsOrthodidacte() {
$this->assertEquals('Orthodidacte', Class_Profil::find(22)->getCfgMenusAsArray()['H']['menus'][0]['sous_menus'][1]['type_menu']);
}
/** @test */
public function teamOneShouldHavePermissionOnOrthodidacte() {
if (!$permissions = Class_UserGroup::find(2)->getPermissions())
return $this->fail();
$this->assertEquals('Orthodidacte', array_shift($permissions)->getCode());
}
/** @test */
public function teamOneRightsShouldBeCleaned() {
$this->assertEmpty(Class_UserGroup::find(2)->getRightsToken());
}
}
......@@ -195,17 +195,6 @@
"name" : "",
"url" : "http://www.vodeclic.com/fr/solutions/bibliotheques"}
},
"ORTHODIDACTE": {
"label" : "Orthodidacte",
"enabled": "isOrthodidacteEnabled",
"url" : "http://www.orthodidacte.com/",
"image_url" : "http://bokeh-library-portal.org/userfiles/media/ressources_numeriques/logo_orthodidacte_pastille.png",
"desc": "Orthodidacte constitue une nouvelle approche pour apprendre l’orthographe et la grammaire de la langue française en ligne.",
"features": ["CAS"],
"sales_contact": {"mail" : "",
"name" : "",
"url" : "http://www.orthodidacte.com"}
},
"LESOCIAL": {
"label" : "Le Social",
"enabled": "isLeSocialEnabled",
......
......@@ -2102,4 +2102,13 @@ class UpgradeDB_347_Test extends UpgradeDBTestCase {
public function mailShouldBeVarchar255() {
$this->assertFieldType('bib_admin_users', 'mail', 'varchar(255)');
}
}
class UpgradeDB_348_Test extends UpgradeDBTestCase {
public function prepare() {}
/** @test */
public function placeholderForOrthodidacteMigrationPatch() {}
}
\ No newline at end of file
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