From d6b206677ebc46aff241743bd17270016c09f7bb Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-loas.afi-sa.net>
Date: Fri, 7 Feb 2014 11:48:50 +0100
Subject: [PATCH] rel #11216 type doc audio record: url are now tracked

---
 library/ZendAfi/View/Helper/Album/PlayRessourceUrl.php        | 4 ++--
 library/ZendAfi/View/Helper/TagAlbumTrackList.php             | 2 +-
 .../controllers/RechercheControllerAlbumAudioRecordTest.php   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/library/ZendAfi/View/Helper/Album/PlayRessourceUrl.php b/library/ZendAfi/View/Helper/Album/PlayRessourceUrl.php
index fde60b6b196..51b9095ece7 100644
--- a/library/ZendAfi/View/Helper/Album/PlayRessourceUrl.php
+++ b/library/ZendAfi/View/Helper/Album/PlayRessourceUrl.php
@@ -20,14 +20,14 @@
  */
 
 class ZendAfi_View_Helper_Album_PlayRessourceUrl extends  Zend_View_Helper_Abstract {
-	public function album_playRessourceUrl($ressource) {
+	public function album_PlayRessourceUrl($ressource) {
 		$extension = $ressource->getFileExtension();
 		if (!$extension && $ressource->hasUrl())
 			return $this->view->absoluteUrl($ressource->getOriginalUrl());
 		
 		return $this->view->absoluteUrl(['controller' => 'bib-numerique',
 																		 'action' => 'play-ressource',
-																		 'id' => $ressource->getId()]).'.'.$extension;
+																		 'id' => $ressource->getId()],null,true).'.'.$extension;
 	}
 }
 
diff --git a/library/ZendAfi/View/Helper/TagAlbumTrackList.php b/library/ZendAfi/View/Helper/TagAlbumTrackList.php
index a0f686aebba..8407ca70db3 100644
--- a/library/ZendAfi/View/Helper/TagAlbumTrackList.php
+++ b/library/ZendAfi/View/Helper/TagAlbumTrackList.php
@@ -34,7 +34,7 @@ class ZendAfi_View_Helper_TagAlbumTrackList extends Zend_View_Helper_HtmlElement
 			$html.=
 				'<li class="audio_track">'.
 				$this->view->albumRessourceInfos($audio_track).
-				$this->view->audioJsPlayer($audio_track->getOriginalUrl()).
+				$this->view->audioJsPlayer($this->view->album_PlayRessourceUrl($audio_track)).
 				'</li>';
 		}
 		return $html.='</ol>';
diff --git a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php
index 6840d819637..324f6eb2c5f 100644
--- a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php
+++ b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php
@@ -210,7 +210,7 @@ class RechercheControllerAlbumAudioRecordViewRessourcesNumeriquesTest extends Re
 
 	/** @test */
 	public function moonchildPlayerShouldBePresent() {
-		$this->assertXPath('//ol//li//audio/source[contains(@src, "moonchild.mp3")]', $this->_response->getBody());
+		$this->assertXPath('//ol//li//audio/source[contains(@src, "bib-numerique/play-ressource/id/1.mp3")]', $this->_response->getBody());
 	}
 
 
@@ -265,7 +265,7 @@ class RechercheControllerAlbumAudioRecordAsTelephoneViewRessourcesNumeriquesTest
 
 	/** @test */
 	public function moonchildPlayerShouldBePresent() {
-		$this->assertXPath('//ol//li//audio/source[contains(@src, "moonchild.mp3")]', $this->_response->getBody());
+		$this->assertXPath('//ol//li//audio/source[contains(@src, "bib-numerique/play-ressource/id/1.mp3")]', $this->_response->getBody());
 	}
 
 
-- 
GitLab