diff --git a/VERSIONS_HOTLINE/80642 b/VERSIONS_HOTLINE/80642 new file mode 100644 index 0000000000000000000000000000000000000000..3852cc8f526f7eeed0647bcc15b15f266820467c --- /dev/null +++ b/VERSIONS_HOTLINE/80642 @@ -0,0 +1 @@ + - 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 diff --git a/library/digital_resources/Lekiosk/View/Helper/Album.php b/library/digital_resources/Lekiosk/View/Helper/Album.php index 39fc9a6016bb0a6bf7fb2119fcfc1a144c9bf45a..c551ddd3e73a8101d038ede111f701799bfec626 100644 --- a/library/digital_resources/Lekiosk/View/Helper/Album.php +++ b/library/digital_resources/Lekiosk/View/Helper/Album.php @@ -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); } diff --git a/library/digital_resources/Lekiosk/tests/LekioskTest.php b/library/digital_resources/Lekiosk/tests/LekioskTest.php index 60fbb092d78610ff799f366a041e6c1aec8f3d62..bda3e4be0fa4cff241980cc6321808b0b6d75182 100644 --- a/library/digital_resources/Lekiosk/tests/LekioskTest.php +++ b/library/digital_resources/Lekiosk/tests/LekioskTest.php @@ -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();