Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 224 → Rev 225

/trunk/configurations/referentiel_v4.3.ini
13,7 → 13,7
; Notes ajoutée à l'édition partielle
notes_partiel = "Édition Taxref."
; Noms des champs de la bdnt
champs = "num_nom,num_nom_retenu,num_tax_sup,rang,nom_sci,nom_supra_generique,genre,epithete_infra_generique,epithete_sp,type_epithete,epithete_infra_sp,cultivar_groupe,cultivar,nom_commercial,auteur,annee,biblio_origine,notes,nom_addendum,homonyme,num_type,basionyme,synonyme_proparte,synonyme_douteux,synonyme_mal_applique,synonyme_orthographique,hybride_parent_01,hybride_parent_01_notes,hybride_parent_02,hybride_parent_02_notes,nom_francais,presence,statut_origine,statut_introduction,statut_culture,exclure_taxref"
champs = "num_nom,num_nom_retenu,num_tax_sup,rang,nom_sci,nom_supra_generique,genre,epithete_infra_generique,epithete_sp,type_epithete,epithete_infra_sp,cultivar_groupe,cultivar,nom_commercial,auteur,annee,biblio_origine,notes,nom_addendum,homonyme,num_type,basionyme,synonyme_proparte,synonyme_douteux,synonyme_mal_applique,synonyme_orthographique,orthographe_originelle,hybride_parent_01,hybride_parent_01_notes,hybride_parent_02,hybride_parent_02_notes,nom_francais,presence,statut_origine,statut_introduction,statut_culture,exclure_taxref"
; Noms des champs de la bdnt partielles
champs_partiel = "num_nom,num_nom_retenu,num_tax_sup,nom_sci,auteur,annee,biblio_origine,nom_addendum,nom_francais,presence"
; Noms des champs du diff de la bdnt
47,6 → 47,7
synonyme_douteux=VARCHAR|1,
synonyme_mal_applique=VARCHAR|1,
synonyme_orthographique=VARCHAR|9,
orthographe_originelle=VARCHAR|500,
hybride_parent_01=VARCHAR|9,
hybride_parent_01_notes=TEXT|65536,
hybride_parent_02=VARCHAR|9,
85,6 → 86,7
synonyme_mal_applique=3,
synonyme_orthographique=3,
biblio_statut=3,
orthographe_originelle=3,
hybride_parent_01=3,
hybride_parent_01_notes=3,
hybride_parent_02=3,
/trunk/scripts/modules/versionnage/Versionnage.php
19,7 → 19,7
class Versionnage extends ScriptCommande {
const SCRIPT_NOM = 'versionnage';
const MANUEL_VERSION = '4.2';
const MANUEL_VERSION = '4.3';
private $projet = null;
private $traitement = null;
450,30 → 450,16
$this->champs_courants = $this->champs_nom;
$diff = array();
foreach ($this->noms as $id => $nom) {
if ($this->noms[$id]['exclure_taxref'] == '1') {
unset($this->noms[$id]);
} else {
foreach ($this->noms[$id] as $champ => $valeur) {
if (! in_array($champ, $this->champs_nom_partiel)) {
unset($this->noms[$id][$champ]);
}
}
}
$this->supprimerNomAExclurePartiel($this->noms, $id);
$infos = array();
if (!isset($this->noms_precedents[$id])) {
if ($this->etreSupprime($id)) {
$infos = $this->traiterDiffSuppression($nom);
} else if ($this->etreAjoute($id)) {
$infos = $this->traiterDiffAjout($nom);
} else {
$nom_precedent = $this->noms_precedents[$id];
if ($this->noms_precedents[$id]['exclure_taxref'] == '1') {
unset($this->noms_precedents[$id]);
} else {
foreach ($this->noms_precedents[$id] as $champ => $valeur) {
if (! in_array($champ, $this->champs_nom_partiel)) {
unset($this->noms_precedents[$id][$champ]);
}
}
}
array_walk($nom_precedent, create_function('&$val', '$val = trim($val);'));
$this->supprimerNomAExclurePartiel($this->noms_precedents, $id);
$nom_precedent = $this->nettoyerEspacesTableau($nom_precedent);
$infos = $this->traiterDiffModif($nom, $nom_precedent);
}
494,8 → 480,31
"précédentes pour l'édition $edition. Cela concerne les noms : ".implode(', ', array_keys($this->noms_supprimes));
Debug::printr($e);
$this->ajouterMessage($e);
}
}
private function supprimerNomAExclurePartiel(&$tableau, $id) {
if ($tableau[$id]['exclure_taxref'] == '1') {
unset($tableau[$id]);
}
}
private function nettoyerNomAExclurePartiel($nom) {
foreach ($nom as $champ => $valeur) {
if (! in_array($champ, $this->champs_nom_partiel)) {
unset($nom[$champ]);
}
}
return $nom;
}
private function etreSupprime($id) {
$supprime = false;
if (array_key_exists($id, $this->noms_supprimes)) {
$supprime = true;
}
return $supprime;
}
private function traiterDiffSuppression(&$nom) {
$infos = $nom;
$infos['modification_type'] = 'S';
505,6 → 514,19
return $infos;
}
private function etreAjoute($id) {
$ajoute = false;
if (! array_key_exists($id, $this->noms_precedents)) {
$ajoute = true;
}
return $ajoute;
}
private function nettoyerEspacesTableau($tableau) {
array_walk($tableau, create_function('&$val', '$val = trim($val);'));
return $tableau;
}
private function traiterDiffAjout(&$nom) {
$infos = $nom;
$infos['modification_type'] = 'A';
593,9 → 615,11
// Ajout de champs spécifique à Taxref généré depuis les données BDNT
$nom['taxref_rang'] = $this->attribuerRangTaxref($nom['rang']);
$nom['taxref_statut'] = $this->attribuerStatutTaxref($nom);
$nom = $this->nettoyerNomAExclurePartiel($nom);
$infos = array();
if (!isset($this->noms_precedents[$id])) {
if ($this->etreSupprime($id)) {
$infos = $this->traiterDiffSuppression($nom);
} elseif ($this->etreAjoute($id)) {
$infos = $this->traiterDiffAjout($nom);
} else {
$nom_precedent = $this->noms_precedents[$id];
604,8 → 628,8
// Ajout de champs spécifique à Taxref généré depuis les données BDNT
$nom_precedent['taxref_rang'] = $this->attribuerRangTaxref($nom_precedent['rang']);
$nom_precedent['taxref_statut'] = $this->attribuerStatutTaxref($nom_precedent);
array_walk($nom_precedent, create_function('&$val', '$val = trim($val);'));
$nom_precedent = $this->nettoyerNomAExclurePartiel($nom_precedent);
$nom_precedent = $this->nettoyerEspacesTableau($nom_precedent);
$infos = $this->traiterDiffModif($nom, $nom_precedent);
}
/trunk/scripts/modules/tests/Tests.php
19,7 → 19,7
class Tests extends ScriptCommande {
const SCRIPT_NOM = 'tests';
const MANUEL_VERSION = '4.2';
const MANUEL_VERSION = '4.3';
private $projet = null;
private $traitement = null;