From 88dd750d1d94c02d89ec3f7365efc18cf85247af Mon Sep 17 00:00:00 2001
From: Arthur Suzuki <arthur.suzuki@biblibre.com>
Date: Tue, 20 Jun 2023 12:53:43 +0000
Subject: [PATCH] hotline#178878: loans list prints shows the callnumber

---
 VERSIONS_HOTLINE/178878                                  | 1 +
 library/Class/WebService/SIGB/Emprunt.php                | 5 +++++
 library/ZendAfi/Controller/Plugin/Printer/Loans.php      | 1 +
 .../ZendAfi/View/Helper/ModeleFusion/Template/Loans.php  | 2 ++
 .../opac/controllers/AbonneControllerPretsTest.php       | 9 +++++++++
 5 files changed, 18 insertions(+)
 create mode 100644 VERSIONS_HOTLINE/178878

diff --git a/VERSIONS_HOTLINE/178878 b/VERSIONS_HOTLINE/178878
new file mode 100644
index 00000000000..42b4c209475
--- /dev/null
+++ b/VERSIONS_HOTLINE/178878
@@ -0,0 +1 @@
+ - correctif #178878 : Compte Abonné : l'impression des prêts contient désormais la cote des documents empruntés.
\ No newline at end of file
diff --git a/library/Class/WebService/SIGB/Emprunt.php b/library/Class/WebService/SIGB/Emprunt.php
index 11cddbe4005..265521c8a3d 100644
--- a/library/Class/WebService/SIGB/Emprunt.php
+++ b/library/Class/WebService/SIGB/Emprunt.php
@@ -56,6 +56,11 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOper
   }
 
 
+  public function getCote() {
+    return $this->_exemplaire->getCote();
+  }
+
+
   /**
    * @return int
    */
diff --git a/library/ZendAfi/Controller/Plugin/Printer/Loans.php b/library/ZendAfi/Controller/Plugin/Printer/Loans.php
index 7955ed00d0d..3cdeb4ca4fe 100644
--- a/library/ZendAfi/Controller/Plugin/Printer/Loans.php
+++ b/library/ZendAfi/Controller/Plugin/Printer/Loans.php
@@ -29,6 +29,7 @@ class ZendAfi_Controller_Plugin_Printer_Loans extends ZendAfi_Controller_Plugin_
     foreach($loans as $loan)
       $humans_loans [] = new Class_Entity(['LoanedBy' => $loan->getUserFullName(),
                                            'BarCode' => $loan->getCodeBarre(),
+                                           'Cote' => $loan->getCote(),
                                            'DocType' => $this->_view->Loan_DocType($loan),
                                            'Title' => $loan->getTitre(),
                                            'Author' => $loan->getAuteur(),
diff --git a/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php b/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php
index 655beeb126a..536453670ce 100644
--- a/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php
+++ b/library/ZendAfi/View/Helper/ModeleFusion/Template/Loans.php
@@ -34,6 +34,8 @@ class ZendAfi_View_Helper_ModeleFusion_Template_Loans extends ZendAfi_View_Helpe
 
              $this->_tag('span', $this->_('Emprunté par : {loaned_by}')),
 
+             $this->_tag('span', $this->_('Cote : {cote}')),
+
              $this->_tag('span', $this->_('Code-barre : {bar_code}')),
 
              $this->_tag('span', $this->_('Auteur : {author}')),
diff --git a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
index 731945db29e..a1c3442ef2c 100644
--- a/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
+++ b/tests/application/modules/opac/controllers/AbonneControllerPretsTest.php
@@ -167,6 +167,7 @@ abstract class AbonneControllerPretsListThreePretsTestCase
       ->setExemplaireOPAC($this->fixture('Class_Exemplaire',
                                          ['id' => 918,
                                           'id_origine' => 5678,
+                                          'cote' => 'ROMAN FANTASTIQUE',
                                           'code_barres' => 124,
                                           'id_int_bib' => 1,
                                           'zone995' => serialize([['clef' => 'a', 'valeur' => 'AliceItem']]),
@@ -1442,11 +1443,19 @@ class AbonneControllerPrintActionPretsTest
     $this->assertXPathContentContains('//h1', 'Titre : Alice au royaume de ');
   }
 
+
   /** @test */
   public function spanShouldContainsThumbnailAliceDotJpg() {
     $this->assertXPath('//span//img[contains(@src, "Alice.jpg")]');
   }
 
+
+  /** @test */
+  public function spanShouldContainsCoteRomanFantaisie() {
+    $this->assertXPathContentContains('//span', 'Cote : ROMAN FANTASTIQUE');
+  }
+
+
   /** @test */
   public function spanShouldContainsCodeBarre124() {
     $this->assertXPathContentContains('//span', 'Code-barre : 124');
-- 
GitLab