Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Regard whitespace Rev 757 → Rev 699

/trunk/scripts/modules/bdtfx/Bdtfx.php
151,7 → 151,13
}
}
 
private function traiterResultatsFamille(&$resultats, &$noms, &$introuvables, &$introuvablesSyno) {
private function genererChpFamille() {
$this->initialiserGenerationChamps();
$this->preparerTablePrChpFamille();
$resultats = $this->recupererTuplesPrChpFamille();
$noms = array();
$introuvables = array();
$introuvablesSyno = array();
foreach ($resultats as $id => $nom) {
$nn = $nom['num_nom'];
$nnr = $nom['num_nom_retenu'];
163,8 → 169,6
} else {
if ($nn == $nnr) {// nom retenu
if (isset($noms[$nts])) {
// signifie que recupererTuplesPrChpFamille() devrait
// récupérer ce record *avant*
$noms[$nn] = $noms[$nts];
} else {
$introuvables[] = $nn;
171,8 → 175,6
}
} else {// nom synonyme
if (isset($noms[$nnr])) {
// signifie que recupererTuplesPrChpFamille() devrait
// récupérer ce record *avant*
$noms[$nn] = $noms[$nnr];
} else {
$introuvablesSyno[] = $nom;
184,29 → 186,8
$this->afficherAvancement("Attribution de leur famille aux noms en cours");
if ($this->stopperLaBoucle($this->getParametre('t'))) break;
}
}
echo "\n";
 
private function genererChpFamille() {
$this->initialiserGenerationChamps();
$this->preparerTablePrChpFamille();
$resultats = $this->recupererTuplesPrChpFamille();
$noms = array();
$introuvables = array();
$introuvablesSyno = array();
$i = 1;
 
while(true) {
printf("passe n°%d:\n", $i);
$this->traiterResultatsFamille($resultats, $noms, $introuvables, $introuvablesSyno);
echo "\n\n";
// printf("noms: %d, introuvables: %d, introuvablesSyno: %d\n", count($noms), count($introuvables), count($introuvablesSyno));
// XXX, au 22/07/2013, 3 passes sont suffisantes
// TODO: MySQL procédure stockée !
if($i++ == 3) break;
$resultats = array_merge($resultats, $introuvables, $introuvablesSyno);
$introuvables = $introuvablesSyno = array();
}
 
foreach ($introuvablesSyno as $id => $nom) {
$nn = $nom['num_nom'];
$nnr = $nom['num_nom_retenu'];