Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3676 → Rev 3677

/branches/v3.00-serfouette/scripts/modules/nettoyage/Nettoyage.php
50,6 → 50,8
$this->unifierNomReferentiel();
$this->unifierCertitude();
//$this->supprimerCertitudeAutre();
$this->analyserMotsCles();
$this->changerSensible();
$this->unifierUtilisateur();
$this->unifierPhenologie();
$this->verifierCodeInsee();
56,8 → 58,6
$this->verifierGeodatum();
$this->supprimerInfosLiesObsInexistante();
$this->supprimerImagesetTagAnonymes();
$this->analyserMotsCles();
$this->changerSensible();
$this->unifierNull();
break;
case 'supprimerRetourLigne' :
108,6 → 108,10
case 'unifierPhenologie' :
$this->unifierPhenologie();
break;
case 'unifierTag' :
$this->unifierUtilisateurTag("cel_arbre_mots_cles_obs");
$this->unifierUtilisateurTag("cel_arbre_mots_cles_images");
break;
default :
$msg = "Erreur : la commande '$cmd' n'existe pas!\n".
"Commandes existantes : regenererMotsClesTexteObs, regenererMotsClesTexteImages"
600,7 → 604,7
echo "modification des observations ayant un identifiant";
$requete_annu_mail = "UPDATE ".$this->bd_cel.".`cel_obs` join ".$this->bd_cel.".`users` ON ID = ce_utilisateur SET pseudo = user_nicename,
`courriel_utilisateur` = `user_email` WHERE (ce_utilisateur IS NULL OR char_length(ce_utilisateur) > 6) and (courriel_utilisateur is null or courriel_utilisateur='')";
`courriel_utilisateur` = `user_email` WHERE !(ce_utilisateur IS NULL OR char_length(ce_utilisateur) > 6) and (courriel_utilisateur is null or courriel_utilisateur='')";
$utilisateur_mail = $this->bdd->recupererTous($requete_annu_mail);
echo "suppression des autres valeurs ce_utilisateur";
626,7 → 630,7
$requete = "ALTER TABLE ".$this->bd_cel.".".$table." ADD courriel varchar(255);";
$this->bdd->requeter($requete);
$requete = "UPDATE ".$this->bd_cel.".".$table." SET courriel = id_utilisateur,
id_utilisateur = NULL WHERE id_utilisateur like '%@%';";
id_utilisateur = 0 WHERE id_utilisateur like '%@%';";
$this->bdd->requeter($requete);
echo "recherche des identifiants pour les tags ayant que des courriels dans users";
$requete = "UPDATE ".$this->bd_cel.".".$table." join ".$this->bd_cel.".`users` ON `user_email` = courriel SET `id_utilisateur` = `ID`
715,7 → 719,7
//Num nom et nom sci sont les mêmes
// chercher les versions
$requete = "UPDATE ".$this->bd_cel.".`cel_obs`"
.' join bdtfx on `nom_sel_nn` = num_nom and `nom_sel` like concat(nom_sci, "%")
.' join '.$this->bd_flore.'bdtfx on `nom_sel_nn` = num_nom and `nom_sel` like concat(nom_sci, "%")
SET `nom_sel` = nom_sci_complet, `nom_sel_nn` = num_nom ,
`nom_ret` = nom_ret_complet, `nom_ret_nn` = num_nom_retenu,
infosnn = 1
724,7 → 728,7
//Num nom id, nom sci +-=
$requete = "UPDATE ".$this->bd_cel.".`cel_obs`"
.' join bdtfx on `nom_sel_nn` = num_nom and and (nom_sel like concat(nom_sci,"%") and nom_ret like concat(nom_sci,"%"))
.' join '.$this->bd_flore.'bdtfx on `nom_sel_nn` = num_nom and and (nom_sel like concat(nom_sci,"%") and nom_ret like concat(nom_sci,"%"))
and (nom_sel like concat(nom_sci_ret,"%") and nom_ret like concat(nom_sci_ret,"%"))
SET `nom_sel` = nom_sci_complet, `nom_sel_nn` = num_nom ,
`nom_ret` = nom_ret_complet, `nom_ret_nn` = num_nom_retenu,
734,7 → 738,7
//Num nom id, nom sci +-=
$requete = "UPDATE ".$this->bd_cel.".`cel_obs`"
.' join bdtfx on `nom_sel_nn` = num_nom and and (nom_sel not like concat(nom_sci,"%") and nom_ret not like concat(nom_sci,"%"))
.' join '.$this->bd_flore.'bdtfx on `nom_sel_nn` = num_nom and and (nom_sel not like concat(nom_sci,"%") and nom_ret not like concat(nom_sci,"%"))
and (nom_sel not like concat(nom_sci_ret,"%") and nom_ret not like concat(nom_sci_ret,"%"))
SET `bd_nom_sci` = nom_sci_complet, `bd_num_nom` = num_nom ,
`bd_nom_sci_retenu` = nom_ret_complet, `bd_num_nom_retenu` = num_nom_retenu,
861,12 → 865,12
private function verifierCodeInsee() {
echo "Mise à jour des valeurs code_insee";
$requete = 'UPDATE `cel_obs` SET `ce_zone_geo` = NULL,
$requete = 'UPDATE '.$this->bd_cel.'.`cel_obs` SET `ce_zone_geo` = NULL,
commentaire = concat(if(commentaire is null, "", concat(commentaire, ", ")), if(ce_zone_geo is null, "", concat("Zone geo : ",ce_zone_geo))) where `ce_zone_geo` not like "insee-c%"';
$this->bdd->requeter($requete);
$requete = 'UPDATE `cel_obs` SET `ce_zone_geo` = substr(`ce_zone_geo`, 9, 5) where `ce_zone_geo` like "insee-c:%"';
$requete = 'UPDATE '.$this->bd_cel.'.`cel_obs` SET `ce_zone_geo` = substr(`ce_zone_geo`, 9, 5) where `ce_zone_geo` like "insee-c:%"';
$this->bdd->requeter($requete);
$requete = 'UPDATE `cel_obs` SET `ce_zone_geo` = NULL where trim(`ce_zone_geo`) = ""';
$requete = 'UPDATE '.$this->bd_cel.'.`cel_obs` SET `ce_zone_geo` = NULL where trim(`ce_zone_geo`) = ""';
$this->bdd->requeter($requete);
echo "effectuée \n";