diff --git a/VERSIONS_HOTLINE/36324 b/VERSIONS_HOTLINE/36324 new file mode 100644 index 0000000000000000000000000000000000000000..d6be425ac06a0e8d6afb63d78191b9d13bfb800d --- /dev/null +++ b/VERSIONS_HOTLINE/36324 @@ -0,0 +1 @@ + - ticket #36324 : Version téléphone : Modification des libellés des onglets d'accès aux ressources en ligne \ No newline at end of file diff --git a/application/modules/telephone/controllers/RechercheController.php b/application/modules/telephone/controllers/RechercheController.php index f0ba039d2ef5fb278ec3c5288c1daf9e4068fcf2..31a4e1b5e765728d0507ca82ab6fa83029dda528 100644 --- a/application/modules/telephone/controllers/RechercheController.php +++ b/application/modules/telephone/controllers/RechercheController.php @@ -44,13 +44,13 @@ class Telephone_RechercheController extends RechercheController { return [$this->_('Feuilleter le livre') => $action_array]; if ($notice->isArteVOD()) - return [$this->_('Bande-annonce') => $action_array]; + return [$this->_('Accéder à la vidéo') => $action_array]; - if ($notice->isAudioRecord()) - return [$this->_('Ecouter l\'album') => $action_array]; + if ($notice->isAudioRecord() || $notice->is1DTouch()) + return [$this->_('Accéder à l\'album') => $action_array]; if ($notice->isToutApprendre()) - return [$this->_('Cours ToutApprendre') => $action_array]; + return [$this->_('Accéder au cours') => $action_array]; return [$this->_('Accéder à la ressource') => $action_array]; } diff --git a/library/Class/Album.php b/library/Class/Album.php index 3fe056b5c31f4e689372f16ee96dcbe7b46e8dc8..d6e42c996dcae69da04644b9636efc016747c777 100644 --- a/library/Class/Album.php +++ b/library/Class/Album.php @@ -481,8 +481,8 @@ class Class_Album extends Storm_Model_Abstract { public function isAudioRecord() { - return ($this->getTypeDocId() == Class_TypeDoc::JAMENDO || - $this->getTypeDocId() == Class_TypeDoc::AUDIO_RECORD); + return in_array($this->getTypeDocId(), + [Class_TypeDoc::JAMENDO, Class_TypeDoc::AUDIO_RECORD]); } diff --git a/library/Class/Notice.php b/library/Class/Notice.php index 1f8fa8875035383a1157b4f59b64448cd8c47b9e..62795cebeebc02e60041b3eb86c1abef7bfdeeea 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -478,6 +478,7 @@ class Class_Notice extends Storm_Model_Abstract { return ($this->getTypeDoc() == Class_TypeDoc::AUDIO_RECORD); } + public function isToutApprendre() { return ($this->getTypeDoc() == Class_TypeDoc::TOUTAPPRENDRE); } diff --git a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php index 26834b1f9ba2492d09333f1c1a6f3b10e5e7ff6c..ca944994ad0eb509ad96ca2ddbfb90e572d709e6 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php @@ -413,7 +413,7 @@ class RechercheControllerAlbumAudioRecordViewRessourceInTelephoneModeTest extend /** @test */ public function pageShouldContainsLinkToOpenRessourcesNumeriques() { - $this->assertXPathContentContains('//a[contains(@href,"recherche/ressourcesnumeriques/id/1")]','Ecouter l\'album',$this->_response->getBody()); + $this->assertXPathContentContains('//a[contains(@href,"recherche/ressourcesnumeriques/id/1")]', 'Accéder à l\'album',$this->_response->getBody()); } } diff --git a/tests/application/modules/telephone/controllers/RechercheControllerRessourceNumeriqueTest.php b/tests/application/modules/telephone/controllers/RechercheControllerRessourceNumeriqueTest.php index e500248ad4eaee7f8a9ded7d3a4243589dd26bd6..96b8fc33e8789e7b47d896db2a013533609cb834 100644 --- a/tests/application/modules/telephone/controllers/RechercheControllerRessourceNumeriqueTest.php +++ b/tests/application/modules/telephone/controllers/RechercheControllerRessourceNumeriqueTest.php @@ -74,8 +74,6 @@ class Telephone_RechercheControllerPropagandaRessourceNumeriqueViewNoticeTest ex - - class Telephone_RechercheControllerRessourceNumeriqueToutApprendreTest extends TelephoneAbstractControllerTestCase { protected $_storm_default_to_volatile = true; @@ -125,7 +123,8 @@ class Telephone_RechercheControllerRessourceNumeriqueViewNoticeOneDTouchTest ext 'titre' => 'Hypnophonic', 'visible' => true, 'status' => Class_Album::STATUS_VALIDATED, - 'type_doc_id' => Class_TypeDoc::ONEDTOUCH])->index(); + 'type_doc_id' => Class_TypeDoc::ONEDTOUCH]) + ->index(); } @@ -134,7 +133,63 @@ class Telephone_RechercheControllerRessourceNumeriqueViewNoticeOneDTouchTest ext $this->dispatch('/telephone/recherche/viewnotice/id/1', true); $this->assertXPathContentContains('//ul[contains(@class, "doctype_114")]//a[contains(@href, "ressourcesnumeriques/id/1")][@data-ajax="false"]', - 'Accéder à la ressource',$this->_response->getBody()); + 'Accéder à l\'album', + $this->_response->getBody()); + } +} + + + +class Telephone_RechercheControllerRessourceNumeriqueTutoZBrushViewNoticeTest + extends Telephone_RechercheControllerRessourceNumeriqueTestCase { + + public function setUp() { + parent::setUp(); + + $this->fixture('Class_Album', + ['id' => 6, + 'titre' => 'Tuto ZBrush', + 'visible' => true, + 'status' => Class_Album::STATUS_VALIDATED, + 'type_doc_id' => Class_TypeDoc::TOUTAPPRENDRE]) + ->index(); + } + + + /** @test */ + public function firstActionLinkShouldBeAccessCourse() { + $this->dispatch('/telephone/recherche/viewnotice/id/1', true); + $this->assertXPathContentContains('//ul[@data-role="listview"]/li[2]//a[contains(@href, "ressourcesnumeriques/id/1")][@data-ajax="false"]', + 'Accéder au cours', + $this->_response->getBody()); + } +} + + + + +class Telephone_RechercheControllerRessourceNumeriqueElserViewNoticeTest + extends Telephone_RechercheControllerRessourceNumeriqueTestCase { + + public function setUp() { + parent::setUp(); + + $this->fixture('Class_Album', + ['id' => 1, + 'titre' => 'Elser, un héros ordinaire', + 'visible' => true, + 'status' => Class_Album::STATUS_VALIDATED, + 'type_doc_id' => Class_TypeDoc::ARTEVOD]) + ->index(); + } + + + /** @test */ + public function firstActionLinkShouldBeAccessVideo() { + $this->dispatch('/telephone/recherche/viewnotice/id/1', true); + $this->assertXPathContentContains('//ul[@data-role="listview"]/li[2]//a[contains(@href, "ressourcesnumeriques/id/1")][@data-ajax="false"]', + 'Accéder à la vidéo', + $this->_response->getBody()); } }