From 49ce66e1668821ba7980de59c1b0c6de01da5db7 Mon Sep 17 00:00:00 2001
From: lbrun <leo@sandbox.pergame.net>
Date: Fri, 27 Nov 2015 11:36:50 +0100
Subject: [PATCH] Revert
 "hotline#33773_vsmart_impossible_de_se_connecter_a_son_compte_lecteur_lorsque_une_consultation_est_reservee:
 add verif + tests"

This reverts commit 248a965bc02219efbd521fef96fe065f51b145b0.
---
 VERSIONS_HOTLINE/33773                        |  1 -
 .../WebService/SIGB/VSmart/BorrowerReader.php | 32 ++++++-------------
 .../Class/WebService/SIGB/VSmartFixtures.php  | 17 ++--------
 3 files changed, 12 insertions(+), 38 deletions(-)
 delete mode 100644 VERSIONS_HOTLINE/33773

diff --git a/VERSIONS_HOTLINE/33773 b/VERSIONS_HOTLINE/33773
deleted file mode 100644
index 8466a20a9d2..00000000000
--- a/VERSIONS_HOTLINE/33773
+++ /dev/null
@@ -1 +0,0 @@
- - ticket #33773 : VSmart: Impossible de se connecter a son compte lecteur lorsque une consultation est reservée
\ No newline at end of file
diff --git a/library/Class/WebService/SIGB/VSmart/BorrowerReader.php b/library/Class/WebService/SIGB/VSmart/BorrowerReader.php
index fc4af0e04d6..fe701a3c069 100644
--- a/library/Class/WebService/SIGB/VSmart/BorrowerReader.php
+++ b/library/Class/WebService/SIGB/VSmart/BorrowerReader.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 
  */
 
 class Class_WebService_SIGB_VSmart_BorrowerReader {
@@ -27,7 +27,7 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
   protected $_sigb_service;
 
   protected $_xml_parser;
-  protected $_current_exemplaire_operation;
+
 
   /**
    *
@@ -110,17 +110,11 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
   }
 
 
-  public function endReservation() {
-    $this->_current_exemplaire_operation = null;
-  }
-
-
   /**
    * @param string $data
    */
   public function endLoan($data) {
     $this->_emprunteur->empruntsAdd($this->_current_exemplaire_operation);
-    $this->_current_exemplaire_operation = null;
   }
 
 
@@ -136,9 +130,7 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
    * @param string $data
    */
   public function endTitle($data) {
-    xdebug_break();
-    if ($this->_current_exemplaire_operation)
-      $this->_current_exemplaire_operation->getExemplaire()->setTitre($data);
+    $this->_current_exemplaire_operation->getExemplaire()->setTitre($data);
   }
 
 
@@ -146,8 +138,7 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
    * @param string $data
    */
   public function endDueDate($data) {
-    if ($this->_current_exemplaire_operation)
-      $this->_current_exemplaire_operation->setDateRetour($data);
+    $this->_current_exemplaire_operation->setDateRetour($data);
   }
 
 
@@ -155,11 +146,10 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
    * @param string $data
    */
   public function endItemBarcode($data) {
-    if ($this->_current_exemplaire_operation)
-      $this->_current_exemplaire_operation->setId($data)
-                                          ->getExemplaire()
-                                          ->setId($data)
-                                          ->setCodeBarre($data);
+    $this->_current_exemplaire_operation->setId($data)
+      ->getExemplaire()
+      ->setId($data)
+      ->setCodeBarre($data);
   }
 
 
@@ -167,8 +157,7 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
    * @param string $data
    */
   public function endPlaceInQueue($data) {
-    if ($this->_current_exemplaire_operation)
-      $this->_current_exemplaire_operation->setRang($data);
+    $this->_current_exemplaire_operation->setRang($data);
   }
 
 
@@ -176,8 +165,7 @@ class Class_WebService_SIGB_VSmart_BorrowerReader {
    * @param string $data
    */
   public function endReservationNumber($data) {
-    if ($this->_current_exemplaire_operation)
-      $this->_current_exemplaire_operation->setId($data);
+    $this->_current_exemplaire_operation->setId($data);
   }
 
 
diff --git a/tests/library/Class/WebService/SIGB/VSmartFixtures.php b/tests/library/Class/WebService/SIGB/VSmartFixtures.php
index 81f395920a7..5dce65080cb 100644
--- a/tests/library/Class/WebService/SIGB/VSmartFixtures.php
+++ b/tests/library/Class/WebService/SIGB/VSmartFixtures.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 
  */
 
 class VSmartFixtures {
@@ -178,20 +178,7 @@ class VSmartFixtures {
                 </Items>
               </Reservation>
             </Reservations>
-            <StackRequests>
-              <StackRequest>
-                <RequestNumber>DC00001093</RequestNumber>
-                <Status>Active</Status>
-                <RequestDateTime>26/11/2015 12:14:27</RequestDateTime>
-                <ExpiryDateTime>24/02/2016 23:59:00</ExpiryDateTime>
-                <Delivery>Liv</Delivery>
-                <HeldItem>RES_MCP271095</HeldItem>
-                <RecordId>1.179920</RecordId>
-                <Title>A Moulins...le marché cou</Title>
-                <MaterialType>LDA</MaterialType>
-                <MaterialType>LDA</MaterialType>
-              </StackRequest>
-            </StackRequests>
+            <StackRequests />
         </Borrower>
     </VubisSmart>';
   }
-- 
GitLab