diff --git a/VERSIONS_WIP/24867 b/VERSIONS_WIP/24867
new file mode 100644
index 0000000000000000000000000000000000000000..f4edbc769d3006542a91763bffc3e12fe6eccdf9
--- /dev/null
+++ b/VERSIONS_WIP/24867
@@ -0,0 +1 @@
+ - ticket #24867 : PNB, Suppression du bouton "Rendre un exemplaire emprunté" (non applicable)
\ No newline at end of file
diff --git a/application/modules/opac/controllers/AbonneController.php b/application/modules/opac/controllers/AbonneController.php
index 93adf034db24a8b8590c5d3abc7abebc24bc3015..901eb90305f3b057ab37843d55190ac38fa41acf 100644
--- a/application/modules/opac/controllers/AbonneController.php
+++ b/application/modules/opac/controllers/AbonneController.php
@@ -943,10 +943,5 @@ class AbonneController extends ZendAfi_Controller_Action {
     $response->setHeader('Content-Disposition', 'attachment; filename="'.$filename.'"', true);
     $response->setBody(implode('', $datas));
   }
-
-
-  public function endLoanBookAction() {
-    $this->_forward('end-loan-book', 'bib-numerique');
-  }
 }
 ?>
\ No newline at end of file
diff --git a/application/modules/opac/controllers/BibNumeriqueController.php b/application/modules/opac/controllers/BibNumeriqueController.php
index f7213c62d2618ee5cd9f0ad324da2ec6ccf7d8df..b9c837e88eafffd9c01061b10f1a60970421c606 100644
--- a/application/modules/opac/controllers/BibNumeriqueController.php
+++ b/application/modules/opac/controllers/BibNumeriqueController.php
@@ -146,7 +146,7 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
 
     echo $this->_renderFile($ressource->getThumbnailFilePath($thumbnail_params),
                             $this->_getParam('attachment', false));
