diff --git a/VERSIONS b/VERSIONS index 94788f4ab439d94ea539854410d70ddc2b81f3af..dbaffdcca8be1b76c9561288f318364cec4d340c 100644 --- a/VERSIONS +++ b/VERSIONS @@ -1,3 +1,12 @@ +02/05/2014 - v6.42.3 + - ticket #13394: SIGB Koha: + - prise en compte de la balise <reserve_id> de la nouvelle version de Koha pour supprimer les réservations + - envoie l'annexe de retrait sur la réservation si précisé + +30/04/2014 - v6.42.2 + - 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/application/modules/opac/views/scripts/abonne/prets.phtml b/application/modules/opac/views/scripts/abonne/prets.phtml index 6c1ca2944c2442e6d1eed4b9b99d113906d47e0d..8a8f689f6bdbe7bb0a9db01edd98389055949f9e 100644 --- a/application/modules/opac/views/scripts/abonne/prets.phtml +++ b/application/modules/opac/views/scripts/abonne/prets.phtml @@ -9,7 +9,7 @@ if($this->fiche["erreur"]) echo '<p class="error">' . $this->fiche["erreur"] . ' <table width="100%" class="tablesorter"> <thead> <tr> - <th style="text-align:left"><?php echo $this->_('n°') ?></th> + <th style="text-align:left; white-space:nowrap"><?php echo $this->_('n°') ?></th> <th style="text-align:left"><?php echo $this->_('Titre') ?></th> <th style="text-align:left"><?php echo $this->_('Auteur') ?></th> <th style="text-align:left"><?php echo $this->_('Bibliothèque') ?></th> diff --git a/application/modules/opac/views/scripts/abonne/reservations.phtml b/application/modules/opac/views/scripts/abonne/reservations.phtml index daba51f16a31ab7ac7b1c19aaf7234385d9939f6..ab192d5e475c82bd43a44859d53b8776ecae2cfe 100644 --- a/application/modules/opac/views/scripts/abonne/reservations.phtml +++ b/application/modules/opac/views/scripts/abonne/reservations.phtml @@ -5,7 +5,7 @@ <table width="100%" class="tablesorter"> <thead> <tr> - <th style="text-align:left"><?php echo $this->_('n°');?></th> + <th style="text-align:left;white-space:nowrap"><?php echo $this->_('n°');?></th> <th style="text-align:left"><?php echo $this->_('Titre');?></th> <th style="text-align:left"><?php echo $this->_('Auteur');?></th> <th style="text-align:left"><?php echo $this->_('Bibliothèque');?></th> diff --git a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php index b3dd81dce1b7a3f491ad3249f468548d596e44b3..b03d973a77e430ffb01afc12a13d2a54ec0b4882 100644 --- a/library/Class/WebService/SIGB/Koha/PatronInfoReader.php +++ b/library/Class/WebService/SIGB/Koha/PatronInfoReader.php @@ -57,13 +57,29 @@ 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()); } + + + /** + * @param string $data + */ + public function endReserve_id($data) { + $this->_currentHold->setId((int)$data); + } } ?> \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Koha/Service.php b/library/Class/WebService/SIGB/Koha/Service.php index 757e5ba1a1d0062499b97584b6a2938873a85750..c409e9dabb4a472f14fe09855d49acdc7dc43a2c 100644 --- a/library/Class/WebService/SIGB/Koha/Service.php +++ b/library/Class/WebService/SIGB/Koha/Service.php @@ -79,11 +79,13 @@ class Class_WebService_SIGB_Koha_Service extends Class_WebService_SIGB_AbstractR * @return array */ public function reserverExemplaire($user, $exemplaire, $code_annexe) { - return $this->ilsdiHoldTitle( - array('patron_id' => $this->_authenticate($user), - 'bib_id' => $exemplaire->getIdOrigine(), - 'request_location' => '127.0.0.1'), - 'code'); + $args = ['patron_id' => $this->_authenticate($user), + 'bib_id' => $exemplaire->getIdOrigine(), + 'request_location' => '127.0.0.1']; + + if (trim($code_annexe)) $args['pickup_location'] = $code_annexe; + + return $this->ilsdiHoldTitle($args, 'code'); } diff --git a/library/startup.php b/library/startup.php index 21e0b56c4c7c2028c0a92770201e327731fdcbd6..5b6216a84b28093108f970c32c9026d000bb9348 100644 --- a/library/startup.php +++ b/library/startup.php @@ -56,7 +56,7 @@ function defineConstant($name, $value) { function setupConstants() { defineConstant('VERSION_PERGAME','6.42'); - defineConstant('RELEASE_NUMBER', VERSION_PERGAME.'.1'); + defineConstant('RELEASE_NUMBER', VERSION_PERGAME.'.3'); defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/'); diff --git a/tests/library/Class/WebService/SIGB/KohaFixtures.php b/tests/library/Class/WebService/SIGB/KohaFixtures.php index a258b29017d0dea8f8a3c139d8adf92131764e5f..eea7f7a738a218f58399c17d114512f4a1081ba6 100644 --- a/tests/library/Class/WebService/SIGB/KohaFixtures.php +++ b/tests/library/Class/WebService/SIGB/KohaFixtures.php @@ -638,6 +638,21 @@ class KohaFixtures { <itemnumber>24428</itemnumber> <title>Harry Potter et la coupe de feu</title> </hold> + <hold> + <priority>1</priority> + <item></item> + <reservedate>2014-05-02</reservedate> + <timestamp>2014-05-02 15:40:35</timestamp> + <biblionumber>235572</biblionumber> + <borrowernumber>17448</borrowernumber> + <branchcode>MPU</branchcode> + <branchname>MEDIATHEQUE PUBLIQUE ET UNIVERSITAIRE - VALENCE</branchname> + <constrainttype>a</constrainttype> + <lowestPriority>0</lowestPriority> + <suspend>0</suspend> + <title>Harry Potter et le prisonnier d\'Azkaban</title> + <reserve_id>1960</reserve_id> + </hold> </holds> <B_country></B_country> <borrowernumber>572</borrowernumber> diff --git a/tests/library/Class/WebService/SIGB/KohaTest.php b/tests/library/Class/WebService/SIGB/KohaTest.php index 5416169ba3349cb6f6e77a769f6ab06e1c05ee75..de25447fb1407f3ce6d6888a574a28a519895f2a 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') @@ -350,8 +358,8 @@ class KohaGetEmprunteurLaureAfondTest extends KohaTestCase { /** @test */ - function nbReservationsShouldReturnTwo() { - $this->assertEquals(2, $this->laurent->getNbReservations()); + function nbReservationsShouldReturnThree() { + $this->assertEquals(3, $this->laurent->getNbReservations()); } @@ -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,24 @@ 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()); + } + + + /** @test */ + function thirdReservationNoticeIdShouldBe235572() { + $this->assertEquals(235572, $this->laurent->getReservationAt(2)->getNoNotice()); + } + + /** @test */ + function thirdReservationIdShouldBe1960() { + $this->assertEquals(1960, $this->laurent->getReservationAt(2)->getId()); + } + } @@ -620,6 +651,22 @@ class KohaOperationsTest extends KohaTestCase { } + /** @test */ + function reserverExemplaireShouldSendPickupLocationIfGiven() { + $this->mock_web_client + ->expects($this->at(1)) + ->method('open_url') + ->with('http://cat-aficg55.biblibre.com/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=572&bib_id=89863&request_location=127.0.0.1&pickup_location=BLV') + ->will($this->returnValue('<HoldTitle> + <title>Mireille l\'abeille</title> + <pickup_location>Bibliothèque Départementale de la Meuse</pickup_location> + </HoldTitle>')); + + $this->assertEquals(array('statut' => true, 'erreur' => ''), + $this->service->reserverExemplaire($this->_lafond, $this->_exemplaire_mireille_abeille, 'BLV')); + } + + /** @test */ function reserverExemplaireShouldReturnErrorIfFail() {