diff --git a/VERSIONS b/VERSIONS index 94788f4ab439d94ea539854410d70ddc2b81f3af..993d3b7861667b2ef4d1eaea4ffd5be2341f98fc 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,6 @@ + - ticket #13394: SIGB Koha: récupère le site de retrait dans la liste des réservations (ILSDI élement <branchcode>) + - ticket #13383: liste des prêts et réservations: pas de retour à la ligne pour l'en-tête de la première colonne (n°) + 29/04/2014 - v6.42.1 Webservice SIGB Koha: diff --git a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php index b3dd81dce1b7a3f491ad3249f468548d596e44b3..9eae01b591c20718146f775c2fe0d6fd846baa8b 100644 --- a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php +++ b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php @@ -57,9 +57,17 @@ class Class_WebService_SIGB_Koha_PatronInfoReader extends Class_WebService_SIGB_ public function endHoldingbranch($data) { + if ($this->_currentLoan) $this->updateBibliothequeWith($data); + } + + + public function endBranchcode($data) { + if ($this->_currentHold) $this->updateBibliothequeWith($data); + } + + public function updateBibliothequeWith($data) { $data = trim($data); - if (!$this->_currentLoan || !$data - || !($site = Class_CodifAnnexe::findFirstBy(['code' => $data]))) + if (!$data || !($site = Class_CodifAnnexe::findFirstBy(['code' => $data]))) return; $this->_current_operation->getExemplaire()->setBibliotheque($site->getLibelle()); diff --git a/tests/library/Class/WebService/SIGB/KohaTest.php b/tests/library/Class/WebService/SIGB/KohaTest.php index 5416169ba3349cb6f6e77a769f6ab06e1c05ee75..db575d506ac19fe37704dcb5e606aa632c099e7e 100644 --- a/tests/library/Class/WebService/SIGB/KohaTest.php +++ b/tests/library/Class/WebService/SIGB/KohaTest.php @@ -321,6 +321,14 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { public function setUp() { parent::setUp(); + $this->fixture('Class_CodifAnnexe', ['id' => 33, + 'libelle' => 'Biblio Meuse', + 'code' => 'BDM']); + + $this->fixture('Class_CodifAnnexe', ['id' => 34, + 'libelle' => 'Montmedy', + 'code' => 'MON']); + $this->mock_web_client ->expects($this->at(0)) ->method('open_url') @@ -372,6 +380,11 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { $this->assertEquals(2, $this->laurent->getReservationAt(0)->getRang()); } + /** @test */ + function firstReservationBibliothequeShouldBeBiblioMeuse() { + $this->assertEquals('Biblio Meuse', $this->laurent->getReservationAt(0)->getBibliotheque()); + } + /** @test */ function reservationIdShouldBe27136() { @@ -395,6 +408,12 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { function secondReservationNoticeIdShouldBe27139() { $this->assertEquals(27139, $this->laurent->getReservationAt(1)->getNoNotice()); } + + + /** @test */ + function secondReservationBibliothequeShouldBeMontmedy() { + $this->assertEquals('Montmedy', $this->laurent->getReservationAt(1)->getBibliotheque()); + } }