diff --git a/application/modules/opac/controllers/CatalogueController.php b/application/modules/opac/controllers/CatalogueController.php index 360d0c58fadf322facfc5296e122d9a6e59add6a..a3555b88ac1c3cf1c8fc9f551ac767c7c5533759 100644 --- a/application/modules/opac/controllers/CatalogueController.php +++ b/application/modules/opac/controllers/CatalogueController.php @@ -75,8 +75,7 @@ class CatalogueController extends Zend_Controller_Action //------------------------------------------------------------------------------------------------------ // Appel par une ligne de menu //------------------------------------------------------------------------------------------------------ - function appelmenuAction() - { + function appelmenuAction() { // Moteur de recherche $moteur=new Class_MoteurRecherche(); if (!array_isset("recherche", $_SESSION)) $_SESSION["recherche"] = array(); diff --git a/library/Class/ListeNotices.php b/library/Class/ListeNotices.php index fc9feceaffdd140433267e6f6de16dcd90349762..564e92fc057fdff269ddd000430d240d08a10784 100644 --- a/library/Class/ListeNotices.php +++ b/library/Class/ListeNotices.php @@ -53,28 +53,31 @@ class Class_ListeNotices $ret = array(); $fin_limit = 0; - if(strpos($req," LIMIT ") === false) - { + if(strpos($req," LIMIT ") === false) { $limit = ($page-1) * $this->nb_par_page; $limit = " LIMIT ".$limit.",". $this->nb_par_page; $req.=$limit; } - else - { + else { $debut_limit=($page-1) * $this->nb_par_page; $fin_limit=$this->nb_par_page; } // Execute la requete - if (!$ids=fetchAll($req)) - $ids = []; + if (!$rows=fetchAll($req)) + $rows = []; if ($fin_limit) - $ids=array_slice($ids, $debut_limit, $fin_limit); + $rows=array_slice($rows, $debut_limit, $fin_limit); - if (!$ids) + if (!$rows) return []; + $ids = []; + foreach($rows as $row) { + $ids []= $row['id_notice']; + } + return Class_Notice::findAllBy(['id_notice' => $ids]); } diff --git a/library/Class/Users.php b/library/Class/Users.php index 634e3c83723f801871f80ed2b17fc1a0aea4b312..a26422c97aa335c3d94ce2d60ddb0e92927705d7 100644 --- a/library/Class/Users.php +++ b/library/Class/Users.php @@ -832,17 +832,19 @@ class Class_Users extends Storm_Model_Abstract { $user = $this; // compatibilité if (isset($this->_fiche_sigb)) - return $this->_fiche_sigb; - - if (!$user->getIdabon()) - $ret = ["message" => $this->_translate->_("Vous devez vous connecter en tant qu'abonné de la bibliothèque pour obtenir plus d'informations.")]; - else - $ret = (new Class_CommSigb())->ficheAbonne($user); + $ret = $this->_fiche_sigb; + else { + if (!$user->getIdabon()) + $ret = ["message" => $this->_translate->_("Vous devez vous connecter en tant qu'abonné de la bibliothèque pour obtenir plus d'informations.")]; + else + $ret = (new Class_CommSigb())->ficheAbonne($user); + } if (!isset($ret['fiche'])) $ret['fiche'] = Class_WebService_SIGB_Emprunteur::nullInstance(); - $ret["nom_aff"] = $this->getNomAff($user->ID_USER, true); + if (!isset($ret['nom_aff'])) + $ret["nom_aff"] = $this->getNomAff($user->ID_USER, true); $this->_fiche_sigb = $ret; return $ret; diff --git a/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php b/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php index 6064ccf19ad914870979824e3c668abd83b56cc0..3ab38128a1a0df69bccaec45cd075f79e8f3004b 100644 --- a/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php +++ b/tests/application/modules/opac/controllers/AbonneControllerNewslettersTest.php @@ -38,7 +38,8 @@ abstract class AbstractAbonneControllerNewslettersTestCase extends AbstractContr ->setPseudo('mimi') ->setDateDebut(null) ->setPassword('mysecret') - ->setFicheSIGB(array('type_comm' => 0, 'nom_aff' => 'Marcus')) + ->setFicheSIGB(['type_comm' => 0, + 'nom_aff' => 'Marcus']) ->setRole('abonne_sigb') ->setRoleLevel(3) ->setIdSite(2)