Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 77 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77 Rev 96
Line 1... Line 1...
1
<?php
1
<?php
2
class NOM_SELECTION extends macroElement {
2
class NOM_SELECTION extends macroElement {
3
    function getSQL()
3
    function getSQL()
4
    {
4
    {
5
        $contexte = array();
5
        $contexte = array();
-
 
6
        if (array_key_exists('nn', $this->contexteRef) AND array_key_exists('nvp', $this->contexteRef)) {
-
 
7
            $contexte['nn'] = $this->contexteRef['nn'];
-
 
8
            $contexte['nvp'] = $this->contexteRef['nvp'];
-
 
9
            if ($contexte['nn'] != '' AND $contexte['nvp'] != '') {
-
 
10
                return 
-
 
11
                'SELECT DISTINCT 
-
 
12
                nom.en_id_nom,
-
 
13
                selection.esn_code_numerique_1,
-
 
14
                selection.esn_code_numerique_2,
-
 
15
                selection.esn_code_alphanumerique_1,
-
 
16
                selection.esn_code_alphanumerique_2,
-
 
17
                selection.esn_commentaire_nomenclatural,
-
 
18
                statut.esns_intitule_statut,
-
 
19
                statut.esns_abreviation_intitule_statut,
-
 
20
                statut.esns_description_statut,
-
 
21
                taxon.et_id_taxon,
-
 
22
                taxon.et_notes_taxon
-
 
23
                
-
 
24
                FROM 
-
 
25
                eflore_nom AS nom,
-
 
26
                eflore_selection_nom AS selection,
-
 
27
                eflore_selection_nom_statut AS statut,
-
 
28
                eflore_taxon AS taxon,
-
 
29
                eflore_projet_version AS version,
-
 
30
                eflore_projet AS projet
-
 
31
                
-
 
32
                WHERE 
-
 
33
                nom.en_id_nom = '.$contexte['nn'].' 
-
 
34
                AND nom.en_id_nom = selection.esn_id_nom 
-
 
35
                AND selection.esn_id_version_projet_taxon = '.$contexte['nvp'].' 
-
 
36
                AND selection.esn_ce_statut = statut.esns_id_statut 
-
 
37
                AND selection.esn_id_taxon = taxon.et_id_taxon 
-
 
38
                AND selection.esn_id_version_projet_taxon = taxon.et_id_version_projet_taxon 
-
 
39
                AND taxon.et_id_version_projet_taxon = version.eprv_id_version 
-
 
40
                AND version.eprv_ce_projet = projet.epr_id_projet
-
 
41
                AND version.eprv_date_fin_version IS NULL 
-
 
42
                AND projet.epr_mark_projet_consultable = 1
-
 
43
                ORDER BY version.eprv_nom ASC';
-
 
44
            }
-
 
45
        }
6
        if (array_key_exists('nn', $this->contexteRef)) {
46
        if (array_key_exists('nn', $this->contexteRef)) {
7
            $contexte['nn'] = $this->contexteRef['nn'];
47
            $contexte['nn'] = $this->contexteRef['nn'];
8
            if (!empty($contexte['nn'])) {
48
            if (!empty($contexte['nn'])) {
9
                return 
49
                return 
10
                'SELECT DISTINCT 
50
                'SELECT DISTINCT 
Line 16... Line 56...
16
                selection.esn_commentaire_nomenclatural,
56
                selection.esn_commentaire_nomenclatural,
17
                statut.esns_intitule_statut,
57
                statut.esns_intitule_statut,
18
                statut.esns_abreviation_intitule_statut,
58
                statut.esns_abreviation_intitule_statut,
19
                statut.esns_description_statut,
59
                statut.esns_description_statut,
20
                taxon.et_id_taxon,
60
                taxon.et_id_taxon,
21
                taxon.et_notes_taxon,
61
                taxon.et_notes_taxon
22
                version.eprv_id_version,
-
 
23
                version.eprv_nom,
-
 
24
                projet.epr_intitule_projet,
-
 
25
                projet.epr_abreviation_projet
-
 
Line 26... Line 62...
26
                
62
                
27
                FROM 
63
                FROM 
28
                eflore_nom AS nom,
64
                eflore_nom AS nom,
29
                eflore_selection_nom AS selection,
65
                eflore_selection_nom AS selection,
Line 35... Line 71...
35
                WHERE 
71
                WHERE 
36
                nom.en_id_nom = '.$contexte['nn'].' 
72
                nom.en_id_nom = '.$contexte['nn'].' 
37
                AND nom.en_id_nom = selection.esn_id_nom 
73
                AND nom.en_id_nom = selection.esn_id_nom 
38
                AND selection.esn_ce_statut = statut.esns_id_statut 
74
                AND selection.esn_ce_statut = statut.esns_id_statut 
39
                AND selection.esn_id_taxon = taxon.et_id_taxon 
75
                AND selection.esn_id_taxon = taxon.et_id_taxon 
-
 
76
                AND selection.esn_id_version_projet_taxon = taxon.et_id_version_projet_taxon 
40
                AND taxon.et_id_version_projet_taxon = version.eprv_id_version 
77
                AND taxon.et_id_version_projet_taxon = version.eprv_id_version 
41
                AND version.eprv_ce_projet = projet.epr_id_projet
78
                AND version.eprv_ce_projet = projet.epr_id_projet
42
                AND version.eprv_date_fin_version IS NULL 
79
                AND version.eprv_date_fin_version IS NULL 
43
                AND projet.epr_mark_projet_consultable = 1
80
                AND projet.epr_mark_projet_consultable = 1
44
                ORDER BY version.eprv_nom ASC';
81
                ORDER BY version.eprv_nom ASC';