Skip to content
Snippets Groups Projects
Commit 64910741 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

hotline #80642 : remove Lekiosk resources preview

parent 38ba697c
Branches
Tags
3 merge requests!2869Master,!2852Hotline,!2847hotline #80642 : remove Lekiosk resources preview
Pipeline #5083 passed with stage
in 46 minutes and 59 seconds
- ticket #80642 : Lekiosk : à la demande expresse de ce fournisseur, suppression de la prévisualisation dans la vue d'une notice Lekiosk
\ No newline at end of file
......@@ -26,21 +26,27 @@ class Lekiosk_View_Helper_Album extends ZendAfi_View_Helper_TagRessourceNumeriqu
$this->_album = $album;
$this->_config = Lekiosk_Config::getInstance();
return $this->_tag('p', $this->_renderSSOLink()) . $this->_renderPreview();
$link = $this->canAccessRessourceNumerique()
? $this->_renderAccessLink()
: $this->_renderNoAccessLink();
return $this->_tag('p', $link);
}
protected function _renderSSOLink() {
if (!$this->canAccessRessourceNumerique())
return $this->view
->tagAnchor($this->view->url(['module' => 'opac',
'controller' => 'modules',
'action' => 'lekiosk',
'album_id' => $this->_album->getId()],
null, true),
$this->_('Vous devez être connecté sous un compte avec abonnement valide pour lire le magazine'),
['class' => 'bouton']);
protected function _renderNoAccessLink() {
return $this->view
->tagAnchor($this->view->url(['module' => 'opac',
'controller' => 'modules',
'action' => 'lekiosk',
'album_id' => $this->_album->getId()],
null, true),
$this->_('Vous devez être connecté sous un compte avec abonnement valide pour lire le magazine'),
['class' => 'bouton']);
}
protected function _renderAccessLink() {
return $this->view
->tagAnchor($this->_config->getSsoUrl(Class_Users::getIdentity(), $this->_album),
$this->_('Lire le magazine %s sur le site LeKiosk',
......@@ -50,28 +56,6 @@ class Lekiosk_View_Helper_Album extends ZendAfi_View_Helper_TagRessourceNumeriqu
}
protected function _renderPreview() {
return $this->_tag('div',
$this->_tag('iframe',
'',
['src' => sprintf('https://www2.lekiosk.com/fr/reader/%s/%s',
$this->_album->getIdOrigine(),
$this->_getIdFromCoverUrl()),
'width' => '100%',
'height' => '860px',
'style' => 'margin-top: -60px']),
['style' => 'overflow: hidden; height: 800px; margin-top: 2em']);
}
protected function _getIdFromCoverUrl() {
preg_match('|.*/Publications/([0-9]+)/([0-9]+)/Images.*|',
$this->_album->getPoster(),
$matches);
return $matches[2];
}
protected function hasRightAccesRessourcesNumeriques($user) {
return $this->_config->hasRightAccess($user);
}
......
......@@ -15,7 +15,7 @@
* 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
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
......@@ -409,14 +409,6 @@ class LekioskRenderAlbumFromRecordTest extends LekioskServiceTestCase {
}
/** @test */
public function iframeSrcForPreviewShouldBeReader851749_1962566() {
$this->_dispatchAlbum();
$this->assertXPath('//iframe[@src="https://www2.lekiosk.com/fr/reader/851749/1962566"]',
$this->_response->getBody());
}
/** @test */
public function withoutRightsShouldDisplayErrorMessage() {
ZendAfi_Auth::getInstance()->clearIdentity();
......@@ -647,14 +639,6 @@ class LekioskServiceHttpHarvestingNoticeAjaxTest extends LekioskServiceHttpHarve
}
/** @test */
public function iframeSrcForPreviewShouldBeReader851749_1962566() {
$this->_dispatchAlbum();
$this->assertXPath('//iframe[@src="https://www2.lekiosk.com/fr/reader/851749/2052615"]',
$this->_response->getBody());
}
/** @test */
public function withoutRightsShouldDisplayErrorMessage() {
ZendAfi_Auth::getInstance()->clearIdentity();
......
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