Commit fc1408f8 authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT

hotline#132508 : thumbnail_fields is used to get url_image and url_vignette...

hotline#132508 : thumbnail_fields is used to get url_image and url_vignette for a record when using Koha or Nanook
parent 00fa0ca3
Pipeline #13525 passed with stage
in 70 minutes and 58 seconds
- hotline #132508 : Integration Notice : les champs url renseignées pour les vignettes dans le profil par défaut de Bokeh sont maintenant prioritaires pour Koha et Nanook
\ No newline at end of file
......@@ -548,36 +548,41 @@ class notice_integration {
public function noticeToDBEnreg() {
return ['type_doc' => $this->notice['type_doc'],
'alpha_titre' => $this->notice['alpha_titre'],
'alpha_auteur' => $this->notice['alpha_auteur'],
'titres' => $this->indexation->getfullText(array_merge($this->notice['titres'],
[$this->notice['clef_chapeau'],
$this->notice['tome_alpha']])),
'auteurs' => $this->indexation->getfullText($this->_getFulltextAuthors()),
'other_terms'=> $this->indexation->getfulltext($this->notice['other_terms']),
'editeur' => $this->indexation->getfullText($this->notice['editeur']),
'collection' => $this->indexation->getfullText($this->notice['collection']),
'matieres' => $this->indexation->getfullText($this->_getFulltextSubjects()),
'dewey' => $this->indexation->getfullText($this->notice['full_dewey']),
'file_content' => $this->notice['file_content'],
'facettes' => $this->notice['facettes'],
'isbn' => $this->notice['isbn'],
'ean' => $this->notice['ean'],
'issn' => $this->notice['issn'],
'id_commerciale' => $this->notice['id_commerciale'],
'clef_alpha' => $this->notice['clef_alpha'],
'clef_chapeau' => $this->notice['clef_chapeau'],
'clef_oeuvre' => $this->notice['clef_oeuvre'],
'tome_alpha' => $this->notice['tome_alpha'],
'annee' => $this->notice['annee'],
'qualite' => $this->notice['qualite'],
'exportable' => $this->notice['exportable'],
'cote' => $this->notice['cote'],
'unimarc' => $this->notice['unimarc'],
'date_maj' => dateDuJour(2)];
$notice_enreg = ['type_doc' => $this->notice['type_doc'],
'alpha_titre' => $this->notice['alpha_titre'],
'alpha_auteur' => $this->notice['alpha_auteur'],
'titres' => $this->indexation->getfullText(array_merge($this->notice['titres'],
[$this->notice['clef_chapeau'],
$this->notice['tome_alpha']])),
'auteurs' => $this->indexation->getfullText($this->_getFulltextAuthors()),
'other_terms'=> $this->indexation->getfulltext($this->notice['other_terms']),
'editeur' => $this->indexation->getfullText($this->notice['editeur']),
'collection' => $this->indexation->getfullText($this->notice['collection']),
'matieres' => $this->indexation->getfullText($this->_getFulltextSubjects()),
'dewey' => $this->indexation->getfullText($this->notice['full_dewey']),
'file_content' => $this->notice['file_content'],
'facettes' => $this->notice['facettes'],
'isbn' => $this->notice['isbn'],
'ean' => $this->notice['ean'],
'issn' => $this->notice['issn'],
'id_commerciale' => $this->notice['id_commerciale'],
'clef_alpha' => $this->notice['clef_alpha'],
'clef_chapeau' => $this->notice['clef_chapeau'],
'clef_oeuvre' => $this->notice['clef_oeuvre'],
'tome_alpha' => $this->notice['tome_alpha'],
'annee' => $this->notice['annee'],
'qualite' => $this->notice['qualite'],
'exportable' => $this->notice['exportable'],
'cote' => $this->notice['cote'],
'unimarc' => $this->notice['unimarc'],
'date_maj' => dateDuJour(2)];
if (isset($this->notice['url_vignette']))
$notice_enreg['url_image'] = $notice_enreg['url_vignette'] = $this->notice['url_vignette'];
return $notice_enreg;
}
......
......@@ -230,6 +230,9 @@ class notice_unimarc extends iso2709_record {
$notice["statut_exemplaires"] = $ex["statut_exemplaires"];
$notice["exemplaires"] = isset($ex["exemplaires"]) ? $ex["exemplaires"] : [];
if (Class_IntBib::isSingleSigb())
$notice["url_vignette"] = $this->getVignette();
// Analyse sections, genres et emplacements
$notice['genre'] = $notice["dewey"] ? $this->id_genre_documentaire : 0;
......@@ -283,6 +286,15 @@ class notice_unimarc extends iso2709_record {
}
public function getVignette(){
return ($portail = Class_Profil::getPortail())
? (new Class_Notice_ThumbnailFields(Class_Profil::getPortail()))->firstImageIn($this)
: '';
}
protected function _handleSerials($notice) {
if ((int)$this->profil["id_article_periodique"] == Class_IntProfilDonnees::SERIAL_FORMAT_PMB) {
return $this->_handleSerialsPMB($notice);
......
......@@ -96,6 +96,44 @@ class NanookRecordsIntegrationAvailabilityFacetTest extends NanookRecordsIntegra
class NanookRecordsIntegrationUrlVignetteTest extends NanookRecordsIntegrationTestCase {
protected
$_notice,
$_sigb = Class_IntBib::SIGB_NANOOK;
public function setUp() {
parent::setUp();
$profil = $this->fixture(Class_Profil::class, ['id' => 1]);
$profil->setCfgModulesPreferences(['thumbnail_fields' => '992-v'],
'recherche',
'viewnotice',
'1');
$profil->assertSave();
$this->loadNotice('notices_992v');
$this->_notice = Class_Notice::findFirstBy([]);
}
/** @test */
public function urlVignetteShouldContainsExpectedUrl() {
$this->assertEquals('https://websvc.afi-sa.net/afi_opac_services/images/jaquettes/big/2698256.jpeg',
$this->_notice->getUrlVignette());
}
/** @test */
public function urlImageShouldContainsExpectedUrl() {
$this->assertEquals('https://websvc.afi-sa.net/afi_opac_services/images/jaquettes/big/2698256.jpeg',
$this->_notice->getUrlImage());
}
}
/** @see http://forge.afi-sa.fr/issues/16358 */
class NanookRecordsIntegrationSymphonieTest extends NanookRecordsIntegrationTestCase {
public function getProfilDonnees() {
......
01144nam0 2200229 450 001000500000010002200005035000900027100001300036101001300049200003200062210005900094215000700153330019100160ans0129003514100024004806100010005046760040005147000041005548010017005959920164006129950138007767714 a978-2-02-083857-3 $a 7714 a20160426 afrecfre1 aLa faim des sept ours nains aParisb57 rue Gaston TessiercÉditions du Seuild2005 d19 aC'est l'hiver. Les sept ours nains n'ont plus rien à manger. Quand le chat aux bottes fourrées sonne à leur porte, c'est le début d'une folle aventure qui vous emmènera très loin dla forêt. Nous n'en dirons pas plus, nous ne voulons pas subir le même sort que tous les héros de ce conte. Sucré ou salé ? 0tLa bande des petits aConte a398.2tLittérature populaire orale 1aBravobémilef1964-....3OPS0013993 2aFrc20210522 uhttps://websvc.afi-sa.net/afi_opac_services/images/jaquettes/thumbs/2698256.jpegvhttps://websvc.afi-sa.net/afi_opac_services/images/jaquettes/big/2698256.jpeg aLes Landes Genussonf248500001119kEC BRAm20210522jbqjraaopv02[D][Disponible][0][1][][0][0][0][0]42012-12-0750712812910401397nam2 2200253 450 001000600000010001800006035001000024100001300034101001300047200002200060210002800082215004100110300003000151330018900181nid01840037046100840055467600430063870000850068170200330076680100170079999100110081699201640082799501520099126563 a2-07-057893-3 $a 26563 a20070706 afrecfre1 aLes Yeux d'Elisha aParis cGallimardd2007 a343 p.cill. en noir et blancd24 cm aill., couv. ill. en coul. aQuittant le monde des herbes, Tobie Lolness part à la reconquête de l'arbre. Elisha est entre les mains de Léo Blue, l'ancien ami de Tobie, devenu son pire ennemi. Il règne sur un immense posé sur les cimes de l'arbre. Léo travaille à l'anéantissement du peuple de l'herbe tandis que Jo Mitch tient prisonniers les parents Lolness dans son terrible cratère.| aFombelle, Timothée de (1973-....)cParisnGallimardtTobie LolnessvT.2022929 a843tFiction (littérature française) 1aFombellebTimothée def1973-....3146564248Fombelle, Thimothée de (1973-....) 1aPlacebFrançois3OPS0087454 2aFrc20210522 zRomans uhttps://websvc.afi-sa.net/afi_opac_services/images/jaquettes/thumbs/2771051.jpegvhttps://websvc.afi-sa.net/afi_opac_services/images/jaquettes/big/2771051.jpeg aLes Landes Genussonf0013660119kER FOM t.2/2m20210522jbqjraaopvAlreadyHold2[D][Disponible][0][1][][0][0][0][0]42021-07-20507278129104
\ No newline at end of file
......@@ -454,7 +454,8 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract {
self::FIELD_ITEM_GENRE => '7',
self::FIELD_ITEM_SECTION => '9',
self::FIELD_ITEM_EMPLACEMENT => '6',
self::FIELD_ITEM_ANNEXE => '8'
self::FIELD_ITEM_ANNEXE => '8',
self::FIELD_ITEM_UNIQ_SUBFIELD => '',
],
['champs' => ''],
['champs' => ''],
......
Markdown is supported
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