From a8662bdbd05b04600a95456a0df2b95da5f9ec2b Mon Sep 17 00:00:00 2001
From: gloas <gloas@afi-sa.fr>
Date: Thu, 19 Jan 2017 09:29:09 +0100
Subject: [PATCH] hotline #50082 fix errors

---
 .../modules/telephone/views/scripts/abonne/fiche.phtml    | 2 +-
 library/Class/Exemplaire.php                              | 1 -
 library/ZendAfi/View/Helper/Abonne/Loans.php              | 2 +-
 library/ZendAfi/View/Helper/Telephone/Abonne/Holds.php    | 4 ++--
 library/ZendAfi/View/Helper/Telephone/Abonne/Loans.php    | 4 ++--
 .../ZendAfi/View/Helper/Telephone/Abonne/Operations.php   | 8 ++++----
 6 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/application/modules/telephone/views/scripts/abonne/fiche.phtml b/application/modules/telephone/views/scripts/abonne/fiche.phtml
index 59134f5a161..fbfa947f88e 100644
--- a/application/modules/telephone/views/scripts/abonne/fiche.phtml
+++ b/application/modules/telephone/views/scripts/abonne/fiche.phtml
@@ -43,5 +43,5 @@ echo $this->abonne_Loans($this->user, $cards->getLoansWithOutPNB(), $this->_('Me
 if ($this->user->hasPNB())
   echo $this->abonne_Loans($this->user, $this->user->getPNBLoans(), $this->_('Mes prêts numériques'));
 
-echo $this->abonne_Holds($cards->getHolds());
+echo $this->abonne_Holds($this->user, $cards->getHolds());
 ?>
diff --git a/library/Class/Exemplaire.php b/library/Class/Exemplaire.php
index 0d8939c1607..1d38354efad 100644
--- a/library/Class/Exemplaire.php
+++ b/library/Class/Exemplaire.php
@@ -31,7 +31,6 @@ class Class_ExemplaireLoader extends Storm_Model_Loader {
     if (!array_filter($params))
       return null;
 
-
     if(!($int_bibs = Class_IntBib::findAllAvailableForUser($user)) || $int_bibs->isEmpty())
       return null;
 
diff --git a/library/ZendAfi/View/Helper/Abonne/Loans.php b/library/ZendAfi/View/Helper/Abonne/Loans.php
index f10a2164b1a..c4aef2f5ea1 100644
--- a/library/ZendAfi/View/Helper/Abonne/Loans.php
+++ b/library/ZendAfi/View/Helper/Abonne/Loans.php
@@ -78,7 +78,7 @@ class ZendAfi_View_Helper_Abonne_Loans extends ZendAfi_View_Helper_BaseHelper {
   protected function renderLoan($user, $loan) {
     $record_title = $loan->getTitre();
     $record = new Class_Entity();
-    if($item = Class_Exemplaire::findFirstBySIGBOperation($user,$loan))
+    if($item = Class_Exemplaire::findFirstBySIGBOperation($user, $loan))
       $record = $item->getNotice();
 
     if ($record)
diff --git a/library/ZendAfi/View/Helper/Telephone/Abonne/Holds.php b/library/ZendAfi/View/Helper/Telephone/Abonne/Holds.php
index 7eedb7ccbdb..e08fabfa8ab 100644
--- a/library/ZendAfi/View/Helper/Telephone/Abonne/Holds.php
+++ b/library/ZendAfi/View/Helper/Telephone/Abonne/Holds.php
@@ -23,10 +23,10 @@
 class ZendAfi_View_Helper_Telephone_Abonne_Holds extends ZendAfi_View_Helper_Telephone_Abonne_Operations {
 
 
-  public function Abonne_Holds($holds) {
+  public function Abonne_Holds($user, $holds) {
     $this->_title = $this->_('Mes réservations');
     $this->_no_operation_text = $this->_('Vous n\'avez aucune reservation en cours');
-    return $this->abonne_Operations($holds);
+    return $this->abonne_Operations($user, $holds);
   }
 
 
diff --git a/library/ZendAfi/View/Helper/Telephone/Abonne/Loans.php b/library/ZendAfi/View/Helper/Telephone/Abonne/Loans.php
index c3cfdba70ed..371e8f306e9 100644
--- a/library/ZendAfi/View/Helper/Telephone/Abonne/Loans.php
+++ b/library/ZendAfi/View/Helper/Telephone/Abonne/Loans.php
@@ -22,10 +22,10 @@
 
 class ZendAfi_View_Helper_Telephone_Abonne_Loans extends ZendAfi_View_Helper_Telephone_Abonne_Operations {
 
-  public function abonne_Loans($loans, $title) {
+  public function abonne_Loans($user, $loans, $title) {
     $this->_no_operation_text = $this->_('Vous n\'avez aucun prêt en cours');
     $this->_title = $title;
-    return $this->abonne_Operations($loans);
+    return $this->abonne_Operations($user, $loans);
   }
 
 
diff --git a/library/ZendAfi/View/Helper/Telephone/Abonne/Operations.php b/library/ZendAfi/View/Helper/Telephone/Abonne/Operations.php
index efd0bfccfb9..160419351bb 100644
--- a/library/ZendAfi/View/Helper/Telephone/Abonne/Operations.php
+++ b/library/ZendAfi/View/Helper/Telephone/Abonne/Operations.php
@@ -24,12 +24,12 @@ class ZendAfi_View_Helper_Telephone_Abonne_Operations extends ZendAfi_View_Helpe
   protected
     $_operations = [],
     $_title = '',
-    $_no_operation_text = ''
-    ;
+    $_no_operation_text = '',
+    $_user;
 
-  public function abonne_Operations($operations) {
+  public function abonne_Operations($user, $operations) {
     $this->_operations = $operations;
-
+    $this->_user = $user;
     return $this->_tag('ul',
                        $this->_renderTitle() . $this->_renderOperations(),
                        ['data-role' => 'listview',
-- 
GitLab