diff --git a/cosmogramme/php/classes/classe_notice_integration.php b/cosmogramme/php/classes/classe_notice_integration.php index bab6e2565e82558e42d5a9f967c0c38f470ceb6a..bd8c8fc7c2092adf1799a9896d39c214fe95e8e6 100644 --- a/cosmogramme/php/classes/classe_notice_integration.php +++ b/cosmogramme/php/classes/classe_notice_integration.php @@ -118,6 +118,7 @@ class notice_integration { public function traiteNotice($data) { global $sql; + $id_bib=$this->id_bib; if(! $this->analyseur ) return false; $this->statut=0; @@ -160,6 +161,7 @@ class notice_integration { // suppression ou creation des articles si périodique if($this->notice["type_doc"]==2) { + // Periodiques Koha et orphee (1 exemplaire pour chaque numéro) if(($this->id_article_periodique==3 or $this->id_article_periodique==4) and $this->flag_koha==false) { @@ -780,6 +782,8 @@ class notice_integration { public function traiteFacettes() { global $sql; + + $facettes = []; // Virer les facettes sauf les tags $controle=explode(" ",$this->notice["facettes"]); $this->notice["facettes"]=""; @@ -789,6 +793,12 @@ class notice_integration { if($tp =="Z") $this->notice["facettes"].=" ".$controle[$i]; } + if($type_doc = $this->notice['infos_type_doc']) { + if($code_type_doc = $type_doc['code']){ + $facettes[] = 'T'.$code_type_doc; + } + } + // Dewey if($this->notice["dewey"]) { diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php index 2e6fac6ce87e570243327219abfb44e939eb2df7..8893eeb53508fce9ea4c695f6e57af332bcac134 100644 --- a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php +++ b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php @@ -1661,4 +1661,10 @@ class NoticeIntegrationUnimarcKohaFacetteTest extends NoticeIntegrationTestCase public function clefAlphaShouldBeAsExpected() { $this->assertEquals('OKAPI---955-BAYARD--2', Class_Notice::find(1)->getClefAlpha()); } + + + /** @test */ + public function contextShouldExpectation() { + $this->assertContains('T2', Class_Notice::find(1)->getFacettes()); + } } \ No newline at end of file