Skip to content
Snippets Groups Projects
Commit c65b9db6 authored by Arthur Suzuki's avatar Arthur Suzuki
Browse files

Merge branch 'hotline#180669_artecampus_note_fields' into 'master'

[RTok] hotline#180669 : Artecampus imports note field in 300$a

See merge request !4758
parents 5b12ec2c 4b598601
Branches
Tags
1 merge request!4758[RTok] hotline#180669 : Artecampus imports note field in 300$a
Pipeline #23745 canceled with stage
- correctif #180669 : Connecteur Arte Campus : le champ Note est désormais importé en 300$a.
\ No newline at end of file
......@@ -80,6 +80,7 @@ class Class_Album extends Storm_Model_Abstract {
const EDITOR_FIELD = '210';
const COLLECTION_FIELD = '225';
const DISTRIBUTOR_FIELD = '306$a';
const NOTE_FIELD = '300$a';
const THUMB_PREFIX = 'thumb_';
const STATUS_DRAFT = 1;
......
......@@ -27,6 +27,7 @@ class ArteCampus_Service_Program extends Class_WebService_BibNumerique_Ressource
protected
$_directors = [],
$_note,
$_status;
......@@ -52,7 +53,7 @@ class ArteCampus_Service_Program extends Class_WebService_BibNumerique_Ressource
$this->addTag($version['language']);
$this->_status = $json['status'];
$this->_note = $json['editorial']['note'] ?? '';
return $this;
}
......@@ -64,6 +65,7 @@ class ArteCampus_Service_Program extends Class_WebService_BibNumerique_Ressource
public function fillAlbum(Class_Album $album) : self {
$album->setVisible(true)
->addNote(Class_Album::NOTE_FIELD, $this->_note)
->setTypeDocId(ArteCampus_Config::getInstance()->getDocType())
->getMarc()->clearZone('856');
......
......@@ -322,6 +322,13 @@ class ArteCampusHarvestAlbumCreationTest extends ModelTestCase {
$this->assertTrue($index_200a < $index_200e,
sprintf('200$a : %s , 200$e : %s', $index_200a, $index_200e));
}
/** @test */
public function field300DollarAShouldContainsKarambolageEstUneSuperEmission() {
$this->assertEquals("Karambolage est une super émission!",
$this->_album->getNote(Class_Album::NOTE_FIELD));
}
}
......
......@@ -71,6 +71,7 @@
"Économie",
"Science politique"
],
"note":"Karambolage est une super émission!",
"scolarshipLevels": [],
"keywords": [
"hamburger",
......
......@@ -149,7 +149,7 @@ class Bacon_Service_Parser {
public function endNotes($data) {
$this->_current_album->addNote('300$a', $data);
$this->_current_album->addNote(Class_Album::NOTE_FIELD, $data);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment