Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 29 → Rev 30

/trunk/interfaces/controleurs/Test.php
56,7 → 56,7
if ($resultat != false) {
$donnees['traitements'] = $resultat;
} else {
$this->addMessage("Un problème est survenu lors de la tentative de récupération des traitements en cours.");
$this->addMessage("Aucun traitement en cours.");
}
} else {
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdnff).");
82,12 → 82,17
$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdnff).");
} else {
// TODO : vérifier qu'il n'y a pas déjà un traitement en cours pour ce projet.
$resultat = $this->traitementDao->ajouterTraitement($this->referentiel);
if ($resultat != false) {
$this->addMessage("Le traitement #'$resultat' a été ajouté.");
$this->lancerScript();
$resultat_traitement_en_cours = $this->traitementDao->getTraitementsEnCours($this->referentiel);
if ($resultat_traitement_en_cours) {
$this->addMessage("Un traitement est déjà en cours...");
} else {
$this->addMessage("Un problème est survenu lors de la tentative d'ajout du traitement.");
$resultat = $this->traitementDao->ajouterTraitement($this->referentiel);
if ($resultat != false) {
$this->addMessage("Le traitement #'$resultat' a été ajouté.");
$this->lancerScript();
} else {
$this->addMessage("Un problème est survenu lors de la tentative d'ajout du traitement.");
}
}
}
}
/trunk/services/modules/Traitement.php
82,6 → 82,7
$requete = ($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM ref_traitement '.
"WHERE referentiel_code = $projet ".
' AND date_debut IS NOT NULL '.
' AND date_fin IS NULL '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'meta_date_creation DESC').' ';
$this->debug[] = $requete;
222,6 → 223,28
}
/**
* Méthode pour indiquer la fin d'un traitement.
*/
public function updateElementTerminer($id, $params_post) {
$ok = true;
try {
$requete = 'UPDATE ref_traitement '.
'SET date_fin = NOW() '.
"WHERE id_traitement = $id ";
$this->debug[] = "$requete";
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$ok = false;
$this->messages[] = "Traitement NON modifié.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
return $ok;
}
/**
* Méthode principale appelée avec une requête de type DELETE.
*/
public function deleteElement($params_url) {
/trunk/services/modules/Resultat.php
1,6 → 1,6
<?php
/**
* Service fournissant des données de la table contenant le référentiel de travail.
* Service fournissant des données sur les résultats d'un traitement.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
12,32 → 12,25
* @copyright 2010 Tela-Botanica
* @version $Id$
*/
class Referentiel extends Ref {
class Resultat extends Ref {
/**
* Méthode principale appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
public function getElement($params_url = array()) {
// Initialisation des variables
$info = array();
// Nour recherchons le type de requête demandé
$p = $this->traiterParametresUrl(array('type', 'projet'), $param, false);
$p = $this->traiterParametresUrl(array('type'), $params_url, false);
extract($p);
$type = $p['type'];
$projet = $p['projet'];
if (!is_null($type)) {
if (!is_null($projet)) {
$methode = 'getElement'.$type;
if (method_exists($this, $methode)) {
//array_shift($param);
$info = $this->$methode($projet);
} else {
$this->messages[] = "Le type d'information demandé '$type' n'est pas disponible.";
}
$methode = 'getElement'.$type;
if (method_exists($this, $methode)) {
//array_shift($param);
$info = $this->$methode($params_url);
} else {
$this->messages[] = "Veuillez préciser le nom de code du projet comme premier paramêtre (ex. : bdnff).";
$this->messages[] = "Le type d'information demandé '$type' n'est pas disponible.";
}
} else {
$this->messages[] = "Veuillez préciser le type de requête.";
47,44 → 40,104
$this->envoyer($info);
}
/* Méthode pour récupérer les noms d'un référentiel.
/** Méthode pour récupérer le nombre de résultat d'un traitement donné.
* Appelée avec les paramêtres d'url suivant :
* /RefReferentiel/tout/code_du_referentiel
* /Resultat/Nombre/id_traitement
*
* @return mixed le nombre de résultat ou false en cas d'échec.
*/
public function getElementTout($projet) {
$requete = ($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
"FROM `$projet` ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'num_nom ASC').' ';
//"LIMIT $this->start, $this->limit ";
public function getElementNombre($params_url) {
$p = $this->traiterParametresUrl(array('id'), $params_url);
extract($p);
$requete = 'SELECT COUNT(*) AS nbre '.
"FROM ref_resultat ".
"ce_traitement = $id ";
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$nbre = $this->bdd->query($requete)->fetchColumn();
if ($nbre === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $donnees;
return $nbre;
}
/* Méthode pour récupérer le nombre de noms présents dans un référentiel.
/** Méthode pour récupérer les infos d'un résultat.
* Appelée avec les paramêtres d'url suivant :
* /RefReferentiel/nombre/code_du_referentiel
* /Resultat/Info/id_resultat
*
* @return mixed les infos du résultat ou false en cas d'échec.
*/
public function getElementNombre($projet) {
$requete = 'SELECT COUNT(*) AS nbre '.
"FROM `$projet` ";
public function getElementInfo($params_url) {
$p = $this->traiterParametresUrl(array('id'), $params_url);
extract($p);
$requete = 'SELECT * '.
"FROM ref_resultat ".
"id_resultat = $id ";
// Récupération des résultats
try {
$nbre = $this->bdd->query($requete)->fetchColumn();
if ($nbre === false) {
$infos = $this->bdd->query($requete)->fetch(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $nbre;
return $infos;
}
/** Méthode pour récupérer des infos partielles (id, nom, resultat) des résultats d'un traitement.
* Appelée avec les paramêtres d'url suivant :
* /Resultat/Traitement/id_traitement
*
* @return mixed le tableau de tableau d'infos ou false en cas d'échec.
*/
public function getElementTraitement($params_url) {
$p = $this->traiterParametresUrl(array('id'), $params_url);
extract($p);
$requete = 'SELECT * '.
"FROM ref_resultat ".
"ce_traitement = $id ";
// Récupération des résultats
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $infos;
}
/**
* Méthode appelée pour ajouter un traitement.
*
* @return mixed l'id du nouvel enregistrement ou false!
*/
public function createElement($params_post) {
$params_proteges = $this->traiterParametresPost(array('id_traitement', 'nom', 'description', 'resultat', 'message'), $params_post);
extract($params_proteges);
$meta_date_creation = $this->bdd->quote(date ("Y-m-d H:i:s"));
try {
$requete = "INSERT INTO ref_resultat ".
' (ce_traitement, nom, description, resultat, message, meta_date_creation) '.
" VALUES ($id_traitement, $nom, $description, $resultat, $message, $meta_date_creation) ";
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$id = false;
$this->debug[] = "Résultat NON ajouté.";
} else {
$id = $this->bdd->lastInsertId();
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
$this->envoyer($id);
}
}
?>
/trunk/doc/bdd/referentiel.sql
30,6 → 30,8
id_resultat INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
ce_traitement INTEGER UNSIGNED NULL ,
nom VARCHAR(100) NULL ,
description TEXT NULL ,
resultat BOOL NULL ,
message MEDIUMTEXT NULL ,
meta_date_creation DATETIME NULL ,
PRIMARY KEY(id_resultat) ,
/trunk/doc/bdd/referentiel.xml
330,6 → 330,14
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="28018" ColName="description" PrevColName="" Pos="6" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="28017" ColName="resultat" PrevColName="" Pos="5" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27992" ColName="message" PrevColName="" Pos="3" idDatatype="29" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
/trunk/scripts/bibliotheque/ScriptCommande.php
20,7 → 20,7
/**
* classe representant une commande
*/
abstract class ScriptCommande {
abstract class ScriptCommande extends Controleur {
 
public $nom;
public $parametres;
65,6 → 65,7
 
function __construct($commande_nom) {
$this->setNom($commande_nom);
parent::__construct();
}
public function __destruct() {
/trunk/scripts/modules/tests/configurations/tests.ini
New file
0,0 → 1,5
[titres]
NombreDeChamps = "Structure -> nombre de champs : %s"
 
[descriptions]
NombreDeChamps = "Le nombre de champs présent dans la table doit être supérieur ou égal à 35."
/trunk/scripts/modules/tests/squelettes/message.tpl.html
New file
0,0 → 1,19
<table>
<caption><?=count($test['message']['lignes'])?> lignes en erreur</caption>
<thead>
<tr>
<?php foreach ($test['message']['entete'] as $entete) : ?>
<th><?=$entete?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($test['message']['lignes'] as $ligne) : ?>
<tr>
<?php foreach ($ligne as $info) : ?>
<td><?=$info?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
/trunk/scripts/modules/tests/Tests.php
18,30 → 18,48
class Tests extends ScriptCommande {
private $projet = null;
private $traitement = null;
private $manuel = null;
private $resultatDao = null;
private $traitementDao = null;
private $tableStructureDao = null;
private $referentielDao = null;
public function executer() {
// Récupération de paramêtres
$this->projet = $this->getParam('p');
$this->manuel = parse_ini_file($this->getModuleChemin().DS.'configurations'.DS.'referentiel_v2.1.ini');
$traitementDao = new TraitementDao();
$traitement = $traitementDao->getDernierTraitement($this->projet);
Debug::printr($traitement);
Debug::printr('Debute:'.$traitementDao->debuterTraitement($traitement['id_traitement']));
$traitements_obsoletes = $traitementDao->getTraitementsObsoletes($this->projet);
Debug::printr('Supp. obsoletes:'.$traitementDao->supprimer($traitements_obsoletes));
$this->resultatDao = new ResultatDao();
$this->traitementDao = new TraitementDao();
// Récupération du dernier traitement demandé
$this->traitement = $this->traitementDao->getDernierTraitement($this->projet);
Debug::printr($this->traitement);
// Écriture de la date de début du traitement
Debug::printr('Debute:'.$this->traitementDao->debuterTraitement($this->traitement['id_traitement']));
// Nettoyage des traitements obsolètes
$traitements_obsoletes = $this->traitementDao->getTraitementsObsoletes($this->projet);
Debug::printr('Supp. obsoletes:'.$this->traitementDao->supprimer($traitements_obsoletes));
// TODO : Nettoyage des tratiements (et de leurs résultats) avortés
// Lancement du test demandé
$cmd = $this->getParam('a');
switch ($cmd) {
case 'tout' :
$this->tableStructureDao = new TableStructureDao();
$this->referentielDao = new ReferentielDao();
$this->lancerTests();
break;
default :
$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
}
// Écriture de la date de fin du traitement
Debug::printr('Debute:'.$this->traitementDao->terminerTraitement($this->traitement['id_traitement']));
}
 
public function lancerTests() {
48,8 → 66,6
$donnees = array();
$donnees['tests'] = array();
/*
// Récupération des données à tester
$colonnes = $this->tableStructureDao->getColonnes($this->projet);
$analyses = $this->tableStructureDao->getAnalyse($this->projet);
58,101 → 74,112
$noms_homonymie = $this->classerNomsParNomComplet($noms);
// Lancement des tests unitaires
$donnees['tests'][] = $this->testerNombreDeChamps($colonnes);
$donnees['tests'][] = $this->testerNomDesChamps($colonnes);
$donnees['tests'][] = $this->testerTypeDesChamps($colonnes);
$donnees['tests'][] = $this->testerTailleDesChamps($colonnes, $analyses);
$donnees['tests'][] = $this->testerNumNomClePrimaire($colonnes);
$this->testerNombreDeChamps($colonnes);
$this->testerNomDesChamps($colonnes);
$this->testerTypeDesChamps($colonnes);
$this->testerTailleDesChamps($colonnes, $analyses);
$this->testerNumNomClePrimaire($colonnes);
$donnees['tests'][] = $this->testerNumNomSuperieurAZero($noms);
$this->testerNumNomSuperieurAZero($noms);
$donnees['tests'][] = $this->testerNumNomRetenuSuperieurAZero($noms);
$donnees['tests'][] = $this->testerNumTaxSupEgalZeroUnique($noms);
$donnees['tests'][] = $this->testerTaxSupPourTaxon($noms);
$donnees['tests'][] = $this->testerExitenceTaxonSuperieur($noms);
$donnees['tests'][] = $this->testerClassificationRang($noms);
$donnees['tests'][] = $this->testerClassification($noms);
$this->testerNumNomRetenuSuperieurAZero($noms);
$this->testerNumTaxSupEgalZeroUnique($noms);
$this->testerTaxSupPourTaxon($noms);
$this->testerExitenceTaxonSuperieur($noms);
$this->testerClassificationRang($noms);
$this->testerClassification($noms);
$donnees['tests'][] = $this->testerRang($noms);
$this->testerRang($noms);
$donnees['tests'][] = $this->testerNomCompletSupraGenerique($noms);
$donnees['tests'][] = $this->testerNomCompletGenre($noms);
$donnees['tests'][] = $this->testerNomCompletInfraGenre($noms);
$donnees['tests'][] = $this->testerNomCompletEspece($noms);
$donnees['tests'][] = $this->testerNomCompletInfraSpecifique($noms);
$this->testerNomCompletSupraGenerique($noms);
$this->testerNomCompletGenre($noms);
$this->testerNomCompletInfraGenre($noms);
$this->testerNomCompletEspece($noms);
$this->testerNomCompletInfraSpecifique($noms);
 
$donnees['tests'][] = $this->testerNomSupraGeneriqueEspaces($noms);
$donnees['tests'][] = $this->testerNomSupraGeneriqueSyntaxe($noms);
$donnees['tests'][] = $this->testerNomSupraGeneriqueRang($noms);
$this->testerNomSupraGeneriqueEspaces($noms);
$this->testerNomSupraGeneriqueSyntaxe($noms);
$this->testerNomSupraGeneriqueRang($noms);
$donnees['tests'][] = $this->testerGenreEspaces($noms);
$donnees['tests'][] = $this->testerGenreSyntaxe($noms);
$donnees['tests'][] = $this->testerGenreRang($noms);
$this->testerGenreEspaces($noms);
$this->testerGenreSyntaxe($noms);
$this->testerGenreRang($noms);
$donnees['tests'][] = $this->testerEpitheteInfraGeneriqueEspaces($noms);
$donnees['tests'][] = $this->testerEpitheteInfraGeneriqueSyntaxe($noms);
$donnees['tests'][] = $this->testerEpitheteInfraGeneriqueRang($noms);
$this->testerEpitheteInfraGeneriqueEspaces($noms);
$this->testerEpitheteInfraGeneriqueSyntaxe($noms);
$this->testerEpitheteInfraGeneriqueRang($noms);
$donnees['tests'][] = $this->testerEpitheteSpEspaces($noms);
$donnees['tests'][] = $this->testerEpitheteSpSyntaxe($noms);
$donnees['tests'][] = $this->testerEpitheteSpRang($noms);
$this->testerEpitheteSpEspaces($noms);
$this->testerEpitheteSpSyntaxe($noms);
$this->testerEpitheteSpRang($noms);
$donnees['tests'][] = $this->testerTypeEpitheteEspaces($noms);
$donnees['tests'][] = $this->testerTypeEpitheteSyntaxe($noms);
$donnees['tests'][] = $this->testerTypeEpitheteHybridite($noms);
$this->testerTypeEpitheteEspaces($noms);
$this->testerTypeEpitheteSyntaxe($noms);
$this->testerTypeEpitheteHybridite($noms);
$donnees['tests'][] = $this->testerEpitheteInfraSpEspaces($noms);
$donnees['tests'][] = $this->testerEpitheteInfraSpSyntaxe($noms);
$donnees['tests'][] = $this->testerEpitheteInfraSpRang($noms);
$this->testerEpitheteInfraSpEspaces($noms);
$this->testerEpitheteInfraSpSyntaxe($noms);
$this->testerEpitheteInfraSpRang($noms);
$donnees['tests'][] = $this->testerGroupeCultivarSyntaxe($noms);
$donnees['tests'][] = $this->testerGroupeCultivarRang($noms);
$this->testerGroupeCultivarSyntaxe($noms);
$this->testerGroupeCultivarRang($noms);
$donnees['tests'][] = $this->testerCultivarSyntaxe($noms);
$donnees['tests'][] = $this->testerCultivarRang($noms);
$this->testerCultivarSyntaxe($noms);
$this->testerCultivarRang($noms);
$donnees['tests'][] = $this->testerNomCommercialSyntaxe($noms);
$donnees['tests'][] = $this->testerNomCommercialPresenceCultivar($noms);
$this->testerNomCommercialSyntaxe($noms);
$this->testerNomCommercialPresenceCultivar($noms);
$donnees['tests'][] = $this->testerAuteurSyntaxe($noms);
$this->testerAuteurSyntaxe($noms);
$donnees['tests'][] = $this->testerAnneeSyntaxe($noms);
$this->testerAnneeSyntaxe($noms);
$donnees['tests'][] = $this->testerBiblioOrigineSyntaxe($noms);
$this->testerBiblioOrigineSyntaxe($noms);
$donnees['tests'][] = $this->testerHomonymieSyntaxe($noms);
$donnees['tests'][] = $this->testerHomonymieExistence($noms, $noms_homonymie);
$this->testerHomonymieSyntaxe($noms);
$this->testerHomonymieExistence($noms, $noms_homonymie);
$donnees['tests'][] = $this->testerBasionymeSyntaxe($noms);
$donnees['tests'][] = $this->testerBasionymeExistence($noms);
$this->testerBasionymeSyntaxe($noms);
$this->testerBasionymeExistence($noms);
$donnees['tests'][] = $this->testerSynonymeProparteSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeProparteExistence($noms);
$this->testerSynonymeProparteSyntaxe($noms);
$this->testerSynonymeProparteExistence($noms);
$donnees['tests'][] = $this->testerSynonymeDouteuxSyntaxe($noms);
$this->testerSynonymeDouteuxSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeMalAppliqueSyntaxe($noms);
$this->testerSynonymeMalAppliqueSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeOrthographiqueSyntaxe($noms);
$donnees['tests'][] = $this->testerSynonymeOrthographiqueExistence($noms);
$this->testerSynonymeOrthographiqueSyntaxe($noms);
$this->testerSynonymeOrthographiqueExistence($noms);
$donnees['tests'][] = $this->testerHybrideParent01Syntaxe($noms);
$donnees['tests'][] = $this->testerHybrideParent01Existence($noms);
$donnees['tests'][] = $this->testerHybrideParent02Syntaxe($noms);
$donnees['tests'][] = $this->testerHybrideParent02Existence($noms);
$this->testerHybrideParent01Syntaxe($noms);
$this->testerHybrideParent01Existence($noms);
$this->testerHybrideParent02Syntaxe($noms);
$this->testerHybrideParent02Existence($noms);
$donnees['tests'][] = $this->testerPresenceSyntaxe($noms);
$donnees['tests'][] = $this->testerStatutOrigineSyntaxe($noms);
$donnees['tests'][] = $this->testerStatutIntroductionSyntaxe($noms);
$donnees['tests'][] = $this->testerStatutCultureSyntaxe($noms);
*/
$this->testerPresenceSyntaxe($noms);
$this->testerStatutOrigineSyntaxe($noms);
$this->testerStatutIntroductionSyntaxe($noms);
$this->testerStatutCultureSyntaxe($noms);
}
//+--------------------------------------------------------------------------------------------------------------+//
// Enregistrement des résultats
private function traiterResultatTest($info) {
if (isset($info['message'])) {
if (is_array($info['message'])) {
$info['message'] = $this->getVue('tests/squelettes/message', $info);
}
}
$this->resultatDao->ajouter($this->traitement['id_traitement'], $info);
}
//+--------------------------------------------------------------------------------------------------------------+//
// TESTS
private function testerStatutCultureSyntaxe($noms) {
$info = array('titre' => 'statut_culture -> syntaxe',
$info = array('nom' => 'statut_culture -> syntaxe',
'description' => "Le champ statut_culture peut contenir :\n".
" - le symbole tiret «-» une autre information non référencée...\n".
" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
178,11 → 205,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerStatutIntroductionSyntaxe($noms) {
$info = array('titre' => 'statut_introduction -> syntaxe',
$info = array('nom' => 'statut_introduction -> syntaxe',
'description' => "Le champ statut_introduction peut contenir :\n".
" - le symbole tiret «-» une autre information non référencée...\n".
" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
208,11 → 235,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerStatutOrigineSyntaxe($noms) {
$info = array('titre' => 'statut_origine -> syntaxe',
$info = array('nom' => 'statut_origine -> syntaxe',
'description' => "Le champ statut_origine peut contenir :\n".
" - le symbole tiret «-» une autre information non référencée...\n".
" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
238,11 → 265,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerPresenceSyntaxe($noms) {
$info = array('titre' => 'presence -> syntaxe',
$info = array('nom' => 'presence -> syntaxe',
'description' => "Le champ presence contient soit :\n".
" - le symbole tiret «-» une autre information non référencée...\n".
" - une première lettre en majuscule indiquant le code standard attribué à ce taxon.\n".
268,11 → 295,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHybrideParent02Existence($noms) {
$info = array('titre' => 'hybride_parent_02 -> existence',
$info = array('nom' => 'hybride_parent_02 -> existence',
'description' => "Si le champ hybride_parent_02 contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
295,11 → 322,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHybrideParent02Syntaxe($noms) {
$info = array('titre' => 'hybride_parent_02 -> syntaxe',
$info = array('nom' => 'hybride_parent_02 -> syntaxe',
'description' => "Le champ hybride_parent_02 contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
323,12 → 350,12
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHybrideParent01Existence($noms) {
$info = array('titre' => 'hybride_parent_01 -> existence',
$info = array('nom' => 'hybride_parent_01 -> existence',
'description' => "Si le champ hybride_parent_01 contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
351,11 → 378,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHybrideParent01Syntaxe($noms) {
$info = array('titre' => 'hybride_parent_01 -> syntaxe',
$info = array('nom' => 'hybride_parent_01 -> syntaxe',
'description' => "Le champ hybride_parent_01 contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
379,11 → 406,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeOrthographiqueExistence($noms) {
$info = array('titre' => 'synonyme_orthographique -> existence',
$info = array('nom' => 'synonyme_orthographique -> existence',
'description' => "Si le champ synonyme_orthographique contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
406,11 → 433,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeOrthographiqueSyntaxe($noms) {
$info = array('titre' => 'synonyme_orthographique -> syntaxe',
$info = array('nom' => 'synonyme_orthographique -> syntaxe',
'description' => "Le champ synonyme_orthographique contient soit :\n".
" - une valeur vide.\n".
" - un nombre",
434,11 → 461,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeMalAppliqueSyntaxe($noms) {
$info = array('titre' => 'synonyme_mal_applique -> syntaxe',
$info = array('nom' => 'synonyme_mal_applique -> syntaxe',
'description' => "Le champ synonyme_mal_applique contient soit :\n".
" - une valeur vide.\n".
" - le chiffre 1",
462,11 → 489,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeDouteuxSyntaxe($noms) {
$info = array('titre' => 'synonyme_douteux -> syntaxe',
$info = array('nom' => 'synonyme_douteux -> syntaxe',
'description' => "Le champ synonyme_douteux contient soit :\n".
" - une valeur vide.\n".
" - le chiffre 1",
490,11 → 517,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeProparteExistence($noms) {
$info = array('titre' => 'synonyme_proparte -> existence',
$info = array('nom' => 'synonyme_proparte -> existence',
'description' => "Si le champ synonyme_proparte contient un ou plusieurs nombres alors chacun d'entre eux ".
"doit correspondre à une valeur du champ num_nom.",
'resultat' => false);
524,11 → 551,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerSynonymeProparteSyntaxe($noms) {
$info = array('titre' => 'synonyme_proparte -> syntaxe',
$info = array('nom' => 'synonyme_proparte -> syntaxe',
'description' => "Le champ synonyme_proparte contient soit :\n".
" - une valeur vide.\n".
" - un nombre.\n".
553,11 → 580,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerBasionymeExistence($noms) {
$info = array('titre' => 'basionyme -> existence',
$info = array('nom' => 'basionyme -> existence',
'description' => "Si le champ basionyme contient un nombre alors il doit correspondre à une valeur du champ ".
"num_nom.",
'resultat' => false);
580,11 → 607,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerBasionymeSyntaxe($noms) {
$info = array('titre' => 'basionyme -> syntaxe',
$info = array('nom' => 'basionyme -> syntaxe',
'description' => "Le champ basionyme contient :\n".
" - un nombre ou une valeur vide.\n",
'resultat' => false);
607,11 → 634,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHomonymieExistence($noms, $noms_homonymie) {
$info = array('titre' => 'homonyme -> existence',
$info = array('nom' => 'homonyme -> existence',
'description' => "Si le champ homonyme contient «1» alors plusieurs noms doivent posséder la même valeur ".
"dans le champ nom_complet.",
'resultat' => false);
634,11 → 661,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerHomonymieSyntaxe($noms) {
$info = array('titre' => 'homonyme -> syntaxe',
$info = array('nom' => 'homonyme -> syntaxe',
'description' => "Le champ homonyme contient :\n".
" - le chiffre 1 ou une valeur vide.\n",
'resultat' => false);
661,11 → 688,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerBiblioOrigineSyntaxe($noms) {
$info = array('titre' => 'biblio_origine -> syntaxe',
$info = array('nom' => 'biblio_origine -> syntaxe',
'description' => "Le champ biblio_origine se compose de plusieurs parties séparées par des caractères ".
"précis qui sont dans l'ordre de gauche à droite :\n".
" - Éventuellement le mot « in » suivi d'un intitulé auteur (utilisé pour indiquer l'intitulé auteur de ".
702,11 → 729,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerAnneeSyntaxe($noms) {
$info = array('titre' => 'annee -> syntaxe',
$info = array('nom' => 'annee -> syntaxe',
'description' => "Le champ annee doit :\n".
" - contenir un nombre de 4 chiffre\n".
" - être supérieur ou égal à 1753 ",
730,11 → 757,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerAuteurSyntaxe($noms) {
$info = array('titre' => 'auteur -> syntaxe',
$info = array('nom' => 'auteur -> syntaxe',
'description' => "Le champ auteur doit :\n".
" - contenir l'intitulé complet des noms de l'auteur ou des auteurs ayant publiés à l'origine la combinaison latine courante.\n".
" - ou débuter par le mot « sensu » et contient l'intitulé complet des noms de l'auteur ou des auteurs ayant publiés un nom dont la description ne correspond pas à celle de l'auteur ou des auteurs d'origine.\n".
766,11 → 793,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCommercialSyntaxe($noms) {
$info = array('titre' => 'nom_commercial -> syntaxe',
$info = array('nom' => 'nom_commercial -> syntaxe',
'description' => "Le champ nom_commercial doit contenir un nom commercial conforme aux règles du ".
"Code Internationnal de Nomenclature des Plantes Cultivées (CINPC) ".
"qui se compose de caractères majuscules (A-Z) incluant des signes diacritiques et des espaces.\n",
795,11 → 822,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCommercialPresenceCultivar($noms) {
$info = array('titre' => 'nom_commercial -> groupe_cultivar OU cultivar non vide',
$info = array('nom' => 'nom_commercial -> groupe_cultivar OU cultivar non vide',
'description' => "Si le champ nom_commercial contier un nom commercial alors le champ cultivar OU ".
"cultivar_groupe ne doit pas être vide.",
'resultat' => false);
820,11 → 847,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerCultivarSyntaxe($noms) {
$info = array('titre' => 'cultivar -> syntaxe',
$info = array('nom' => 'cultivar -> syntaxe',
'description' => "Le champ cultivar_groupe doit contenir :\n".
" - un nom de cultivar conforme aux règles du Code Internationnal de Nomenclature des Plantes ".
"Cultivées (CINPC) qui se compose de caractères alphanumériques (A-Z,a-z et 0-9) incluant ".
856,11 → 883,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerCultivarRang($noms) {
$info = array('titre' => "cultivar -> rang >= {$this->manuel['rang_genre']}",
$info = array('nom' => "cultivar -> rang >= {$this->manuel['rang_genre']}",
'description' => "Si le champ cultivar n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
'resultat' => false);
882,11 → 909,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerGroupeCultivarSyntaxe($noms) {
$info = array('titre' => 'cultivar_groupe -> syntaxe',
$info = array('nom' => 'cultivar_groupe -> syntaxe',
'description' => "Le champ cultivar_groupe doit contenir un nom de groupe de cultivar conforme aux règles ".
"du code des plantes cultivées qui se compose de caractères alphanumériques (A-Z,a-z et 0-9) incluant ".
"signes diacritiques et marques de ponctuations.\n".
913,11 → 940,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerGroupeCultivarRang($noms) {
$info = array('titre' => "cultivar_groupe -> rang >= {$this->manuel['rang_genre']}",
$info = array('nom' => "cultivar_groupe -> rang >= {$this->manuel['rang_genre']}",
'description' => "Si le champ cultivar_groupe n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
'resultat' => false);
939,11 → 966,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraSpEspaces($noms) {
$info = array('titre' => 'epithete_infra_sp -> espaces en trop',
$info = array('nom' => 'epithete_infra_sp -> espaces en trop',
'description' => "Le champ epithete_infra_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
'resultat' => false);
967,11 → 994,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraSpSyntaxe($noms) {
$info = array('titre' => 'epithete_infra_sp -> syntaxe',
$info = array('nom' => 'epithete_infra_sp -> syntaxe',
'description' => "Le champ epithete_infra_sp peut contenir :\n".
" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
" Il commence par une lettre minuscule (avec ou sans tréma).\n".
1002,11 → 1029,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraSpRang($noms) {
$info = array('titre' => "epithete_infra_sp -> rang > {$this->manuel['rang_sp']}",
$info = array('nom' => "epithete_infra_sp -> rang > {$this->manuel['rang_sp']}",
'description' => "Si le champ epithete_infra_sp n'est pas vide alors le rang du nom doit être supérieur à {$this->manuel['rang_sp']}.",
'resultat' => false);
1028,11 → 1055,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTypeEpitheteEspaces($noms) {
$info = array('titre' => 'type_epithete -> espaces en trop',
$info = array('nom' => 'type_epithete -> espaces en trop',
'description' => "Le champ type_epithete ne doit pas contenir d'espace.",
'resultat' => false);
1055,11 → 1082,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTypeEpitheteSyntaxe($noms) {
$info = array('titre' => 'type_epithete -> syntaxe',
$info = array('nom' => 'type_epithete -> syntaxe',
'description' => "Le champ type_epithete doit contenir un mot unique composé de lettres minuscules sans ".
" accents et de tirets (-). Il commence par une lettre minuscule sans accent.",
'resultat' => false);
1082,11 → 1109,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTypeEpitheteHybridite($noms) {
$info = array('titre' => 'type_epithete -> hybridité',
$info = array('nom' => 'type_epithete -> hybridité',
'description' => "Le champ type_epithete ne doit pas contenir de préfixe indiquant l'hybridité comme : \n".
" - «n-» \n".
" - «notho-» \n",
1110,24 → 1137,24
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNombreDeChamps($colonnes) {
$info = array('titre' => 'Structure -> nombre de champs : %s',
$info = array('nom' => 'Structure -> nombre de champs',
'description' => 'Le nombre de champs présent dans la table doit être supérieur ou égal à 35.',
'resultat' => false);
$nbre_colonnes = count($colonnes);
$info['titre'] = sprintf($info['titre'], $nbre_colonnes);
$info['message'] = $nbre_colonnes;
if ($nbre_colonnes >= 35) {
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomDesChamps($colonnes) {
$info = array('titre' => 'Structure -> noms des champs',
$info = array('nom' => 'Structure -> noms des champs',
'description' => 'Les champs de la table contenant le référentiel doivent être conforme à ceux définit par le manuel technique.',
'resultat' => false);
1150,11 → 1177,11
$info['message'] = 'Champs manquant : '.implode(', ', $champs_manquant).'.';
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTypeDesChamps($colonnes) {
$info = array('titre' => 'Structure -> types des champs',
$info = array('nom' => 'Structure -> types des champs',
'description' => 'Les types des champs de la table contenant le référentiel doivent être conforme à ceux définit par le manuel technique.',
'resultat' => false);
1188,11 → 1215,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTailleDesChamps($colonnes, $analyses) {
$info = array('titre' => 'Structure -> champs tronqués',
$info = array('nom' => 'Structure -> champs tronqués',
'description' => "Vérifie que les données de type texte insérées dans la table n'ont pas été tronquées lors de leur insertion.",
'resultat' => false);
1227,11 → 1254,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNumNomClePrimaire($colonnes) {
$info = array('titre' => 'Structure -> num_nom est clé primaire',
$info = array('nom' => 'Structure -> num_nom est clé primaire',
'description' => "Vérifie que le champ num_nom est bien la clé primaire de la table.",
'resultat' => false);
1241,11 → 1268,11
}
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNumNomSuperieurAZero($noms) {
$info = array('titre' => 'num_nom -> supérieur à 0',
$info = array('nom' => 'num_nom -> supérieur à 0',
'description' => "Le champ num_nom doit contenir des nombres entiers supérieurs à 0.",
'resultat' => false);
1264,11 → 1291,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNumNomRetenuSuperieurAZero($noms) {
$info = array('titre' => 'num_nom_retenu -> supérieur à 0',
$info = array('nom' => 'num_nom_retenu -> supérieur à 0',
'description' => "Le champ num_nom_retenu doit contenir des nombres entiers supérieurs à 0.",
'resultat' => false);
1287,11 → 1314,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNumTaxSupEgalZeroUnique($noms) {
$info = array('titre' => 'num_tax_sup -> égal à 0 unique',
$info = array('nom' => 'num_tax_sup -> égal à 0 unique',
'description' => "Un seul enregistrement doit posséder la valeur 0 dans le champ num_tax_sup. Il correspond au premier taxon de la classification.",
'resultat' => false);
1310,11 → 1337,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerTaxSupPourTaxon($noms) {
$info = array('titre' => 'Classification -> uniquement pour les taxons',
$info = array('nom' => 'Classification -> uniquement pour les taxons',
'description' => "Seul les enregistrements représentant un taxon doivent posséder une valeur dans le champ num_tax_sup.",
'resultat' => false);
1333,11 → 1360,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerExitenceTaxonSuperieur($noms) {
$info = array('titre' => 'Classification -> existence du taxon supérieur',
$info = array('nom' => 'Classification -> existence du taxon supérieur',
'description' => "Pour chaque enregistrement représentant un taxon doit posséder un taxon supérieur sauf la racine de la classification.",
'resultat' => false);
1358,11 → 1385,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerClassificationRang($noms) {
$info = array('titre' => 'Classification -> taxon supérieur avec rang inférieur',
$info = array('nom' => 'Classification -> taxon supérieur avec rang inférieur',
'description' => "Pour chaque enregistrement représentant un taxon, chaque taxon supérieur doit avoir un rang inférieur au taxon courant.",
'resultat' => false);
1386,11 → 1413,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerClassification($noms) {
$info = array('titre' => 'Classification -> racine liée à chaque noeud',
$info = array('nom' => 'Classification -> racine liée à chaque noeud',
'description' => "Pour chaque enregistrement, la classification doit pouvoir être remonté jusqu'à un même nom unique possédant une valeur num_tax_sup de 0.",
'resultat' => false);
1412,7 → 1439,7
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function remonterClassif(&$noms, $nom) {
1426,7 → 1453,7
}
private function testerRang($noms) {
$info = array('titre' => 'rang',
$info = array('nom' => 'rang',
'description' => "Le rang doit correspondre à un valeur numérique définit dans le manuel.",
'resultat' => false);
1447,11 → 1474,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCompletSupraGenerique($noms) {
$info = array('titre' => 'nom_complet -> noms supra-génériques',
$info = array('nom' => 'nom_complet -> noms supra-génériques',
'description' => "Si le rang est < à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ nom_supra_generique. ".
"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
'resultat' => false);
1478,11 → 1505,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCompletGenre($noms) {
$info = array('titre' => 'nom_complet -> noms de genres',
$info = array('nom' => 'nom_complet -> noms de genres',
'description' => "Si le rang est = à {$this->manuel['rang_genre']} le nom_complet doit correspondre à la valeur du champ genre. ".
"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
'resultat' => false);
1509,11 → 1536,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCompletInfraGenre($noms) {
$info = array('titre' => 'nom_complet -> noms infra-génériques',
$info = array('nom' => 'nom_complet -> noms infra-génériques',
'description' => "Si le rang est > à {$this->manuel['rang_genre']} et < à {$this->manuel['rang_sp']} le nom_complet doit correspondre à une des formules suivantes : \n".
" genre + ' ' + type_epithete + ' ' + epithete_infra_generique \n".
" genre + ' ' + epithete_infra_generique + ' ' + type_epithete=agg. \n".
1551,11 → 1578,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCompletEspece($noms) {
$info = array('titre' => "nom_complet -> noms d'espèce",
$info = array('nom' => "nom_complet -> noms d'espèce",
'description' => "Si le rang est = à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
" genre + ' ' + epithete_sp \n".
"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1584,11 → 1611,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomCompletInfraSpecifique($noms) {
$info = array('titre' => 'nom_complet -> noms infra-spécifiques',
$info = array('nom' => 'nom_complet -> noms infra-spécifiques',
'description' => "Si le rang est > à {$this->manuel['rang_sp']} le nom_complet doit correspondre à la formule : \n".
" genre + ' ' + epithete_sp + ' ' + type_epithete + ' ' + epithete_infra_generique\n".
"Les valeurs des champs cultivar_groupe, cultivar et nom_commercial peuvent s'y ajouter.",
1619,11 → 1646,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomSupraGeneriqueEspaces($noms) {
$info = array('titre' => 'nom_supra_generique -> espaces en trop',
$info = array('nom' => 'nom_supra_generique -> espaces en trop',
'description' => "Le champ nom_supra_generique ne doit pas contenir d'espace avant ou aprés le nom.",
'resultat' => false);
1646,11 → 1673,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomSupraGeneriqueSyntaxe($noms) {
$info = array('titre' => 'nom_supra_generique -> syntaxe',
$info = array('nom' => 'nom_supra_generique -> syntaxe',
'description' => "Le champ nom_supra_generique contient un mot composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
"La première lettre (avec ou sans tréma) du mot doit être en majuscule.",
'resultat' => false);
1674,11 → 1701,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerNomSupraGeneriqueRang($noms) {
$info = array('titre' => "nom_supra_generique -> rang < {$this->manuel['rang_genre']}",
$info = array('nom' => "nom_supra_generique -> rang < {$this->manuel['rang_genre']}",
'description' => "Si le champ nom_supra_generique n'est pas vide alors le rang du nom doit être inférieur à {$this->manuel['rang_genre']}.",
'resultat' => false);
1700,11 → 1727,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerGenreEspaces($noms) {
$info = array('titre' => 'genre -> espaces en trop',
$info = array('nom' => 'genre -> espaces en trop',
'description' => "Le champ genre ne doit pas contenir d'espace avant ou aprés le nom.\n".
"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
'resultat' => false);
1728,11 → 1755,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerGenreSyntaxe($noms) {
$info = array('titre' => 'genre -> syntaxe',
$info = array('nom' => 'genre -> syntaxe',
'description' => "Le champ genre peut contenir :\n".
" - un mot unique composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
" Il commence par une lettre majuscule (avec ou sans tréma).".
1763,11 → 1790,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerGenreRang($noms) {
$info = array('titre' => "genre -> rang >= {$this->manuel['rang_genre']}",
$info = array('nom' => "genre -> rang >= {$this->manuel['rang_genre']}",
'description' => "Si le champ genre n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_genre']}.",
'resultat' => false);
1789,11 → 1816,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraGeneriqueSyntaxe($noms) {
$info = array('titre' => 'epithete_infra_generique -> syntaxe',
$info = array('nom' => 'epithete_infra_generique -> syntaxe',
'description' => "Le champ epithete_infra_generique est composé de lettres minuscules avec ou sans tréma (¨) et de tirets (-). \n".
"La première lettre (avec ou sans tréma) doit être en majuscule.",
'resultat' => false);
1817,11 → 1844,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraGeneriqueRang($noms) {
$info = array('titre' => "epithete_infra_generique -> {$this->manuel['rang_genre']} < rang < {$this->manuel['rang_sp']}",
$info = array('nom' => "epithete_infra_generique -> {$this->manuel['rang_genre']} < rang < {$this->manuel['rang_sp']}",
'description' => "Si le champ epithete_infra_generique n'est pas vide alors le rang du nom doit être compris \n".
"entre {$this->manuel['rang_genre']} et {$this->manuel['rang_sp']}.",
'resultat' => false);
1844,11 → 1871,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteInfraGeneriqueEspaces($noms) {
$info = array('titre' => 'epithete_infra_generique -> espaces en trop',
$info = array('nom' => 'epithete_infra_generique -> espaces en trop',
'description' => "Le champ epithete_infra_generique ne doit pas contenir d'espace avant ou aprés sa valeur.",
'resultat' => false);
1871,11 → 1898,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteSpEspaces($noms) {
$info = array('titre' => 'epithete_sp -> espaces en trop',
$info = array('nom' => 'epithete_sp -> espaces en trop',
'description' => "Le champ epithete_sp ne doit pas contenir d'espace avant ou aprés le nom.\n".
"Si des espaces sont compris dans la valeur du champ, il ne doit pas y avoir plusieurs espaces consécutifs.",
'resultat' => false);
1899,11 → 1926,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteSpSyntaxe($noms) {
$info = array('titre' => 'epithete_sp -> syntaxe',
$info = array('nom' => 'epithete_sp -> syntaxe',
'description' => "Le champ epithete_sp peut contenir :\n".
" - un mot unique composé de lettres minuscules [a-z] incluant les caractères [ëï-]. \n".
" Il commence par une lettre minuscule [a-zëï].\n".
1935,11 → 1962,11
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
private function testerEpitheteSpRang($noms) {
$info = array('titre' => "epithete_sp -> rang >= {$this->manuel['rang_sp']}",
$info = array('nom' => "epithete_sp -> rang >= {$this->manuel['rang_sp']}",
'description' => "Si le champ epithete_sp n'est pas vide alors le rang du nom doit être supérieur ou égal à {$this->manuel['rang_sp']}.",
'resultat' => false);
1961,7 → 1988,7
$info['resultat'] = true;
}
return $info;
$this->traiterResultatTest($info);
}
//+--------------------------------------------------------------------------------------------------------------+//
/trunk/.buildpath
New file
0,0 → 1,4
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="con" path="org.eclipse.dltk.USER_LIBRARY/framework"/>
</buildpath>
/trunk/bibliotheque/dao/ResultatDao.php
New file
0,0 → 1,88
<?php
// declare(encoding='UTF-8');
/**
* DAO des résultats des traitements.
*
* @package Referentiel
* @category Php 5.2
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version $Id$
*
*/
class ResultatDao extends Dao {
const SERVICE = 'Resultat';
private $url = null;
public function __construct() {
parent::__construct();
$this->url = $this->url_jrest.self::SERVICE;
}
/**
* Retourne les infos d'un résultat enregistré dans la bdd pour un traitement donné.
*
* @param integer l'id du résultat.
* @return array le tableau d'infos ou false en cas d'échec.
*/
public function getInfos($id_resultat) {
$url = $this->url."/Info/$id_resultat";
$json = $this->envoyerRequeteConsultation($url);
$infos = json_decode($json, true);
return $infos;
}
/**
* Retourne des infos partilles des résultats (id, nom, resultat) d'un traitement donné.
*
* @param integer l'id du traitement.
* @return mixed le tableau de tableau d'infos ou false en cas d'échec.
*/
public function getResultatsTraitement($id_traitement) {
$url = $this->url."/Traitement/$id_traitement";
$json = $this->envoyerRequeteConsultation($url);
$infos = json_decode($json, true);
return $infos;
}
/**
* Retourne le nombre de résultat enregistré dans la bdd pour un traitement donné.
*
* @param integer l'id du traitement.
* @return mixed le nombre de résultat ou false en cas d'échec.
*/
public function getNombre($id_traitement) {
$url = $this->url."/Nombre/$id_traitement";
$json = $this->envoyerRequeteConsultation($url);
$traitements = json_decode($json, true);
return $traitements;
}
/**
* Ajoute un résultat de traitement pour une référentiel donné.
*
* @param integer l'id du traitement en cours.
* @param array un tableau contenant deux clés 'nom' contenant le nom du test et 'message' contenant le résultat du test.
*
* @return mixed l'id du résultat ou false en cas d'échec.
*/
public function ajouter($id_traitement, Array $resultat) {
// Préparation des données à passer par POST
$donnees = $resultat;
$donnees['id_traitement'] = $id_traitement;
// Envoie des données et récupération du retour
$json = $this->envoyerRequeteAjout($this->url, $donnees);
$id = json_decode($json, true);
return $id;
}
}
?>
/trunk/bibliotheque/dao/TraitementDao.php
23,10 → 23,10
}
/**
* Retourne l'ensemble des traitements en instance.
* Retourne l'ensemble des traitements en cours.
*
* @param string le code du projet de référentiel.
* @return array un tableau contenant les informations sur les traitements en cours ou en attente.
* @return mixed un tableau contenant les informations sur les traitements en cours ou false en cas d'échec.
*/
public function getTraitementsEnCours($code_projet) {
$url = $this->url."/EnCours/$code_projet";
40,7 → 40,7
* Retourne les ids de l'ensemble des traitements obsolètes.
*
* @param string le code du projet de référentiel.
* @return array un tableau contenant les ids des traitements obsolètes.
* @return mixed un tableau contenant les ids des traitements obsolètes ou false en cas d'échec.
*/
public function getTraitementsObsoletes($code_projet) {
$url = $this->url."/Obsolete/$code_projet";
54,7 → 54,7
* Retourne le dernier traitement demandé et non traité pour un projet donné.
*
* @param string le code du projet de référentiel.
* @return array un tableau contenant les informations sur le dernier traitement demandé et non traité.
* @return mixed un tableau contenant les informations sur le dernier traitement demandé et non traité ou false en cas d'échec.
*/
public function getDernierTraitement($code_projet) {
$url = $this->url."/DerniereDemande/$code_projet";
65,6 → 65,20
}
/**
* Retourne l'ensemble des traitements terminés.
*
* @param string le code du projet de référentiel.
* @return mixed un tableau contenant les informations sur les traitements terminés ou false en cas d'échec.
*/
public function getTraitementsTermines($code_projet) {
$url = $this->url."/Termines/$code_projet";
$json = $this->envoyerRequeteConsultation($url);
$traitements = json_decode($json, true);
return $traitements;
}
/**
* Ajoute une demande de traitement pour une référentiel donné.
*
* @param string le code du référentiel.
97,6 → 111,22
}
/**
* Modifie un traitement pour indiquer qu'il est terminé.
*
* @param integer l'id du traitement
* @return boolean true en cas de succés sinon false.
*/
public function terminerTraitement($id_traitement) {
$url = $this->url."/$id_traitement";
$donnees['action'] = 'Terminer';
// Envoie des données et récupération du retour
$json = $this->envoyerRequeteModif($url, $donnees);
$ok = json_decode($json, true);
return $ok;
}
/**
* Supprime des traitments en fonction de leur id.
*
* @param array le tableau des id des traitements à supprimer
/trunk/.settings/org.eclipse.php.core.prefs
1,3 → 1,3
#Tue May 11 12:46:49 CEST 2010
#Thu Jun 24 17:33:30 CEST 2010
eclipse.preferences.version=1
include_path=0;/referentiel
include_path=5;org.eclipse.dltk.USER_LIBRARY/framework