diff --git a/cosmogramme/php/classes/classe_buffer.php b/cosmogramme/php/classes/classe_buffer.php index b8f8e44c818488d1d3d047cc2ad97e7e9097e300..dc104f38c4288809293120810aa68214fbd3f431 100644 --- a/cosmogramme/php/classes/classe_buffer.php +++ b/cosmogramme/php/classes/classe_buffer.php @@ -61,7 +61,8 @@ class buffer closedir($dir); if (!$page) $page = 1; $this->page = $page; - @$this->fic = fopen($this->nomFic.'.'.$page, 'a') || afficherErreur("Impossible d'ouvrir le fichier de bufferisation"); + if (! @$this->fic = fopen($this->nomFic.'.'.$page, 'a')) + afficherErreur("Impossible d'ouvrir le fichier de bufferisation"); } // Ecrire diff --git a/cosmogramme/php/classes/classe_notice_integration.php b/cosmogramme/php/classes/classe_notice_integration.php index 6a98fb6f65556dfe50b66e9fdba742e505ca0e8e..b210257afe6ea968de8a9ffef002c1442c619003 100644 --- a/cosmogramme/php/classes/classe_notice_integration.php +++ b/cosmogramme/php/classes/classe_notice_integration.php @@ -1107,21 +1107,6 @@ class notice_integration { } } - -// -------------------------------------------------------------------------------- -// Recupere titre, auteurs, matieres pour 1 article de périodique -// -------------------------------------------------------------------------------- - public function getDataArticlePeriodique($unimarc) - { - if(!$unimarc) { $this->erreur="notice sans unimarc"; return false; } - if(!$this->analyseur->ouvrirNotice($unimarc,$this->id_profil,0,"")) { $this->erreur=$this->analyseur->getLastError(); return false; } - - $ret["titres"]=$this->analyseur->getTitres(); - $ret["auteurs"]=$this->analyseur->getAuteurs(); - $ret["matieres"]=$this->analyseur->getMatieresLabels(); - return $ret; - } - // -------------------------------------------------------------------------------- // Rend la derniere erreur et les derniers warnings // -------------------------------------------------------------------------------- diff --git a/cosmogramme/php/classes/classe_unimarc.php b/cosmogramme/php/classes/classe_unimarc.php index e3ec07847a50277b8dad96f0a5b0e1c949506be5..8a8e9992578c3e1e8ec86008aff03429afe78fc6 100644 --- a/cosmogramme/php/classes/classe_unimarc.php +++ b/cosmogramme/php/classes/classe_unimarc.php @@ -58,6 +58,7 @@ class notice_unimarc extends iso2709_record protected $_id_bib; // Bibliotheque d'intégration protected $_fluent; // Class_NoticeUnimarc_Fluent protected $_type_doc; //type do document + protected $_notice_authors; public function __construct($id_bib=null) { $this->_id_bib = $id_bib; @@ -204,7 +205,10 @@ class notice_unimarc extends iso2709_record $notice["alpha_titre"] = $this->indexation->codeAlphaTitre($notice["titre_princ"]." ".$notice["tome_alpha"]); $notice["id_commerciale"] = $this->getIdCommerciale($notice["alpha_titre"]); - $auteurs = new Class_Notice_Authors($this); + if (!$this->_notice_authors) + $this->_notice_authors = new Class_Notice_Authors($this); + + $auteurs = $this->_notice_authors; $notice["auteurs"] = $auteurs->getAllAuthors(); $notice["auteurs_raw"] = $auteurs->getAllAuthorsAndIds(); $notice["alpha_auteur"] = $this->indexation->alphaMaj($notice["auteurs"][0] ?? ''); @@ -1348,12 +1352,26 @@ class notice_unimarc extends iso2709_record public function getAuteurPrincipal() : string { - return (new Class_Notice_Authors($this))->getFirstAuthorNames(); + if (!$this->_notice_authors) + $this->_notice_authors = new Class_Notice_Authors($this); + + return $this->_notice_authors->getFirstAuthorNames(); } public function getAuteurClefAlpha() : string { - return (new Class_Notice_Authors($this))->getFirstAuthorAlphaKey(); + if (!$this->_notice_authors) + $this->_notice_authors = new Class_Notice_Authors($this); + + return $this->_notice_authors->getFirstAuthorAlphaKey(); + } + + public function getAuteurs(): array + { + if (!$this->_notice_authors) + $this->_notice_authors = new Class_Notice_Authors($this); + + return $this->_notice_authors->getAllAuthors(); } diff --git a/cosmogramme/php/integre_analyse_fichier_synthese.php b/cosmogramme/php/integre_analyse_fichier_synthese.php index 98ed757a2d2d4cfc6684e33f8d3cc54c527c9980..f227069020662f7499b92d2c7ddd07227aae4683 100644 --- a/cosmogramme/php/integre_analyse_fichier_synthese.php +++ b/cosmogramme/php/integre_analyse_fichier_synthese.php @@ -209,8 +209,8 @@ if ($ret["statut"]=="erreur") { else $texte_statut .= "aucune notice n'a pu être analysée.".BR; } elseif ($nb_notices == 0) { $texte_statut = '<span class="rouge">Le fichier ne contenait aucune notice</span><br>'; -} else $texte_statut = '<b><span class="vert">Le fichier respecte la norme unimarc</span></b>'.BR; -sauveContexte(); +} else $texte_statut = '<b><span class="vert">Le fichier respecte la norme unimarc</span></b>'.BR; +sauveContexte(true); // ---------------------------------------------------------------- // Fonctions diff --git a/cosmogramme/php/integre_analyse_fichier_unimarc.php b/cosmogramme/php/integre_analyse_fichier_unimarc.php index 526c9e449251bcfde04231c796a34a01796ba3ca..6e23817884ad65937a2ef57e1029baec07ee0e31 100644 --- a/cosmogramme/php/integre_analyse_fichier_unimarc.php +++ b/cosmogramme/php/integre_analyse_fichier_unimarc.php @@ -250,7 +250,6 @@ if ($ret["statut"]=="erreur") { } if($nb_notices > 0 ) { - if(!$nb_suppr > 0) $nb_suppr="aucune"; $buffer->ecrire("Notices à supprimer : " . $nb_suppr.BR); $buffer->ecrire("Notices à mettre à jour : " . ($nb_notices - ($nb_rejets + $nb_suppr)).BR); $buffer->ecrire("Exemplaires à insérer : " . $nb_ex.BR); diff --git a/cosmogramme/php/integre_analyse_fichier_valeurs_distinctes.php b/cosmogramme/php/integre_analyse_fichier_valeurs_distinctes.php index 581ff2980df56a79a4dc7f10bd7fec3ed5f5607f..9799b08c02ed0d64f996d0620f37bd15937ba136 100644 --- a/cosmogramme/php/integre_analyse_fichier_valeurs_distinctes.php +++ b/cosmogramme/php/integre_analyse_fichier_valeurs_distinctes.php @@ -194,8 +194,8 @@ if ($ret["statut"]=="erreur") { else $texte_statut .= "aucune notice n'a pu être analysée.".BR; } elseif ($nb_notices == 0) { $texte_statut = '<span class="rouge">Le fichier ne contenait aucune notice</span><br>'; -} else $texte_statut = '<b><span class="vert">Le fichier respecte la norme unimarc</span></b>'.BR; -sauveContexte(); +} else $texte_statut = '<b><span class="vert">Le fichier respecte la norme unimarc</span></b>'.BR; +sauveContexte(true); // ---------------------------------------------------------------- // Fonctions