diff --git a/library/Class/Exemplaire.php b/library/Class/Exemplaire.php index c0c37662fecce5f10022116756728eec589c3237..08393715f000c14242591b22e671f5dc78bb67ca 100644 --- a/library/Class/Exemplaire.php +++ b/library/Class/Exemplaire.php @@ -30,6 +30,10 @@ class Class_Exemplaire extends Storm_Model_Abstract { 'bib' => ['model' => 'Class_Bib', 'referenced_in' => 'id_bib'], + 'site' => ['model' => 'Class_CodifAnnexe', + 'referenced_in' => 'annexe'], + + 'album' => ['model' => 'Class_Album', 'referenced_in' => 'id_origine'], @@ -54,6 +58,13 @@ class Class_Exemplaire extends Storm_Model_Abstract { } + public function getLibelleSite() { + if (!$site = $this->getSite()) + return ''; + return $site->getLibelle(); + } + + public function getDateRetour() { if ($this->hasPret()) return $this->getPret()->getDateRetour(); diff --git a/library/Class/WebService/SIGB/Orphee/GetLstPretResponseReader.php b/library/Class/WebService/SIGB/Orphee/GetLstPretResponseReader.php index 08331069061bdc330241a7fc0380fc0c21a431d7..f75ff4735515aee4de5a252ee42fcffb45a74bb7 100644 --- a/library/Class/WebService/SIGB/Orphee/GetLstPretResponseReader.php +++ b/library/Class/WebService/SIGB/Orphee/GetLstPretResponseReader.php @@ -87,7 +87,7 @@ class Class_WebService_SIGB_Orphee_GetLstPretResponseReader extends Class_WebSer $this->_current_emprunt->getExemplaire()->setNoNotice($notice->getId()); $this->_current_emprunt->setTitre($notice->getTitrePrincipal()); - $this->_current_emprunt->getExemplaire()->setBibliotheque($exemplaire_opac->getBib()->getLibelle()); + $this->_current_emprunt->getExemplaire()->setBibliotheque($exemplaire_opac->getLibelleSite()); $this->_current_emprunt->setAuteur($notice->getAuteurPrincipal()); } } diff --git a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php index cee33ca145cd2c891b7c144a257bbfbe987c7667..7794d8dfeadc850c610ea39ead273ec0dfaf20e4 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php @@ -133,6 +133,11 @@ class RechercheControllerAlbumAudioRecordViewNoticeTest extends RechercheControl $this->assertEquals('unknown', $this->_notice->getMorceaux()['morceaux'][1][3]['titre']); } + + /** @test */ + public function titresFulltextShouldContainsMOONCHILD() { + $this->assertContains('MOONCHILD', $this->_notice->getRawAttributes()['titres']); + } } diff --git a/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php b/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php index 72b973709e3bb6014fe52b5f9b956b96618a2c96..7d4a6909433453134627b0919ec3d45060a376ef 100644 --- a/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php +++ b/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php @@ -716,14 +716,16 @@ class OrpheeServiceGetInfoUserCarteHenryDupontTest extends OrpheeServiceTestCase $ex_potter = Class_Exemplaire::getLoader() ->newInstanceWithId(23) ->setCodeBarres('123456') - ->setBib(Class_Bib::getLoader() - ->newInstanceWithId(3) - ->setLibelle('Annecy Bonlieu')) + ->setAnnexe(3) ->setNotice(Class_Notice::getLoader() ->newInstanceWithId(5) ->setTitrePrincipal('Harry Potter') ->setAuteurPrincipal('Rowling')); + Class_CodifAnnexe::getLoader() + ->newInstanceWithId(3) + ->setLibelle('Annecy Bonlieu'); + $ex_chemin = Class_Exemplaire::getLoader() ->newInstanceWithId(32)