diff --git a/library/Class/Indexation.php b/library/Class/Indexation.php index 11412d3b370911ba00e65984e92ece95f12c285e..dd2fe3c43b8cc9b69ce27b00cf8841432410e5e1 100644 --- a/library/Class/Indexation.php +++ b/library/Class/Indexation.php @@ -97,8 +97,7 @@ class Class_Indexation { ."AAAAAAACEEEEIIII NOOOOO UUUUY AAAAAAACEEEEIIII NOOOOO UUUUY Y"; } - public function getClefAlpha($type_doc, $titre, $complement_titre, - $auteur, $tome, $editeur, $annee) { + public function getClefAlpha($type_doc, $titre, $complement_titre, $auteur, $tome, $editeur, $annee) { $clef = $this->getClefOeuvre($titre, $complement_titre, $auteur, $tome) . '-'; $clef .= substr($this->alphaMaj(str_replace(' ', '', $editeur)), 0, 80) . '-'; $clef .= $annee . '-'; diff --git a/library/Class/Indexation/PseudoNotice.php b/library/Class/Indexation/PseudoNotice.php index 57539ad1d3bb8c6de7369b0075d5010d61cafb82..391fb62a5285c393b3ed1c75669b1dfecde20e6a 100644 --- a/library/Class/Indexation/PseudoNotice.php +++ b/library/Class/Indexation/PseudoNotice.php @@ -130,6 +130,14 @@ class Class_Indexation_PseudoNotice { } + + protected function _getAuthorNames() { + $names = []; + foreach($this->extractAuthors() as $author) + $names []= $author->getName(); + return $names; + } + protected function _index() { $unimarc = $this->_getUnimarc(); $data = []; @@ -138,8 +146,8 @@ class Class_Indexation_PseudoNotice { $data['matieres'] = $this->extractFullTextFromCodif($data, 'matiere', 'Class_CodifMatiere'); - - $authors = $this->extractAuthors(); + $authors = $this->_getAuthorNames(); + $data["alpha_titre"] = $this->_indexation->codeAlphaTitre($this->_datas["titre"]); $data["clef_alpha"] = $this->_indexation->getClefAlpha($this->_notice->getTypeDoc(), diff --git a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php index 7d1380d882c180e905079e32e5a0428f8b262942..0a54981acbd4b8baa3cfc22f49ee5b1e5302ec45 100644 --- a/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php +++ b/tests/application/modules/opac/controllers/RechercheControllerAlbumAudioRecordTest.php @@ -114,6 +114,13 @@ class RechercheControllerAlbumAudioRecordViewNoticeTest extends RechercheControl } + /** @test */ + public function clefAlphaShouldBeSEVENTHSON_IRONMAIDEN() { + $this->assertEquals('SEVENTHSONOFASEVENTHSON--IRONMAIDENBRUCEDICKINSONSTEVEHARRISDAVEMURRAYNICKOMCBRAINADRIANSMITH----109', + $this->_notice->getClefAlpha()); + } + + /** @test */ public function noticeShouldNotHaveUrlImageSet() { $this->assertEmpty($this->_notice->getUrlImage());