From 13ba3559b0ebbb30c1c99a0e4f37b7565d0a52ec Mon Sep 17 00:00:00 2001
From: jgaimard <jgaimard@git-test.afi-sa.fr>
Date: Mon, 26 Nov 2012 08:33:38 +0000
Subject: [PATCH] morceaux sonores

---
 .../modules/opac/controllers/NoticeajaxController.php        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/application/modules/opac/controllers/NoticeajaxController.php b/application/modules/opac/controllers/NoticeajaxController.php
index 5d360c9e9f5..21b33903f23 100644
--- a/application/modules/opac/controllers/NoticeajaxController.php
+++ b/application/modules/opac/controllers/NoticeajaxController.php
@@ -270,7 +270,7 @@ class NoticeAjaxController extends Zend_Controller_Action {
 		{
 			$source = "Amazon";
 			$amazon = new Class_WebService_AmazonSonores();
-			//$morceaux = $amazon->rend_notice_ean($notice["ean"]);
+			$morceaux = $amazon->rend_notice_ean($notice["ean"]);
 		}
 
 		// Chez LastFm
@@ -279,8 +279,9 @@ class NoticeAjaxController extends Zend_Controller_Action {
 			$source="Last.fm";
 			$last_fm=new Class_WebService_Lastfm();
 			$morceaux=$last_fm->getMorceaux($notice["T"],$notice["A"]);
-			$morceaux["id_notice"]=$notice["id_notice"];
 		}
+		$morceaux["id_notice"]=$notice["id_notice"];
+		if (!$morceaux["nb_resultats"]) $source=""; 
 		$morceaux["auteur"]=$notice["A"];	
 		$html=$this->notice_html->getMorceaux($morceaux,$source);
 		$this->_sendResponse(Class_ScriptLoader::getInstance()->html().$html);
-- 
GitLab