91,42 → 91,12 |
return $nb_obs; |
} |
|
public function formaterPourEnvoiCel(&$tableau_observations) { |
$ids = array(); |
foreach ($tableau_observations as &$observation) { |
$observation['ce_zone_geo'] = $this->convertirCodeZoneGeoVersCodeInsee($observation['ce_zone_geo']); |
$ids_mots_cles = $this->getIdsMotsClesObservation($observation['id_observation']); |
|
$ids[] = $observation['id_observation']; |
$mots_cles_chaine = ''; |
foreach ($ids_mots_cles as $id_mot_cle) { |
$mots_cles_chaine .= $id_mot_cle['id_mot_cle'].';'; |
} |
$mots_cles_chaine = rtrim($mots_cles_chaine,';'); |
$observation['mots_cles'] = $mots_cles_chaine; |
|
foreach ($observation as $champ => $valeur) { |
if ($valeur == 'NULL') { |
$observation[$champ] = ''; |
} |
} |
} |
|
$gestion_champs_etendus = new GestionChampsEtendus2($this->config); |
$champs_supp = $gestion_champs_etendus->consulterParLots($ids); |
|
foreach ($tableau_observations as &$obs) { |
if (isset($champs_supp[$obs['id_observation']])) { |
$obs['obs_etendue'] = $champs_supp[$obs['id_observation']]; |
} |
} |
return $tableau_observations; |
} |
|
|
public function obtenirIdUtilisateurPourIdObs($id_obs) { |
$idObsP = Cel::db()->proteger($id_obs); |
$requete = 'SELECT ce_utilisateur '. |
'FROM cel_obs '. |
$requete = 'SELECT user_id as ce_utilisateur '. |
'FROM occurrence '. |
"WHERE id_observation = $idObsP ". |
' -- '.__FILE__.':'.__LINE__; |
$utilisateur_id = Cel::db()->requeter($requete); |
140,7 → 110,7 |
|
public function obtenirCourrielUtilisateurPourIdObs($id_obs) { |
$id_obs = Cel::db()->proteger($id_obs); |
$requete = "SELECT courriel_utilisateur FROM cel_obs WHERE id_observation = $id_obs"; |
$requete = "SELECT user_email as courriel_utilisateur FROM occurrence WHERE id = $id_obs"; |
|
$utilisateur_courriel = Cel::db()->requeter($requete . ' -- ' . __FILE__ . ':' . __LINE__); |
|
151,12 → 121,7 |
return $retour; |
} |
|
private function getIdsMotsClesObservation($id_observation) { |
$requete_selection_mots_cles = 'SELECT DISTINCT id_mot_cle '. |
'FROM cel_mots_cles_obs_liaison '. |
"WHERE id_element_lie = $id_observation "; |
return Cel::db()->requeter($requete_selection_mots_cles); |
} |
|
|
// TODO: fonction temporaire |
public function parserRequeteCriteres($chaine_criteres) { |