-}
+  }
 
   /**
    * Interpretation des permaliens type http://localhost/afi-opac3/bib-numerique/notice/ido/D09030001/folio/1R4
@@ -255,8 +255,35 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
 
   }
 
+  public function consultBookAjaxAction() {
+    if (!$this->_redirectToLogin())
+      $this->_redirect($this->view->url(['action' => 'consult-book', 'render' =>null]),
+                       ['prependBase' => false]);
+  }
+
+  protected function _redirectToLogin() {
+    if (!$this->_user = Class_Users::getLoader()->getIdentity()) {
+      $this->_forward('login', 'auth', 'opac', ['redirect' => $this->view->absoluteUrl()]);
+      return true;
+    }
+    return false;
+  }
+
+
+  public function loanBookAjaxAction() {
+    if ($this->_redirectToLogin())
+      return ;
+    $this->_redirect($this->view->url(['action' => 'loan-book', 'render' => null]), ['prependBase' => false]);
+    return true;
+  }
+
 
   public function consultBookAction() {
+    if ($this->_redirectToLogin())
+      return ;
+    if (!$this->_user->hasRightAccessDilicom())
+      return;
+
     $album = Class_Album::find($this->_getParam('id'));
 
     $client_ip = (new Class_RemoteClient($this->_request))->getIpAddress();
@@ -266,7 +293,7 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
     $content = json_decode($response);
     if ($content->returnMessage) {
       $this->_helper->notify(implode(',', $content->returnMessage));
-      $this->_redirectToReferer();
+      $this->_redirectToNotice();
       return;
     }
 
@@ -274,36 +301,31 @@ class BibNumeriqueController extends ZendAfi_Controller_Action {
   }
 
 
+  protected function _redirectToNotice() {
+    $this->_redirect($this->view->url(['controller' => 'recherche',
+                                       'action' => 'viewnotice']),['prependBase' => false]);
+
+  }
+
+
   public function loanBookAction() {
+    if ($this->_redirectToLogin())
+      return ;
+    if (!$this->_user->hasRightAccessDilicom())
+      return;
+
     if(!$album = Class_Album::find($this->_getParam('id')))
-      return $this->_redirectToReferer();
+      return $this->_redirectToNotice();
 
     $content = (new Class_WebService_BibNumerique_Dilicom_Hub())->loanBook($album);
 
     if ($content->returnMessage) {
       $this->_helper->notify(implode(',', $content->returnMessage));
-      return $this->_redirectToReferer();
+      return $this->_redirectToNotice();
     }
 
     return $this->_redirect($content->link->url);
   }
-
-
-  public function endLoanBookAction() {
-    if ($loan = Class_Loan_Pnb::find($this->_getParam('id')))
-      $loan->endLoanDo([$this, 'notifyEndLoanBook']);
-
-    $this->_redirectToReferer();
-  }
-
-
-  public function notifyEndLoanBook($errors) {
-    $message = $errors
-      ? implode(',', $errors)
-      : $this->view->_('Votre retour a bien été enregistré');
-
-    $this->_helper->notify($message);;
-  }
 }
 
 ?>
\ No newline at end of file
diff --git a/library/Class/WebService/BibNumerique/Dilicom/Hub.php b/library/Class/WebService/BibNumerique/Dilicom/Hub.php
index 40286128d5a3196d6199af11b19778ed7499ae4f..5f3178fb46584b746629b144c901cd5601d01eaf 100644
--- a/library/Class/WebService/BibNumerique/Dilicom/Hub.php
+++ b/library/Class/WebService/BibNumerique/Dilicom/Hub.php
@@ -36,19 +36,6 @@ class Class_WebService_BibNumerique_Dilicom_Hub extends Class_WebService_Abstrac
   }
 
 
-  public function endLoanBook($loan) {
-    $content = json_decode($this->dilicomCall('endLoan',
-                                              ['orderLineId' => $loan->getOrderLineId(),
-                                               'loanId' => $loan->getId()]));
-
-    if(!$content->returnMessage)
-      $loan->setOngoing(false)
-           ->save();
-
-    return $content;
-  }
-
-
   public function updateStatus($album) {
     $content = (new Class_WebService_BibNumerique_Dilicom_Hub())->getLoanStatus($album);
 
diff --git a/library/ZendAfi/View/Helper/Abonne/LoanAction.php b/library/ZendAfi/View/Helper/Abonne/LoanAction.php
index 98770239258e0d9976d2609d72ce143e3fb66e3b..0eca52a1179b7ca3cfdb566c77b0a49ef9d3f47e 100644
--- a/library/ZendAfi/View/Helper/Abonne/LoanAction.php
+++ b/library/ZendAfi/View/Helper/Abonne/LoanAction.php
@@ -25,9 +25,6 @@ class ZendAfi_View_Helper_Abonne_LoanAction extends ZendAfi_View_Helper_Abonne_A
     if ($emprunt->isRenewable())
       return $this->renewLoanLink($emprunt);
 
-    if ($emprunt->isPNB())
-      return $this->endLoanBookLink($emprunt);
-
     return '';
   }
 
@@ -49,15 +46,6 @@ class ZendAfi_View_Helper_Abonne_LoanAction extends ZendAfi_View_Helper_Abonne_A
                              ],
                             $this->_('Prolonger'));
   }
-
-
-  public function endLoanBookLink($emprunt) {
-    return $this->view->tagAnchor(['action' => 'end-loan-book',
-                                   'id' => $emprunt->getId()],
-                                  $this->_('Rendre le livre'));
-  }
-
-
 }
 
 ?>
\ No newline at end of file
diff --git a/library/ZendAfi/View/Helper/NuageTags.php b/library/ZendAfi/View/Helper/NuageTags.php
index 324eb4535dedf784dac9e7f5cb6a8d4323e6d2cf..f7aa7994eb330ae4ad1bdd7a8c542f603485633e 100644
--- a/library/ZendAfi/View/Helper/NuageTags.php
+++ b/library/ZendAfi/View/Helper/NuageTags.php
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
  * along with BOKEH; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
 //////////////////////////////////////////////////////////////////////////////////////////
 // OPAC3 : Nuages de tags
@@ -35,13 +35,13 @@ class ZendAfi_View_Helper_NuageTags extends ZendAfi_View_Helper_BaseHelper {
                              'module' => 'opac'],
                             null,
                             true);
-    
+
     // Déterminer les tranches
     $tranches = $this->calcultranches($tags, $calcul);
-    
+
     // Remettre dans un ordre aleatoire
     shuffle($tags);
-    
+
     // Fabriquer le Html
     $html='<div class="nuage">';
     foreach ($tags as $tag) {
@@ -99,28 +99,29 @@ class ZendAfi_View_Helper_NuageTags extends ZendAfi_View_Helper_BaseHelper {
           unset($distinct[$ecart_index_suppr]);
         }
       }
-        
+
       // Constitution des tranches
       $index=10;
       foreach($distinct as $tranche => $valeur) {
         $index--;
         if($valeur >  0)$tranches[]=$valeur;
-      }   
+      }
       return $tranches;
     }
 
     // Min et max
     $nb_elements = count($tableau);
-    $max = $tableau[1]["nombre"];
+
+    $max = isset($tableau[1]["nombre"]) ? $tableau[1]["nombre"] : 0;
     $min = isset($tableau[$nb_elements]["nombre"]) ? $tableau[$nb_elements]["nombre"] : 0;
-    
+
     // Si peu de nombres on fabrique les tranches en dur
     if($max < 11)
-      { 
+      {
         $tranches=array(10,9,8,7,6,5,4,3,2,1);
         return $tranches;
       }
-    
+
     // Calcul par répartition simple
     if(!$methode)
       {
@@ -133,7 +134,7 @@ class ZendAfi_View_Helper_NuageTags extends ZendAfi_View_Helper_BaseHelper {
           }
         return $tranches;
       }
-    
+
     // Calcul par ecart à la moyenne
     $sumX = $sumX2 = 0;
     foreach($tableau as $data) {
@@ -142,14 +143,14 @@ class ZendAfi_View_Helper_NuageTags extends ZendAfi_View_Helper_BaseHelper {
     }
 
     $mean = $sumX / $nb_elements;
-    $stdDev = intval(sqrt($sumX2 - $mean * $mean * $nb_elements) / $nb_elements); 
+    $stdDev = intval(sqrt($sumX2 - $mean * $mean * $nb_elements) / $nb_elements);
     $fBreakVal = intval($mean - ($stdDev * 3));
     for( $i = 0; $i < 10; $i++)
       {
         if($fBreakVal >= $min and $fBreakVal <= $max) $tranches[]= $fBreakVal;
         $fBreakVal = $fBreakVal + $stdDev;
       }
-    
+
     // Calcul par ecart à la moyenne pondéré
     if($methode == 2)
       {
diff --git a/library/ZendAfi/View/Helper/TagDilicomWidget.php b/library/ZendAfi/View/Helper/TagDilicomWidget.php
index 80502b3c4d4b07ee7758b1e957ecaa92f7b3905e..70972c7c7f2ab639bb6a5d492586544e09a74bee 100644
--- a/library/ZendAfi/View/Helper/TagDilicomWidget.php
+++ b/library/ZendAfi/View/Helper/TagDilicomWidget.php
@@ -36,13 +36,13 @@ class ZendAfi_View_Helper_TagDilicomWidget extends Zend_View_Helper_HtmlElement
                                 'width' => '100%',
                                 'height' => '600px']);
 
-    $links = $this->view->tag('p', $this->view->_('Vous devez vous connecter pour accéder à la consultation en ligne.'));
+    $links = $this->view->tag('p', $this->view->_('Vous n\'avez pas le droit d\'accéder à la consultation en ligne.'));
 
-    if(($this->_user = Class_Users::getIdentity()) && ($this->_user->hasRightAccessDilicom()))
+    $this->_user = Class_Users::getIdentity();
+    if (!$this->_user || $this->_user->hasRightAccessDilicom())
       $links = $infos
         . $this->getConsultBookAnchor()
-        . $this->getLoanBookAnchor()
-        . $this->getEndLoanBookAnchor();
+        . $this->getLoanBookAnchor();
 
     return $links . $iframe;
   }
@@ -50,28 +50,19 @@ class ZendAfi_View_Helper_TagDilicomWidget extends Zend_View_Helper_HtmlElement
 
   protected function getConsultBookAnchor() {
     return $this->getDilicomAnchor(['controller' => 'bib-numerique',
-                                    'action' => 'consult-book',
+                                    'action' => 'consult-book-ajax',
                                     'id' => $this->_album->getId()],
-                                   $this->view->_('Consulter le livre en ligne'), ['target' => '_blank']);
+                                   $this->view->_('Consulter le livre en ligne'),
+                                   [ 'target'=> '_blank' ]);
   }
 
 
   protected function getLoanBookAnchor() {
     return $this->getDilicomAnchor(['controller' => 'bib-numerique',
-                                    'action' => 'loan-book',
-                                    'id' => $this->_album->getId(),],
-                                   $this->view->_('Emprunter le livre au format EPUB'));
-  }
-
-
-  protected function getEndLoanBookAnchor() {
-    if(!$loan = Class_Loan_Pnb::findOngoingByUserAndAlbum($this->_user, $this->_album))
-      return '';
-
-    return $this->getDilicomAnchor(['controller' => 'bib-numerique',
-                                    'action' => 'end-loan-book',
-                                    'id' => $loan->getId()],
-                                   $this->view->_('Rendre le livre emprunté'));
+                                    'action' => 'loan-book-ajax',
+                                    'id' => $this->_album->getId()],
+                                   $this->view->_('Emprunter le livre au format EPUB')
+    );
   }
 
 
diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
index a58f7cebdd45ce9d7b8083055e09c41179b16042..52888bb6493371c0f7cc0931436b4478544c5aec 100644
--- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
+++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
@@ -260,13 +260,6 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT
   }
 
 
-  /** @test */
-  public function pinocchioLoanShouldHaveLinkToEndLoanBook() {
-    $this->assertXPathContentContains("//td//a[@href='/abonne/end-loan-book/id/5']",
-                                      'Rendre le livre');
-  }
-
-
   /** @test */
   public function potterLoanShouldBePresent() {
     $this->assertXPathContentContains("//tbody/tr[2]//td", 'Potter', $this->_response->getBody());
@@ -318,27 +311,6 @@ class AbonneControllerPretsListThreePretsTest extends AbonneControllerPretsListT
 
 
 
-class AbonneControllerEndLoanBookTest extends AbonneControllerPretsListThreePretsTestCase {
-  public function setUp() {
-    parent::setUp();
-    $loan = Storm_Test_ObjectWrapper::on(Class_Loan_Pnb::find(5));
-    $loan
-      ->whenCalled('endLoanDo')
-      ->answers(true);
-
-    Class_Loan_Pnb::cacheInstance($loan);
-    $this->dispatch('/abonne/end-loan-book/id/5', true);
-  }
-
-
-  /** @test */
-  public function endLoanShouldHaveBeenSentOnLoanInstance() {
-    $this->assertTrue(Class_Loan_Pnb::find(5)->methodHasBeenCalled('endLoanDo'));
-  }
-}
-
-
-
 class AbonneControllerPretsListReservationTest extends AbstractAbonneControllerPretsTestCase {
   public function setUp() {
     parent::setUp();
diff --git a/tests/application/modules/opac/controllers/BibNumeriqueControllerDilicomTest.php b/tests/application/modules/opac/controllers/BibNumeriqueControllerDilicomTest.php
index 378db9bf458ea09ca17beafca962c5722bb9ee72..d092af77415808fb22cd138e30d42999cdbe0640 100644
--- a/tests/application/modules/opac/controllers/BibNumeriqueControllerDilicomTest.php
+++ b/tests/application/modules/opac/controllers/BibNumeriqueControllerDilicomTest.php
@@ -96,6 +96,24 @@ abstract class BibNumeriqueContollerDilicomTestCase extends AbstractControllerTe
 
 
 
+class BibNumeriqueContollerDilicomAjaxRedirectBookActionTest extends BibNumeriqueContollerDilicomTestCase {
+  /** @test */
+  public function redirectShouldBeConsultBook() {
+    $this->dispatch('/bib-numerique/consult-book-ajax/id/3', true);
+    $this->assertRedirectTo('/bib-numerique/consult-book/id/3', $this->getResponseLocation());
+  }
+
+
+  /** @test */
+  public function redirectShouldBeLoanBook() {
+    $this->dispatch('/bib-numerique/loan-book-ajax/id/3', true);
+    $this->assertRedirectTo('/bib-numerique/loan-book/id/3', $this->getResponseLocation());
+  }
+
+}
+
+
+
 class BibNumeriqueContollerDilicomConsultBookActionTest extends BibNumeriqueContollerDilicomTestCase {
   public function setUp() {
     parent::setUp();
@@ -166,7 +184,7 @@ class BibNumeriqueContollerDilicomConsultBookWithErrorsActionTest extends BibNum
 
   /** @test */
   public function responseShouldRedirectToReferrer() {
-    $this->assertRedirectTo('/viewnotice/id/3', $this->getResponseLocation());
+    $this->assertRedirectTo('/recherche/viewnotice/id/3', $this->getResponseLocation());
   }
 
 
@@ -234,7 +252,7 @@ class BibNumeriqueControllerDilicomLoanBookActionErrorsTest extends BibNumerique
 
   /** @test */
   public function responseShouldRedirectToReferrer() {
-    $this->assertRedirectTo('/viewnotice/id/3', $this->getResponseLocation());
+    $this->assertRedirectTo('/recherche/viewnotice/id/3', $this->getResponseLocation());
   }
 
 
@@ -257,87 +275,13 @@ class BibNumeriqueControllerDilicomLoanBookWrongAlbumTest extends BibNumeriqueCo
   public function responseShouldRedirectToIndex() {
     $_SERVER['HTTP_REFERER'] = '/viewnotice/id/3789';
     $this->dispatch('/bib-numerique/loan-book/id/3789', true);
-    $this->assertRedirectTo('/viewnotice/id/3789');
-  }
-}
-
-
-
-class BibNumeriqueControllerDilicomEndLoanBookTest extends BibNumeriqueContollerDilicomTestCase {
-  public function setUp() {
-    parent::setUp();
-    $_SERVER['HTTP_REFERER'] = '/viewnotice/id/3';
-
-    $this->_http
-      ->whenCalled('open_url')
-      ->with('https://pnb-test.centprod.com/v2/pnb-numerique/json/endLoan?glnContractor=123456789&orderLineId=x321&loanId=1')
-      ->answers(DilicomFixtures::endLoanBookResponse())
-      ->beStrict();
-
-    $this->fixture('Class_Loan_Pnb',
-                   ['id' => 1,
-                    'record_origin_id' => 'Dilicom-88817216',
-                    'user_id' => '6',
-                    'ongoing' => true]);
-
-    $this->dispatch('/bib-numerique/end-loan-book/id/1', true);
-  }
-
-
-  /** @test */
-  public function responseShouldRedirectToReferrer() {
-    $this->assertRedirectTo('/viewnotice/id/3');
-  }
-
-
-  /** @test */
-  public function endLoanMessageShouldBeInNotifications() {
-    $this->assertFlashMessengerContentContains('Votre retour a bien été enregistré');
-  }
-
-
-  /** @test */
-  public function loanShouldNotBeInProgress() {
-    $this->assertFalse(Class_Loan_Pnb::find(1)->getOngoing());
+    $this->assertRedirectTo('/recherche/viewnotice/id/3789');
   }
 }
 
 
 
 
-class BibNumeriqueControllerDilicomEndLoanBookErrorTest extends BibNumeriqueContollerDilicomTestCase {
-  /** @test */
-  public function responseShouldRedirectToReferrer() {
-    $_SERVER['HTTP_REFERER'] = '/viewnotice/id/3789';
-    $this->dispatch('/bib-numerique/end-loan-book/id/3789', true);
-    $this->assertRedirectTo('/viewnotice/id/3789');
-  }
-
-
-
-  /** @test */
-  public function notifyMessageShouldContainsAlreadyEnded() {
-    $_SERVER['HTTP_REFERER'] = '/viewnotice/id/3';
-
-    $this->_http
-      ->whenCalled('open_url')
-      ->with('https://pnb-test.centprod.com/v2/pnb-numerique/json/endLoan?glnContractor=123456789&orderLineId=x321&loanId=1')
-      ->answers(DilicomFixtures::endLoanBookErrorResponse())
-      ->beStrict();
-
-    $this->fixture('Class_Loan_Pnb',
-                   ['id' => 1,
-                    'record_origin_id' => 'Dilicom-88817216',
-                    'user_id' => '6',
-                    'ongoing' => true]);
-
-    $this->dispatch('/bib-numerique/end-loan-book/id/1', true);
-    $this->assertFlashMessengerContentContains('The loan with orderlineId \'524ade40bbd31c6240a30dff\' and loanId \'loanId\' is already ended');
-  }
-}
-
-
-
 class BibNumeriqueControllerDilicomLoanBookActionTwiceWithSameUserTest extends BibNumeriqueContollerDilicomTestCase {
   public function setUp() {
     parent::setUp();
@@ -402,7 +346,7 @@ class BibNumeriqueControllerDilicomLoanBookActionWithASecondUserAndLoanCountExce
 
   /** @test */
   public function responseShouldRedirectToReferer() {
-    $this->assertRedirectTo('/viewnotice/id/3');
+    $this->assertRedirectTo('/recherche/viewnotice/id/3');
   }
 
 
@@ -424,7 +368,7 @@ class BibNumeriqueControllerDilicomLoanBookActionWithASecondUserAndQuantityExced
 
   /** @test */
   public function responseShouldRedirectToReferer() {
-    $this->assertRedirectTo('/viewnotice/id/3');
+    $this->assertRedirectTo('/recherche/viewnotice/id/3');
   }
 
 
diff --git a/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php b/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php
index 053fc8356b6355fd6dab2f7acfa6f7c707e75405..d08d2e31a4783b237cbb0419b76158ee45c99732 100644
--- a/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php
+++ b/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php
@@ -281,8 +281,6 @@ abstract class ZendAfi_View_Helper_RenderAlbumDilicomPNBTestCase extends ZendAfi
 }
 
 
-
-
 class ZendAfi_View_Helper_RenderAlbumDilicomPNBNotLoggedTest extends ZendAfi_View_Helper_RenderAlbumDilicomPNBTestCase {
   public function setUp() {
     parent::setUp();
@@ -293,38 +291,62 @@ class ZendAfi_View_Helper_RenderAlbumDilicomPNBNotLoggedTest extends ZendAfi_Vie
 
   /** @test */
   public function htmlShouldNotContainsLinkToConsultBook() {
-    $this->assertNotXPathContentContains($this->_html,
-                                         '//a[contains(@href, "/bib-numerique/consult-book/id/3")]',
-                                         'Consulter le livre en ligne');
+    $this->assertXPathContentContains($this->_html,
+                                      '//a[contains(@href, "/bib-numerique/consult-book-ajax/id/3")]',
+                                      'Consulter le livre en ligne');
+  }
+
+
+}
+
+
+class ZendAfi_View_Helper_RenderAlbumDilicomPNBLoggedButNotAuthorizeTest extends ZendAfi_View_Helper_RenderAlbumDilicomPNBTestCase {
+  public function setUp() {
+    parent::setUp();
+    $this->logged_user = $this->fixture('Class_Users',
+                                        ['id' => 6,
+                                         'nom'=>'Pito',
+                                         'login'=>'Chat',
+                                         'password'=>'123456',
+                                         'id_site' => 1,
+                                         'idabon' => '12345']);
+
+    $this->logged_user->setUserGroups([]);
+    ZendAfi_Auth::getInstance()->logUser($this->logged_user);
+    $this->_html = $this->_helper->renderAlbum($this->book);
   }
 
 
   /** @test */
-  public function htmlShouldContainsMessageToIntroduceLogin() {
-    $this->assertXPathContentContains($this->_html, '//p', utf8_encode('Vous devez vous connecter pour accéder à la consultation en ligne.'));
+  public function htmlShouldNotContainsLinkToConsultBook() {
+    $this->assertXPathContentContains($this->_html,
+                                      '//p',utf8_encode("Vous n'avez pas le droit d'accéder à la consultation en ligne."));
   }
+
+
 }
 
 
 
 
 class ZendAfi_View_Helper_RenderAlbumDilicomPNBTest extends ZendAfi_View_Helper_RenderAlbumDilicomPNBTestCase {
+
   public function setUp() {
     parent::setUp();
 
-    $logged_user = $this->fixture('Class_Users',
-                                  ['id' => 6,
-                                   'nom'=>'Pito',
-                                   'login'=>'Chat',
-                                   'password'=>'123456',
-                                   'id_site' => 1,
-                                   'idabon' => '12345',
-                                   'user_groups' => [$this->fixture('Class_UserGroup',
-                                                                    ['id' => '20',
-                                                                     'libelle' => 'Multimedia',
-                                                                     'rights' => [Class_UserGroup::RIGHT_ACCES_PNB_DILICOM]])]]);
-    $logged_user->beAbonneSIGB()->assertSave();
-    ZendAfi_Auth::getInstance()->logUser($logged_user);
+    $this->logged_user = $this->fixture('Class_Users',
+                                        ['id' => 6,
+                                         'nom'=>'Pito',
+                                         'login'=>'Chat',
+                                         'password'=>'123456',
+                                         'id_site' => 1,
+                                         'idabon' => '12345',
+                                         'user_groups' => [$this->fixture('Class_UserGroup',
+                                                                          ['id' => '20',
+                                                                           'libelle' => 'Multimedia',
+                                                                           'rights' => [Class_UserGroup::RIGHT_ACCES_PNB_DILICOM]])]]);
+    $this->logged_user->beAbonneSIGB()->assertSave();
+    ZendAfi_Auth::getInstance()->logUser($this->logged_user);
 
     $this->fixture('Class_Loan_Pnb',
                    ['id' => 1,
@@ -347,7 +369,7 @@ class ZendAfi_View_Helper_RenderAlbumDilicomPNBTest extends ZendAfi_View_Helper_
   /** @test */
   public function htmlShouldContainsLinkToConsultBook() {
     $this->assertXPathContentContains($this->_html,
-                                      '//a[contains(@href, "/bib-numerique/consult-book/id/3")]',
+                                      '//a[contains(@href, "/bib-numerique/consult-book-ajax/id/3")]',
                                       'Consulter le livre en ligne');
   }
 
@@ -355,19 +377,11 @@ class ZendAfi_View_Helper_RenderAlbumDilicomPNBTest extends ZendAfi_View_Helper_
   /** @test */
   public function htmlShouldContainsLinkToLoanBook() {
     $this->assertXPathContentContains($this->_html,
-                                      '//a[contains(@href, "/bib-numerique/loan-book/id/3")]',
+                                      '//a[contains(@href, "/bib-numerique/loan-book-ajax/id/3")]',
                                       'Emprunter le livre au format EPUB');
   }
 
 
-  /** @test */
-  public function htmlShouldContainsLinkToEndLoanBook() {
-    $this->assertXPathContentContains($this->_html,
-                                      '//a[contains(@href, "/bib-numerique/end-loan-book/id/1")]',
-                                      utf8_encode('Rendre le livre emprunté'));
-  }
-
-
   /** @test */
   public function albumShouldHaveBeenUpdateThroughHubGetLoanStatus() {
     $this->assertContains('getLoanStatus', $this->_http->getFirstAttributeForLastCallOn('open_url'));