| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
class VERNACULAIRE_RECHERCHE extends macroElement {
|
2 |
class VERNACULAIRE_RECHERCHE extends macroElement {
|
| 3 |
function getSQL()
|
3 |
function getSQL()
|
| 4 |
{
|
4 |
{
|
| 5 |
$contexte = array();
|
5 |
$contexte = array();
|
| - |
|
6 |
echo '<pre>'.print_r($this->contexteRef, true).'</pre>';
|
| - |
|
7 |
if (array_key_exists('radical', $this->contexteRef) AND array_key_exists('nvp', $this->contexteRef)) {
|
| - |
|
8 |
$contexte['radical'] = $this->contexteRef['radical'];
|
| - |
|
9 |
$contexte['nvp'] = $this->contexteRef['nvp'];
|
| - |
|
10 |
if(!empty($contexte['radical']) AND !empty($contexte['nvp'])) {
|
| - |
|
11 |
return
|
| - |
|
12 |
'SELECT DISTINCT
|
| - |
|
13 |
langue.el_nom_langue_principal,
|
| - |
|
14 |
langue.el_code_langue,
|
| - |
|
15 |
zg.ezg_intitule_principal_zg,
|
| - |
|
16 |
zg.ezg_code_zg,
|
| - |
|
17 |
vernaculaire.ev_id_nom_vernaculaire,
|
| - |
|
18 |
vernaculaire.ev_intitule_nom_vernaculaire,
|
| - |
|
19 |
selection.esn_id_version_projet_taxon,
|
| - |
|
20 |
selection.esn_ce_statut,
|
| - |
|
21 |
intitule.eni_intitule_nom,
|
| - |
|
22 |
nom.en_id_nom
|
| - |
|
23 |
|
| - |
|
24 |
FROM
|
| - |
|
25 |
eflore_langue AS langue,
|
| - |
|
26 |
eflore_zg AS zg,
|
| - |
|
27 |
eflore_vernaculaire AS vernaculaire,
|
| - |
|
28 |
eflore_vernaculaire_attribution AS attribution,
|
| - |
|
29 |
eflore_selection_nom AS selection,
|
| - |
|
30 |
eflore_nom AS nom,
|
| - |
|
31 |
eflore_nom_intitule AS intitule
|
| - |
|
32 |
|
| - |
|
33 |
WHERE
|
| - |
|
34 |
vernaculaire.ev_intitule_nom_vernaculaire LIKE "'.$contexte['radical'].'"
|
| - |
|
35 |
AND attribution.eva_ce_zone_geo = zg.ezg_id_zone_geo
|
| - |
|
36 |
AND attribution.eva_ce_version_projet_zg = zg.ezg_id_version_projet_zg
|
| - |
|
37 |
AND vernaculaire.ev_ce_langue = langue.el_id_langue
|
| - |
|
38 |
AND vernaculaire.ev_ce_version_projet_langue = langue.el_id_version_projet_langue
|
| - |
|
39 |
AND attribution.eva_id_nom_vernaculaire = vernaculaire.ev_id_nom_vernaculaire
|
| - |
|
40 |
AND attribution.eva_id_version_projet_taxon_ref = '.$contexte['nvp'].'
|
| - |
|
41 |
AND selection.esn_ce_statut = 3
|
| - |
|
42 |
AND selection.esn_id_version_projet_taxon = attribution.eva_id_version_projet_taxon_ref
|
| - |
|
43 |
AND selection.esn_id_taxon = attribution.eva_id_taxon_ref
|
| - |
|
44 |
AND nom.en_id_nom = selection.esn_id_nom
|
| - |
|
45 |
AND intitule.eni_id_nom = nom.en_id_nom
|
| - |
|
46 |
AND intitule.eni_id_valeur_format = 4
|
| - |
|
47 |
AND intitule.eni_id_categorie_format = 3
|
| - |
|
48 |
AND nom.en_id_nom NOT IN
|
| - |
|
49 |
(
|
| - |
|
50 |
SELECT nom_relation.enr_id_nom_1
|
| - |
|
51 |
FROM eflore_nom_relation AS nom_relation
|
| - |
|
52 |
WHERE nom_relation.enr_id_nom_1 = nom_relation.enr_id_nom_2
|
| - |
|
53 |
AND nom_relation.enr_id_categorie_relation = 10
|
| - |
|
54 |
AND nom_relation.enr_id_valeur_relation = 3
|
| - |
|
55 |
)
|
| - |
|
56 |
|
| - |
|
57 |
ORDER BY vernaculaire.ev_intitule_nom_vernaculaire ASC';
|
| - |
|
58 |
}
|
| - |
|
59 |
}
|
| 6 |
if (array_key_exists('radical', $this->contexteRef)) {
|
60 |
if (array_key_exists('radical', $this->contexteRef)) {
|
| 7 |
$contexte['radical'] = $this->contexteRef['radical'];
|
61 |
$contexte['radical'] = $this->contexteRef['radical'];
|
| 8 |
if(!empty($contexte['radical'])) {
|
62 |
if(!empty($contexte['radical'])) {
|
| 9 |
return
|
63 |
return
|
| 10 |
'SELECT DISTINCT
|
64 |
'SELECT DISTINCT
|