diff --git a/VERSIONS_HOTLINE/105149 b/VERSIONS_HOTLINE/105149 new file mode 100644 index 0000000000000000000000000000000000000000..176d584ff1af5ffa9093c8d9ad990ce16d79c323 --- /dev/null +++ b/VERSIONS_HOTLINE/105149 @@ -0,0 +1 @@ + - ticket #105149 : Ne pas afficher le bouton "Réserver" dans le portail Bokeh si le status Koha est "Indisponible" \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php b/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php index 45f9323693063abc6347db0dec6cd296c24c80b0..2c71e276c91abf600653315d4bdd6692dba72313 100644 --- a/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php +++ b/library/Class/WebService/SIGB/Koha/GetRecordsResponseReader.php @@ -123,9 +123,9 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader { $this ->_handleItemWithdrawn() + ->_handleItemDateDue() ->_handleItemNotForLoan() ->_handleItemNumber() - ->_handleItemDateDue() ->_handleItemBarCode() ->_handleItemLost() ->_handleItemDamaged() @@ -253,11 +253,14 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader { $data = (string)$this->_xml_item->notforloan; if (!array_key_exists($data, $this->_not_for_loan_status) - || $this->_item->isPiege()) + || $this->_item->isPiege()) { + $this->_item->setReservable(false); return $this; + } if (0 < (int)$data) - $this->_item->notForLoan(); + $this->_item->notForLoan() + ->setReservable(false); if ('' == $this->_item->getDateRetour()) $this->_item->setDisponibilite($this->_not_for_loan_status[$data]); diff --git a/tests/fixtures/KohaFixtures.php b/tests/fixtures/KohaFixtures.php index 733cffc4684ee9a1b668f7f049173240af26029b..6fac4ea0fd43d75436ef75498f1168199da9f0c7 100644 --- a/tests/fixtures/KohaFixtures.php +++ b/tests/fixtures/KohaFixtures.php @@ -811,6 +811,30 @@ class KohaFixtures { <dateaccessioned>2011-02-18</dateaccessioned> <itype>LIV</itype> </item> + <!-- 12 --> + <item> + <biblioitemnumber>33270</biblioitemnumber> + <wthdrawn>0</wthdrawn> + <holdingbranchname>Bibliothèque Départementale de la Meuse</holdingbranchname> + <notforloan>8</notforloan> + <replacementpricedate>2011-02-18</replacementpricedate> + <itemnumber>0239427</itemnumber> + <ccode>ROMJEUN</ccode> + <itemcallnumber>JR ROW h</itemcallnumber> + <date_due></date_due> + <barcode>2661660441</barcode> + <itemlost>0</itemlost> + <datelastseen>2011-02-18</datelastseen> + <homebranch>BDM</homebranch> + <homebranchname>Bibliothèque Départementale de la Meuse</homebranchname> + <biblionumber>33233</biblionumber> + <holdingbranch>BDM</holdingbranch> + <timestamp>2011-02-18 14:24:01</timestamp> + <damaged>0</damaged> + <cn_sort>JR_ROW_H</cn_sort> + <dateaccessioned>2011-02-18</dateaccessioned> + <itype>LIV</itype> + </item> </items> </record> </GetRecords>'; diff --git a/tests/library/Class/WebService/SIGB/KohaTest.php b/tests/library/Class/WebService/SIGB/KohaTest.php index 251fb60af1d46399cead49f8472c028be1886769..20f8fc948d4b3fe4310ff41e53e6f5f73b68999d 100644 --- a/tests/library/Class/WebService/SIGB/KohaTest.php +++ b/tests/library/Class/WebService/SIGB/KohaTest.php @@ -233,8 +233,8 @@ class KohaServiceGetNoticeHarryPotterTest extends KohaServiceGetNoticeHarryPotte /** @test */ - public function getExemplairesShouldReturnAnArrayWithSizeEleven() { - $this->assertEquals(11, count($this->potter->getExemplaires())); + public function getExemplairesShouldReturnAnArrayWithSizeTwelve() { + $this->assertEquals(12, count($this->potter->getExemplaires())); } /** @test */ @@ -382,6 +382,12 @@ class KohaServiceGetNoticeHarryPotterTest extends KohaServiceGetNoticeHarryPotte public function eleventhExemplaireShouldNotBePilonne() { $this->assertFalse($this->potter->exemplaireAt(10)->isPilonne()); } + + + /** @test */ + public function twelfthExemplaireShouldNotBeReservable() { + $this->assertFalse($this->potter->exemplaireAt(11)->isReservable()); + } }