Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 605 → Rev 738

/trunk/jrest/services/Inventory.php
52,6 → 52,8
}
 
$output = json_encode($value);
header("Content-type: application/json");
print($output);
 
return true;
179,14 → 181,25
// Controle detournement utilisateur
session_start();
$this->controleUtilisateur($pairs['identifiant']);
if (($pairs['num_nom_sel'] == '' || $pairs['num_nom_sel'] == 0) && $pairs['nom_sel'] != '') {
 
if ($pairs['num_nom_sel']!='') {
// Utilisation d'un nom sans numéro nomenclatural, recherche d'une correspondance sur le nom
$complement=$this->rechercherInformationsComplementairesSurNom($pairs['nom_sel']);
 
// Si l'on a trouvé un résultat sur la recherche, il s'agit vraisemblablement d'un copié-collé
// de nom de taxon qui n'a pas été validé par la selection
if(count($complement) > 0) {
$pairs['num_nom_sel'] = $complement[0][0];
}
 
}
 
// Utilisation d'un nom faisant parti du referentiel : recherche du nom valide correspondant
 
 
if ($pairs['num_nom_sel']!='') {
// Utilisation d'un nom faisant parti du referentiel : recherche du nom valide correspondant
$complement=$this->rechercherInformationsComplementaires($pairs['num_nom_sel']);
 
 
197,8 → 210,6
 
}
 
 
 
// Dernier numero d'ordre utilise :
 
$DB=$this->connectDB($this->config,'database_cel');
387,9 → 398,38
 
return $value;
 
 
 
}
function rechercherInformationsComplementairesSurNom($nom_saisi) {
$DB=$this->connectDB($this->config);
$value = array();
if($nom_saisi != null && $nom_saisi != "") {
$query = 'SELECT * FROM eflore_nom_intitule '.
'WHERE eni_id_categorie_format = 3 AND '.
'eni_id_version_projet_nom = 25 AND '.
'(eni_id_valeur_format = 3 OR eni_id_valeur_format = 4) AND '.
'eni_intitule_nom LIKE "'.$nom_saisi.'%" '.
'ORDER BY LENGTH(eni_intitule_nom)';
$res =& $DB->query($query);
if (DB::isError($res)) {
die($res->getMessage());
}
while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {
$value[]=array($row['eni_id_nom'], $row['eni_intitule_nom']);
}
}
return $value;
}
 
 
function formaterNom($rawnom) {