diff --git a/VERSIONS_HOTLINE/157470 b/VERSIONS_HOTLINE/157470 new file mode 100644 index 0000000000000000000000000000000000000000..b58bbf011afc6b8bd8b8459215593e7af1b6f733 --- /dev/null +++ b/VERSIONS_HOTLINE/157470 @@ -0,0 +1 @@ + - ticket #157470 : Cosmogramme : les caractères de non tri spécifiques à Flora sont maintenant nettoyés pour l'affichage. \ No newline at end of file diff --git a/cosmogramme/php/classes/classe_unimarc.php b/cosmogramme/php/classes/classe_unimarc.php index db315c137c80bb2c128e4658046a7136d0153e25..771fe55ccd5d168eecaeea0af00d40d8e21628cd 100644 --- a/cosmogramme/php/classes/classe_unimarc.php +++ b/cosmogramme/php/classes/classe_unimarc.php @@ -69,6 +69,7 @@ class notice_unimarc extends iso2709_record { $this->copyright = explode(';', $data); $this->controle_codes_barres = getVariable('controle_codes_barres'); $this->ean345 = getVariable('ean_345'); + $this->_setNonSortingCharacters(); // Règles sections, genres, emplacements $this->_codif_rules = new Class_Codification_RulesHelper(); @@ -76,6 +77,18 @@ class notice_unimarc extends iso2709_record { } + protected function _setNonSortingCharacters(){ + if (($intbib = Class_IntBib::find($this->_id_bib)) + && $intbib->isCommFlora()) { + static::$CHAR_NSB = chr(0xc2) . chr(0x98); // NON SORTING BLOCK BEGIN + static::$CHAR_NSE = chr(0xc2) . chr(0x9c); // NON SORTING BLOCK END + return; + } + static::$CHAR_NSB = chr(0xc2) . chr(0x88); // NON SORTING BLOCK BEGIN + static::$CHAR_NSE = chr(0xc2) . chr(0x89); // NON SORTING BLOCK END + } + + public function setCodificationRules($codification_rules) { $this->_codif_rules = $codification_rules; return $this; @@ -409,17 +422,17 @@ class notice_unimarc extends iso2709_record { switch($this->profil["id_article_periodique"]) { case Class_IntProfilDonnees::SERIAL_FORMAT_PERGAME: - $titre=$this->get_subfield("461","t"); - $numero=$this->get_subfield("461","v"); - $notice["clef_chapeau"]=$this->indexation->codeAlphaTitre($titre[0]); - $notice["clef_numero"]=$this->indexation->alphaMaj($numero[0]); - $notice["titre_numero"]=$titre[0]." n° ".$numero[0]; + $titre = array_map([$this, 'filtreTitre'], $this->get_subfield("461","t")); + $numero = $this->get_subfield("461","v"); + $notice["clef_chapeau"] = $this->indexation->codeAlphaTitre($titre[0]); + $notice["clef_numero"] = $this->indexation->alphaMaj($numero[0]); + $notice["titre_numero"] = $titre[0]." n° ".$numero[0]; break; case Class_IntProfilDonnees::SERIAL_FORMAT_ALOES_INDEXPRESS: $id=$this->get_subfield("001"); - $notice["clef_unimarc"]=$id[0]; - $notice["info_id"]=$id[0]; + $notice["clef_unimarc"] = $id[0]; + $notice["info_id"] = $id[0]; break; } @@ -427,10 +440,10 @@ class notice_unimarc extends iso2709_record { $titre=$this->getTitrePrincipal(); $notice["titre_princ"] = $titre; $titre=$this->indexation->codeAlphaTitre($titre); - $notice["clef_article"]=substr($titre,0,20); + $notice["clef_article"] = substr($titre,0,20); // unimarc - $notice["unimarc"]=$this->update(); + $notice["unimarc"] = $this->update(); return $notice; } @@ -1279,11 +1292,6 @@ class notice_unimarc extends iso2709_record { private function filtreTitre($valeur) { - if (!isset(static::$CHAR_NSB)) { - static::$CHAR_NSB = chr(0xc2) . chr(0x88); // NON SORTING BLOCK BEGIN - static::$CHAR_NSE = chr(0xc2) . chr(0x89); // NON SORTING BLOCK END - } - $titre = trim($valeur); $titre = str_replace(['[', '<', static::$CHAR_NSB, static::$CHAR_NSE], '', $titre); $titre = str_replace([']', '>'], ' ', $titre); diff --git a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php index 5c08c7c568504d6d56f7abba7af4dec7656b00d7..9540d12a8315a755aae6e06ee598cb8e0d7c5b69 100644 --- a/cosmogramme/tests/php/classes/NoticeIntegrationTest.php +++ b/cosmogramme/tests/php/classes/NoticeIntegrationTest.php @@ -1381,3 +1381,65 @@ class NoticeIntegrationZone214Indice4Test extends NoticeIntegrationTestCase { $this->notice_integration->noticeToDBEnreg($this->notice_data)['annee']); } } + + + + +class NoticeIntegrationNSBNSETest extends NoticeIntegrationTestCase { + + public function getProfilDonnees() { + return Class_IntProfilDonnees::forFlora() + ->setAccents(Class_IntProfilDonnees::ENCODING_MARC21) + ->getRawAttributes(); + } + + + public function setUp() { + parent::setUp(); + Class_IntBib::find(1) + ->setCommSigb(Class_IntBib::COM_FLORA) + ->save(); + + $this->loadNotice('unimarc_nsbnse'); + } + + /** @test */ + public function noticeTitreShouldbeLesDessousDuSportChinois() { + $this->assertEquals('Les dessous du sport chinois', + $this->notice_data['titre_princ']); + } + + + /** @test */ + public function noticeTitreNumeroShouldbeLesDessousDuSportChinois() { + $this->assertEquals('L\'Enquête sport/2 n° ', + $this->notice_data['titre_numero']); + } +} + + + + +class NoticeIntegrationAsservissementConsentiTest extends NoticeIntegrationTestCase { + public function getProfilDonnees() { + return Class_IntProfilDonnees::forFlora() + ->setAccents(Class_IntProfilDonnees::ENCODING_MARC21) + ->getRawAttributes(); + } + + + public function setUp() { + parent::setUp(); + $this->fixture(Class_IntBib::class, + [ 'id' => 1, + 'comm_sigb' => Class_IntBib::COM_FLORA]); + $this->loadNotice('unimarc_asservissementconsenti'); + } + + + /** @test */ + public function noticeTitreShouldbeLesDessousDuSportChinois() { + $this->assertEquals('Le sport-spectacle de compétition', + $this->notice_data['titre_princ']); + } +} diff --git a/cosmogramme/tests/php/classes/unimarc_asservissementconsenti.txt b/cosmogramme/tests/php/classes/unimarc_asservissementconsenti.txt new file mode 100644 index 0000000000000000000000000000000000000000..449d9dbe9757a94a11e0490b29303cb2eaa2a8ec --- /dev/null +++ b/cosmogramme/tests/php/classes/unimarc_asservissementconsenti.txt @@ -0,0 +1 @@ +02857cam0 2200385 450 00100100000000500190001001000350002907300180006410000410008210100080012310200070013110500180013810600060015618100250016218100200018718200210020718200110022820000890023921400480032821500430037622500380041932000410045733014060049841000470190460600480195160600610199960600560206061000730211670000490218980100160223899000140225491500360226893000530230499501140235724855665720201027155922.000 a978-2-490-07010-7bbr.d15 EUR 0a9782490070107 a20200821d2020 m y0frey50 ba0 afre aFR ay a 000yy ar 6z01ctxt2rdacontent 16z01ai#bxxxe## 6z01cn2rdamedia 16z01an1 a˜Le Âœsport-spectacle de compétitioneun asservissement consentifJean-Marie Brohm 0513019aAlboussièrecQS? éditionsdDL 2020 a1 vol. (483 p.)ccouv. en coul.d19 cm0 aHorizon critique pochex2557-8723 aNotes bibliogr. Bibliogr. p. 455-483 aDepuis sa genèse au XIXe siècle en Angleterre, le système sportif n'a cessé d'accroître sa puissance de massification à l'échelle de la planète. Avec l'appui des multinationales capitalistes, des appareils d'État et des réseaux médiatiques transnationaux, il fonctionne comme l'une des machineries essentielles de la colonisation idéologique de l'espace public. Par la multiplication des spectacles sportifs, avec leurs champions sponsorisés, enrégimentés et anabolisés, leurs mythologies primaires, leurs fantasmagories infantiles, le système sportif mondialisé a imposé une propagande insidieuse en faveur d'une vision du monde où la compétition de tous contre tous légitime l'asservissement consenti généralisé. La rage de vaincre l'adversaire, le sado-masochisme de la contrainte incessante au dépassement de soi et des autres, la course effrénée aux records, les affrontements supportéristes violents dans et hors les stades, les mobilisations identitaires, nationalistes et xénophobes engendrent l'individualisme narcissique du struggle for life, les identifications collectives aux idoles des performances tarifées et pour finir la mentalité archaïque propre aux foules sportives abonnées au vide culturel. L'aliénation sportive – l'opium sportif – est précisément l'ensemble de toutes ces régressions qu'il s'agit d'analyser et de combattre.2éditeur 0tHorizon critique (Alboussière)x2557-87230 3148447740aSports et mondialisation2rameau0 3027654702aSports3028644905xAspect économique2rameau0 3027654702aSports3027790088xAspect social2rameau0 aMONDIALISATIONaSPORTaECONOMIE-DU-SPORTaETHIQUEaSPECTACLE-SPORTIF 13026754355aBrohmbJean-Marief1940-....4070 1aFRbFRA7501 aSHC11 BRO 5751125101:678776725b9991415452 5751125101:678776725b751125101cESaSHC11 BROju 015default:UNIMARC:90210983345aMédiathèque - INSEPf9991415452kSHC11 BROr1sPapier1Disponible213261 \ No newline at end of file diff --git a/cosmogramme/tests/php/classes/unimarc_nsbnse.txt b/cosmogramme/tests/php/classes/unimarc_nsbnse.txt new file mode 100644 index 0000000000000000000000000000000000000000..a26c081fa9d8577aa098796c67383ddd50338e5e --- /dev/null +++ b/cosmogramme/tests/php/classes/unimarc_nsbnse.txt @@ -0,0 +1 @@ +01040naa2 22002059i 450 001001200000100004100012101000800053102000700061105001800068200003700086215000900123330017100132461015400303463006500457610016900522700002500691801001600716990001100732995009100743DK_FL_59825 a d k y0fre 0103 ba0 afre aFR ay 000yy1 a˜Les Âœdessous du sport chinois a6 p. aUsine à champions pour certains, concept impitoyable pour d'autres, le sport chinois ne laisse pas indifférent. L'article dévoile les méthodes du modèle chinois. t˜L'ÂœEnquête sport/2bTexte imprimécMontreuil/MontreuilnGroupe SOS Jeunessed2016/2016x2430-3836/2430-3836bTexte impriménGroupe SOS Jeunesse 620341vpp. 62-6760201662266067décembre 2015 - mars 2016 aCHINEaPOLITIQUE-SPORTIVEaATHLETE-DE-HAUT-NIVEAUaMETHODE-D-ENTRAINEMENTaPERFORMANCEaINTENSITE-DE-L-ENTRAINEMENTaSPORTIF-PROFESSIONNELaTENNIS-DE-TABLEaCULTURE 1aHéteaubThomas4070 0aFRbFRA7501 aPF 501 00aMÂediathÁeque - INSEPfEF_INSEP_250245298kEF_INSEP_250245298rEn ligne1Disponible02857cam0 2200385 450 00100100000000500190001001000350002907300180006410000410008210100080012310200070013110500180013810600060015618100250016218100200018718200210020718200110022820000890023921400480032821500430037622500380041932000410045733014060049841000470190460600480195160600610199960600560206061000730211670000490218980100160223899000140225491500360226893000530230499501140235724855665720201027155922.000 a978-2-490-07010-7bbr.d15 EUR 0a9782490070107 a20200821d2020 m y0frey50 ba0 afre aFR ay a 000yy ar 6z01ctxt2rdacontent 16z01ai#bxxxe## 6z01cn2rdamedia 16z01an1 a˜Le Âœsport-spectacle de compétitioneun asservissement consentifJean-Marie Brohm 0513019aAlboussièrecQS? éditionsdDL 2020 a1 vol. (483 p.)ccouv. en coul.d19 cm0 aHorizon critique pochex2557-8723 aNotes bibliogr. Bibliogr. p. 455-483 aDepuis sa genèse au XIXe siècle en Angleterre, le système sportif n'a cessé d'accroître sa puissance de massification à l'échelle de la planète. Avec l'appui des multinationales capitalistes, des appareils d'État et des réseaux médiatiques transnationaux, il fonctionne comme l'une des machineries essentielles de la colonisation idéologique de l'espace public. Par la multiplication des spectacles sportifs, avec leurs champions sponsorisés, enrégimentés et anabolisés, leurs mythologies primaires, leurs fantasmagories infantiles, le système sportif mondialisé a imposé une propagande insidieuse en faveur d'une vision du monde où la compétition de tous contre tous légitime l'asservissement consenti généralisé. La rage de vaincre l'adversaire, le sado-masochisme de la contrainte incessante au dépassement de soi et des autres, la course effrénée aux records, les affrontements supportéristes violents dans et hors les stades, les mobilisations identitaires, nationalistes et xénophobes engendrent l'individualisme narcissique du struggle for life, les identifications collectives aux idoles des performances tarifées et pour finir la mentalité archaïque propre aux foules sportives abonnées au vide culturel. L'aliénation sportive – l'opium sportif – est précisément l'ensemble de toutes ces régressions qu'il s'agit d'analyser et de combattre.2éditeur 0tHorizon critique (Alboussière)x2557-87230 3148447740aSports et mondialisation2rameau0 3027654702aSports3028644905xAspect économique2rameau0 3027654702aSports3027790088xAspect social2rameau0 aMONDIALISATIONaSPORTaECONOMIE-DU-SPORTaETHIQUEaSPECTACLE-SPORTIF 13026754355aBrohmbJean-Marief1940-....4070 1aFRbFRA7501 aSHC11 BRO 5751125101:678776725b9991415452 5751125101:678776725b751125101cESaSHC11 BROju 015default:UNIMARC:90210983345aMédiathèque - INSEPf9991415452kSHC11 BROr1sPapier1Disponible213261 diff --git a/library/Class/IntBib.php b/library/Class/IntBib.php index 13f95a28c8f84b7ac79440b11f4edba1bcb480cf..70849b33a9cbf31bfe6357d41db9567ec82e289f 100644 --- a/library/Class/IntBib.php +++ b/library/Class/IntBib.php @@ -552,6 +552,11 @@ class Class_IntBib extends Storm_Model_Abstract { } + public function isCommFlora() { + return static::COM_FLORA == $this->getCommSigb(); + } + + public function isDisconnected() { return static::COM_NONE == $this->getCommSigb() && static::SIGB_NONE == $this->getSigb(); diff --git a/library/Class/IntProfilDonnees.php b/library/Class/IntProfilDonnees.php index ba8e2aad3be61187c5050a46389b479f13528c5a..08bb33d40216b93962dcb738907c426a367fa231 100644 --- a/library/Class/IntProfilDonnees.php +++ b/library/Class/IntProfilDonnees.php @@ -514,6 +514,53 @@ class Class_IntProfilDonnees extends Storm_Model_Abstract { } + public static function forFlora() : Class_IntProfilDonnees { + return static::getLoader() + ->newInstance(['libelle' => 'Unimarc Flora', + 'accents' => self::ENCODING_ISO2709, + 'rejet_periodiques' => 0, + 'id_article_periodique' => self::SERIAL_FORMAT_PERGAME, + 'type_fichier' => self::FT_RECORDS, + 'format' => self::FORMAT_UNIMARC, + 'attributs' => + [0 => ['type_doc' => + [[ 'code' => '0', 'label' => '', 'zone_995' => '' ], + [ 'code' => '1', 'label' => 'am', 'zone_995' => '' ], + [ 'code' => '2', 'label' => 'as', 'zone_995' => ''], + [ 'code' => '3', 'label' => 'j;jm', 'zone_995' => ''], + [ 'code' => '4', 'label' => '','zone_995' => 'gf'], + [ 'code' => '5', 'label' => '', 'zone_995' => 'gz'], + [ 'code' => '6', 'label' => 'm;m', 'zone_995' => '' ], + [ 'code' => '7', 'label' => '', 'zone_995' => 'iz' ], + [ 'code' => '8', 'label' => '', 'zone_995' => 'mz'], + [ 'code' => '9', 'label' => '', 'zone_995' => ''], + [ 'code' => '10', 'label' => '', 'zone_995' => ''], + [ 'code' => '11', 'label' => '', 'zone_995' => ''], + [ 'code' => '12', 'label' => '', 'zone_995' => 'jd'] + ], + self::FIELD_ITEM_BARCODE => 'f', + self::FIELD_ITEM_COTE => 'k', + self::FIELD_ITEM_TYPE_DOC => '2', + self::FIELD_ITEM_GENRE => '', + self::FIELD_ITEM_SECTION => 'q', + self::FIELD_ITEM_EMPLACEMENT => 'u', + self::FIELD_ITEM_ANNEXE => 'a', + self::FIELD_ITEM_AVAILABILITY => '1' + ], + 1 => ['champs' => ''], + 2 => ['champs' => ''], + 3 => ['champs' => ''], + 4 => ['zone' => '995', + 'champ' => '4', + 'format' => self::NOVELTY_DATE_FORMAT_VALUES, + 'jours' => '', + 'valeurs' => ''] + ] + ] + ); + } + + public static function forOrphee() : Class_IntProfilDonnees { return static::getLoader() ->newInstance(['libelle' => 'Unimarc Orphée',