diff --git a/VERSIONS_HOTLINE/89072 b/VERSIONS_HOTLINE/89072 new file mode 100644 index 0000000000000000000000000000000000000000..d4d6e421a5bd2d04c4d42f9fdfc83fc1a75b0538 --- /dev/null +++ b/VERSIONS_HOTLINE/89072 @@ -0,0 +1 @@ + - ticket #89072 : SIGB Carthame : prise en compte du statut de prolongation des prêts \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Carthame/AccountResponseReader.php b/library/Class/WebService/SIGB/Carthame/AccountResponseReader.php index 5a584799ad7f94bef83a4bebf7a3c9eaa16efb1b..4ac52f801835d26e5bba7364c9679b439fc269db 100644 --- a/library/Class/WebService/SIGB/Carthame/AccountResponseReader.php +++ b/library/Class/WebService/SIGB/Carthame/AccountResponseReader.php @@ -78,6 +78,14 @@ class Class_WebService_SIGB_Carthame_AccountResponseReader { } + public function endSFl($data) { + if (!$this->_xml_parser->inParents('F400')) + return; + + $this->_current_emprunt->setRenewable($data === '0'); + } + + public function endSFa($data) { $data = (string)$data; diff --git a/tests/library/Class/WebService/SIGB/CarthameTest.php b/tests/library/Class/WebService/SIGB/CarthameTest.php index 30da6acc752cc049be47b19d663cd2931bd581f1..44a889144fa64203af73cb93719c6812a245ee11 100644 --- a/tests/library/Class/WebService/SIGB/CarthameTest.php +++ b/tests/library/Class/WebService/SIGB/CarthameTest.php @@ -722,6 +722,12 @@ class CarthameEmprunteurPatrickBTest extends CarthameOperationTestCase { } + /** @test */ + public function firstEmpruntShouldBeRenewable() { + $this->assertTrue($this->emprunteur->getEmpruntAt(0)->isRenewable()); + } + + /** @test */ public function secondEmpruntCopyIdShouldBe46666() { $this->assertEquals('46666', $this->emprunteur->getEmpruntAt(1)->getExemplaire()->getId()); @@ -734,6 +740,12 @@ class CarthameEmprunteurPatrickBTest extends CarthameOperationTestCase { } + /** @test */ + public function secondEmpruntShouldNotBeRenewable() { + $this->assertFalse($this->emprunteur->getEmpruntAt(1)->isRenewable()); + } + + /** @test */ public function firstReservationCopyNoticeShouldBeMillenium() { $this->assertEquals('Millenium', $this->emprunteur->getReservationAt(0)->getExemplaire()->getNoNotice()); @@ -1164,14 +1176,14 @@ class CarthameTestFixtures { <SFb>20110505</SFb> <SFc>20110526</SFc> <SFk>45699</SFk> - <SFl>-2</SFl> + <SFl>0</SFl> </F400> <F400> <SFa>Z6PO</SFa> <SFb>20110505</SFb> <SFc>20370526</SFc> <SFk>46666</SFk> - <SFl>-2</SFl> + <SFl>-7</SFl> </F400> <F500> <SFa>Millenium</SFa>