Skip to content
Snippets Groups Projects
Commit b5d68a92 authored by efalcy's avatar efalcy
Browse files

dev #75244 : add sso url for album and display messages on resnumerique

parent 81190f45
Branches
Tags
3 merge requests!2684Master,!2681Dev#75244 connecteur les yeux du doc les yeux du doc,!2666Dev#75244 connecteur les yeux du doc les yeux du doc
Pipeline #4228 failed with stage
in 34 minutes and 11 seconds
......@@ -45,8 +45,7 @@ class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNu
$json['actors'] : [])
->addDuration($json['duration'])
->addMedias(isset($json['medias']) ? $json['medias'] : [])
->addThemes($json['themes'])
;
->addThemes($json['themes']);
if (isset($json['genres']))
$this->setGenres($json['genres']);
......@@ -100,7 +99,6 @@ class Class_WebService_BibNumerique_ArteVOD_Film extends Class_WebService_BibNu
return $album->beArteVOD();
}
public function fillAlbum($album) {
$this->setTypeDoc($album)
->setDuration($this->duration.' mn')
......
......@@ -53,7 +53,12 @@ class LesYeuxDoc_Config extends Class_DigitalResource_Config {
}
public function getSsoUrl($user) {
public function getAlbumSsoUrl($user,$album) {
return $this->getSSoUrl($user,$album);
}
public function getSsoUrl($user,$album = null) {
if (!$id_abon = $user->getIdabon())
$id_abon = $user->getId();
......@@ -68,7 +73,8 @@ class LesYeuxDoc_Config extends Class_DigitalResource_Config {
'email' => $user->getMail(),
'dnaiss' => $user->getNaissance(),
'datout' => $user->getDateFin(),
'return_url' => 'https://www.lesyeuxdoc.fr'];
'return_url' => $album ? $album->getExternalUri() :
$this->getConfig()['url']];
return $this->getAdminVar('SSO_URL')
. '?'
......@@ -77,7 +83,8 @@ class LesYeuxDoc_Config extends Class_DigitalResource_Config {
public function getHarvestUrl($page = 1) {
$artevod = new Class_WebService_BibNumerique_ArteVOD;
// if ($page>1)
// return '';
return $this->getAdminVar('CATALOG_URL')
. '?'
. http_build_query(['page_nb' => $page,
......
<?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 LesYeuxDoc_View_Helper_Album extends Class_DigitalResource_AlbumViewHelper {}
\ No newline at end of file
......@@ -137,8 +137,6 @@ class LesYeuxDocModuleTest extends AbstractControllerTestCase {
}
}
class LesYeuxDocHarvestTest extends ModelTestCase {
......@@ -279,7 +277,7 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
/** @test */
public function urlOrigineShouldBeSetToUrl() {
$this->assertEquals('http://lesyeuxdoc.com',Class_Album::find(1)->getUrlOrigine());
$this->assertEquals('https://www.lesyeuxdoc.fr/api/v1/films',Class_Album::find(1)->getUrlOrigine());
}
/** @test */
......@@ -295,7 +293,7 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
public function withoutUserConnectionLinkToModuleShouldIndicateToConnect() {
ZendAfi_Auth::getInstance()->clearIdentity();
$this->dispatch('/noticeajax/resnumeriques/id/1', true);
$this->assertXPathContentContains('//a[contains(@href, "modules/les-yeux-doc")]', 'Vous devez ',$this->_response->getBody());
$this->assertXPathContentContains('//a[contains(@href, "modules/les-yeux-doc")]', utf8_encode('Accéder à '),$this->_response->getBody());
}
......@@ -303,7 +301,7 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
public function withUserConnectedLinkToModuleShouldIndicateAccessDigitalResource() {
(new LesYeuxDocFixtures())->logValidUser();
$this->dispatch('/noticeajax/resnumeriques/id/1', true);
$this->assertXPathContentContains('//a[@href= "/modules/les-yeux-doc/album_id/1"]', ' "Destination Paradise" dans un nouvel onglet',$this->_response->getBody());
$this->assertXPathContentContains('//a[@href="/modules/les-yeux-doc/album_id/1"]', utf8_encode('Accéder à "Jean-Philippe Toussaint" dans un nouvel onglet'),$this->_response->getBody());
}
......@@ -311,7 +309,7 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
public function modulesLesYeuxDocWithAlbumidShouldRedirectToLesYeuxDoc() {
(new LesYeuxDocFixtures())->logValidUser();
$this->dispatch('/modules/les-yeux-doc/album_id/1', true);
$this->assertXPathContentContains('//script', 'https://www.lesyeuxdoc.fr/film/682/jean-philippe-toussaint', $this->_response->getBody());
$this->assertXPathContentContains('//script', 'return_url=https%3A%2F%2Fwww.lesyeuxdoc.fr%2Ffilm%2F682%2Fjean-philippe-toussaint"');
}
......@@ -340,7 +338,7 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
$this->logValidUserNotAllowed();
$this->dispatch('/noticeajax/resnumeriques?id_notice=1', true);
$this->assertXPathContentContains('//p', utf8_encode('Votre abonnement ne permet pas d\'accéder à la ressource. Merci de contacter la médiathèque.'));
$this->assertXPathContentContains('//p', utf8_encode('Votre abonnement ne permet pas d\'accéder à la ressource. Merci de contacter la médiathèque.'), $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