Line 261... |
Line 261... |
261 |
$count,
|
261 |
$count,
|
262 |
$this->limite_requete['limite']
|
262 |
$this->limite_requete['limite']
|
263 |
);
|
263 |
);
|
264 |
$req = sprintf(
|
264 |
$req = sprintf(
|
265 |
'SELECT %s, group_concat(num_taxon) as num_taxon, IF(num_statut="",1,0) AS is_null' .
|
265 |
'SELECT %s, group_concat(num_taxon) as num_taxon, IF(num_statut="",1,0) AS is_null' .
|
266 |
' FROM %s WHERE %s GROUP BY id ORDER BY %s is_null ASC, num_statut ASC %s -- %s:%d',
|
266 |
' FROM %s WHERE %s GROUP BY id ORDER BY is_null ASC, num_statut ASC, %s %s -- %s:%d',
|
Line 267... |
Line 267... |
267 |
|
267 |
|
268 |
in_array('*', $this->requete_champ) ? ' * ' : implode(', ', $this->requete_champ),
|
268 |
in_array('*', $this->requete_champ) ? ' * ' : implode(', ', $this->requete_champ),
|
269 |
$this->table,
|
269 |
$this->table,
|
270 |
$this->requete_condition ? implode(' AND ', $this->requete_condition) : 'TRUE',
|
270 |
$this->requete_condition ? implode(' AND ', $this->requete_condition) : 'TRUE',
|
271 |
$this->tri ? ($this->tri . ' ' . $this->tri_ordre . ', ') : '',
|
271 |
$this->tri ? ($this->tri . ' ' . $this->tri_ordre . ' ') : '',
|
272 |
$limiteClause,
|
272 |
$limiteClause,
|
273 |
__FILE__, __LINE__);
|
273 |
__FILE__, __LINE__);
|
274 |
return $req;
|
274 |
return $req;
|
Line 288... |
Line 288... |
288 |
$count,
|
288 |
$count,
|
289 |
$this->limite_requete['limite']);
|
289 |
$this->limite_requete['limite']);
|
290 |
}
|
290 |
}
|
291 |
$req = sprintf(
|
291 |
$req = sprintf(
|
292 |
'SELECT %s, IF(num_statut="",1,0) AS is_null' .
|
292 |
'SELECT %s, IF(num_statut="",1,0) AS is_null' .
|
293 |
' FROM %s WHERE %s ORDER BY %s is_null ASC, num_statut ASC %s -- %s:%d',
|
293 |
' FROM %s WHERE %s ORDER BY is_null ASC, num_statut ASC, %s %s -- %s:%d',
|
Line 294... |
Line 294... |
294 |
|
294 |
|
295 |
in_array('*', $this->requete_champ) ? ' * ' : implode(', ', $this->requete_champ),
|
295 |
in_array('*', $this->requete_champ) ? ' * ' : implode(', ', $this->requete_champ),
|
296 |
$this->table,
|
296 |
$this->table,
|
297 |
$this->requete_condition ? implode(' AND ', $this->requete_condition) : 'TRUE',
|
297 |
$this->requete_condition ? implode(' AND ', $this->requete_condition) : 'TRUE',
|
298 |
$this->tri ? ($this->tri . ' ' . $this->tri_ordre . ', ') : '',
|
298 |
$this->tri ? ($this->tri . ' ' . $this->tri_ordre . ' ') : '',
|
299 |
$nolimit ? '' : $limiteClause,
|
299 |
$nolimit ? '' : $limiteClause,
|
300 |
__FILE__, __LINE__);
|
300 |
__FILE__, __LINE__);
|
301 |
return $req;
|
301 |
return $req;
|
Line 456... |
Line 456... |
456 |
}
|
456 |
}
|
457 |
if (!empty($url['suivant'])) {
|
457 |
if (!empty($url['suivant'])) {
|
458 |
$table_retour_json['entete']['href.suivant'] = $url['suivant'];
|
458 |
$table_retour_json['entete']['href.suivant'] = $url['suivant'];
|
459 |
}
|
459 |
}
|
460 |
$resultat_json = array();
|
460 |
$resultat_json = array();
|
461 |
foreach ($resultat as &$tab) {
|
461 |
foreach ($resultat as $id => &$tab) {
|
462 |
$nnv = $tab['num_nom_vernaculaire'];
|
462 |
$nnv = $tab['num_nom_vernaculaire'];
|
463 |
$resultat_json[$nnv]['id'] = $tab['id'];
|
463 |
$resultat_json[$id]['id'] = $tab['id'];
|
464 |
$resultat_json[$nnv]['nom_vernaculaire'] = $tab['nom_vernaculaire'];
|
464 |
$resultat_json[$id]['nom_vernaculaire'] = $tab['nom_vernaculaire'];
|
465 |
$resultat_json[$nnv]['langue.code'] = $resultat_json[$nnv]['code_langue'] = $tab['code_langue'];
|
465 |
$resultat_json[$id]['langue.code'] = $resultat_json[$nnv]['code_langue'] = $tab['code_langue'];
|
466 |
$resultat_json[$nnv]['taxon.code'] = 'bdtfx.nt:'.$tab['num_taxon'];
|
466 |
$resultat_json[$id]['taxon.code'] = 'bdtfx.nt:'.$tab['num_taxon'];
|
467 |
if ($this->retour_format == 'max') {
|
467 |
if ($this->retour_format == 'max') {
|
468 |
$this->taxons[] = $tab['num_taxon']; // utilisé pour chercher les noms latins plus bas
|
468 |
$this->taxons[] = $tab['num_taxon']; // utilisé pour chercher les noms latins plus bas
|
469 |
if($this->champs_supp) {
|
469 |
if($this->champs_supp) {
|
470 |
//$resultat_json[$nnv] = $this->ajouterChampsOntologieLigneResultat($tab);
|
470 |
//$resultat_json[$nnv] = $this->ajouterChampsOntologieLigneResultat($tab);
|
471 |
// simple initialisation par copie de la référence de l'original
|
471 |
// simple initialisation par copie de la référence de l'original
|
472 |
$resultat_json[$nnv] = &$tab;
|
472 |
$resultat_json[$id] = &$tab;
|
473 |
} else {
|
473 |
} else {
|
474 |
$resultat_json[$nnv]['num_taxon'] = $tab['num_taxon'];
|
474 |
$resultat_json[$id]['num_taxon'] = $tab['num_taxon'];
|
475 |
$resultat_json[$nnv]['nom_retenu.code'] = $tab['num_taxon'];
|
475 |
$resultat_json[$id]['nom_retenu.code'] = $tab['num_taxon'];
|
476 |
$resultat_json[$nnv]['taxon'] = $tab['num_taxon'];
|
476 |
$resultat_json[$id]['taxon'] = $tab['num_taxon'];
|
477 |
$resultat_json[$nnv]['href'] = $this->ajouterHref('noms-vernaculaires', $tab['id']);
|
477 |
$resultat_json[$id]['href'] = $this->ajouterHref('noms-vernaculaires', $tab['id']);
|
478 |
}
|
478 |
}
|
479 |
}
|
479 |
}
|
480 |
}
|
480 |
}
|
Line 481... |
Line 481... |
481 |
|
481 |
|