diff --git a/library/Class/Systeme/ModulesMenu/Vodeclic.php b/library/Class/Systeme/ModulesMenu/Vodeclic.php index 296d616f0ffab00843d31f4692fa26a78f9e0818..3891a392a16a71f871ae215ee1590959064dda83 100644 --- a/library/Class/Systeme/ModulesMenu/Vodeclic.php +++ b/library/Class/Systeme/ModulesMenu/Vodeclic.php @@ -41,7 +41,7 @@ class Class_Systeme_ModulesMenu_Vodeclic extends Class_Systeme_ModulesMenu_Null } - public function shouldOpenInNewWindow() { + public function shouldOpenInNewWindow($preferences) { return null != Class_Users::getIdentity(); } diff --git a/library/Class/WebService/SIGB/Emprunteur.php b/library/Class/WebService/SIGB/Emprunteur.php index dcb9672c0cf667f7aba2dc3f57b044a2abb9618e..5d7c0b677c735edb17c03fd8878618804dc281dc 100644 --- a/library/Class/WebService/SIGB/Emprunteur.php +++ b/library/Class/WebService/SIGB/Emprunteur.php @@ -20,21 +20,29 @@ */ class Class_WebService_SIGB_Emprunteur { - protected $_id; - protected $_name; - protected $_emprunts; - protected $_reservations; - protected $_email; - protected $_nom = null; - protected $_prenom = null; - protected $_password = null; - protected $_nb_reservations = null; - protected $_nb_emprunts = null; - protected $_nb_retards = null; - protected $_service = null; - protected $_valid = false; - protected $_end_date = null; - + protected + $_id, + $_name, + $_emprunts, + $_reservations, + $_email, + $_nom = null, + $_prenom = null, + $_password = null, + $_nb_reservations = null, + $_nb_emprunts = null, + $_nb_retards = null, + $_service = null, + $_valid = false, + $_end_date = null, + $_ordre, + $_code_barres, + $_adresse, + $_ville, + $_code_postal, + $_telephone, + $_date_naissance; + public function __sleep() { $this->getEmprunts(); @@ -50,7 +58,12 @@ class Class_WebService_SIGB_Emprunteur { '_nb_reservations', '_nb_emprunts', '_nb_retards', - '_end_date']; + '_end_date', + '_ordre', + '_code_barres', + '_adresse', + '_ville', + '_code_postal']; } @@ -104,6 +117,133 @@ class Class_WebService_SIGB_Emprunteur { } + /** + * @param string $code_barres + * @return Class_WebService_SIGB_Emprunteur + */ + public function setCodeBarres($code_barres) { + $this->_code_barres = $code_barres; + return $this; + } + + + /** + * @return string + */ + public function getCodeBarres(){ + return $this->_code_barres; + } + + + /** + * @param string $adresse + * @return Class_WebService_SIGB_Emprunteur + */ + public function setAdresse($adresse) { + $this->_adresse = $adresse; + return $this; + } + + + /** + * @return string + */ + public function getAdresse(){ + return $this->_adresse; + } + + + /** + * @param string $code_postal + * @return Class_WebService_SIGB_Emprunteur + */ + public function setCodePostal($code_postal) { + $this->_code_postal = $code_postal; + return $this; + } + + + /** + * @return string + */ + public function getCodePostal(){ + return $this->_code_postal; + } + + + /** + * @param string $ville + * @return Class_WebService_SIGB_Emprunteur + */ + public function setVille($ville) { + $this->_ville = $ville; + return $this; + } + + + /** + * @return string + */ + public function getVille(){ + return $this->_ville; + } + + + /** + * @param string $ordre + * @return Class_WebService_SIGB_Emprunteur + */ + public function setOrdre($ordre) { + $this->_ordre = $ordre; + return $this; + } + + + /** + * @return string + */ + public function getOrdre(){ + return $this->_ordre; + } + + + /** + * @param string $telephone + * @return Class_WebService_SIGB_Emprunteur + */ + public function setTelephone($telephone) { + $this->_telephone = $telephone; + return $this; + } + + + /** + * @return string + */ + public function getTelephone(){ + return $this->_telephone; + } + + + /** + * @param string $date_naissance + * @return Class_WebService_SIGB_Emprunteur + */ + public function setDateNaissance($date_naissance) { + $this->_date_naissance = $date_naissance; + return $this; + } + + + /** + * @return string + */ + public function getDateNaissance(){ + return $this->_date_naissance; + } + + + /** * @param array $emprunts * @return Class_WebService_SIGB_Emprunteur @@ -277,6 +417,7 @@ class Class_WebService_SIGB_Emprunteur { return $this; } + /** * @return string */ @@ -381,6 +522,13 @@ class Class_WebService_SIGB_Emprunteur { return $this; } + /** + * @return string + */ + public function getIdAbon() { + return $this->_code_barres ? $this->_code_barres : $this->getId(); + } + public function updateFromUserAndSave($user) { $this @@ -438,13 +586,31 @@ class Class_WebService_SIGB_Emprunteur { */ public function updateUser($user) { $user - ->setIdabon($this->getId()) + ->setIdabon($this->getIdAbon()) ->setNom($this->getNom()) ->setPrenom($this->getPrenom()) ->setMail($this->getEmail()); if ($this->_end_date) $user->setDateFin($this->getEndDate()); + + if ($this->_adresse) + $user->setAdresse($this->_adresse); + + if ($this->_code_postal) + $user->setCodePostal($this->_code_postal); + + if ($this->_ville) + $user->setVille($this->_ville); + + if ($this->_ordre) + $user->setOrdreabon($this->_ordre); + + if ($this->_telephone) + $user->setTelephone($this->_telephone); + + if ($this->_date_naissance) + $user->setNaissance($this->_date_naissance); } diff --git a/library/Class/WebService/SIGB/Nanook/PatronInfoReader.php b/library/Class/WebService/SIGB/Nanook/PatronInfoReader.php index 0c16806267ae826577f07ce62ae9715299874a91..af695a7a446b551bccafa3f965f48fcb6eb0e176 100644 --- a/library/Class/WebService/SIGB/Nanook/PatronInfoReader.php +++ b/library/Class/WebService/SIGB/Nanook/PatronInfoReader.php @@ -51,6 +51,62 @@ class Class_WebService_SIGB_Nanook_PatronInfoReader extends Class_WebService_SIG $this->getEmprunteur()->setEmail($data); } + + /** + * @param string $data + */ + public function endBarcode($data) { + $this->_emprunteur->setCodeBarres($data); + } + + + /** + * @param string $data + */ + public function endAddress($data) { + $this->_emprunteur->setAdresse($data); + } + + + /** + * @param string $data + */ + public function endTown($data) { + $this->_emprunteur->setVille($data); + } + + + /** + * @param string $data + */ + public function endZipCode($data) { + $this->_emprunteur->setCodePostal($data); + } + + + /** + * @param string $data + */ + public function endPhoneNumber($data) { + $this->_emprunteur->setTelephone($data); + } + + + /** + * @param string $data + */ + public function endDisplayOrder($data) { + $this->_emprunteur->setOrdre($data); + } + + + /** + * @param string $data + */ + public function endBirthDate($data) { + $this->_emprunteur->setDateNaissance($data); + } + /** * @param string $data @@ -103,6 +159,5 @@ class Class_WebService_SIGB_Nanook_PatronInfoReader extends Class_WebService_SIG if ('' != $data) $this->_currentHold->setEtat('Pas disponible avant le ' . $data); } - } ?> \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/MenuHorizontal.php b/library/ZendAfi/View/Helper/MenuHorizontal.php index e13c11cd1da740e5dbe57e9ffcc410da23b4e16d..4bcb5d20c80fd7e604258e223b8e808e2b569685 100644 --- a/library/ZendAfi/View/Helper/MenuHorizontal.php +++ b/library/ZendAfi/View/Helper/MenuHorizontal.php @@ -44,7 +44,7 @@ class ZendAfi_View_Helper_MenuHorizontal extends ZendAfi_View_Helper_BaseHelper return '<div id="'.$tag_id.'" class="menu_horizontal">' .$this->tagEditMenu() - .$helper->getBoite() // .$this->renderMenus($menus, '', 'menu') + .$helper->getBoite() .'</div>'; } diff --git a/tests/library/Class/WebService/SIGB/NanookFixtures.php b/tests/library/Class/WebService/SIGB/NanookFixtures.php index 28888d1371fdef9ff6b7c3700f9ac6f2d98ae804..3f130263963969f5690d58a5b1ebac1c084a606d 100644 --- a/tests/library/Class/WebService/SIGB/NanookFixtures.php +++ b/tests/library/Class/WebService/SIGB/NanookFixtures.php @@ -166,7 +166,14 @@ class NanookFixtures { <lastName>DELPEYROUX</lastName> <firstName>Christel</firstName> <endDate>2012-12-21</endDate> + <birthDate>1978-11-10</birthDate> <mail>cdelpeyroux@server.com</mail> + <barcode>03456</barcode> + <displayOrder>2</displayOrder> + <address>1 rue des fleurs</address> + <town>Annecy</town> + <zipcode>74000</zipcode> + <phoneNumber>01 23 45 67 89</phoneNumber> <loans> <loan> <bibId>117661</bibId> diff --git a/tests/library/Class/WebService/SIGB/NanookTest.php b/tests/library/Class/WebService/SIGB/NanookTest.php index bc11ca43ed026278c250cc8e4a8f0601bfd08c45..f50bd455ac269f23f0214e5b9a8e7693f09968a3 100644 --- a/tests/library/Class/WebService/SIGB/NanookTest.php +++ b/tests/library/Class/WebService/SIGB/NanookTest.php @@ -373,11 +373,10 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { ->with('http://localhost:8080/afi_Nanook/ilsdi/service/GetPatronInfo/patronId/1') ->answers(NanookFixtures::xmlGetPatronChristelDelpeyroux()); - $this->_emprunteur = $this->_service->getEmprunteur( - Class_Users::getLoader() - ->newInstance() - ->setIdSigb(1) - ); + $this->_chrystel = Class_Users::newInstance(['id_sigb' => 1]); + $this->_emprunteur = $this->_service->getEmprunteur($this->_chrystel); + $this->_emprunteur->updateUser($this->_chrystel); + Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire') ->whenCalled('findFirstBy') ->answers(null); @@ -424,6 +423,48 @@ class NanookGetEmprunteurChristelDelpeyrouxTest extends NanookTestCase { public function mailShouldBeCdelpeyrouxAtServerDotCom() { $this->assertEquals('cdelpeyroux@server.com', $this->_emprunteur->getEmail()); } + + + /** @test */ + public function codeBarresShouldBe03456() { + $this->assertEquals('03456', $this->_emprunteur->getCodeBarres()); + } + + + /** @test */ + public function addresseShouldBeOneRueDesFleurs() { + $this->assertEquals('1 rue des fleurs', $this->_emprunteur->getAdresse()); + } + + + /** @test */ + public function codePostalShouldBe74000() { + $this->assertEquals('74000', $this->_emprunteur->getCodePostal()); + } + + + /** @test */ + public function villeShouldBeAnnecy() { + $this->assertEquals('Annecy', $this->_emprunteur->getVille()); + } + + + /** @test */ + public function ordreShouldBeTwo() { + $this->assertEquals(2, $this->_emprunteur->getOrdre()); + } + + + /** @test */ + public function userShouldBeUpdated() { + $this->assertEquals('03456', $this->_chrystel->getIdabon()); + $this->assertEquals('1 rue des fleurs', $this->_chrystel->getAdresse()); + $this->assertEquals('74000', $this->_chrystel->getCodePostal()); + $this->assertEquals('Annecy', $this->_chrystel->getVille()); + $this->assertEquals(2, $this->_chrystel->getOrdreabon()); + $this->assertEquals('01 23 45 67 89', $this->_chrystel->getTelephone()); + $this->assertEquals('1978-11-10', $this->_chrystel->getNaissance()); + } /** @test */