Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 166 | Rev 173 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 166 Rev 170
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.0.3                                                                                    |
4
// | PHP version 5.0.3                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eRibo.                                                                          |
8
// | This file is part of eRibo.                                                                          |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: formulaire_taxonomique_xhtml.php,v 1.6 2005-03-15 15:11:07 jpm Exp $
24
// CVS : $Id: formulaire_taxonomique_xhtml.php,v 1.7 2005-06-09 18:09:52 jpm Exp $
25
/**
25
/**
26
* Vue affichant le formulaire de recherche taxonomique.
26
* Vue affichant le formulaire de recherche taxonomique.
27
*
27
*
28
* Permet de retourner le xhtml correspondant au formulaire de recherche taxonomique.
28
* Permet de retourner le xhtml correspondant au formulaire de recherche taxonomique.
29
*
29
*
30
*@package eFlore
30
*@package eFlore
31
*@subpackage Vues
31
*@subpackage Vues
32
//Auteur original :
32
//Auteur original :
33
*@author        Frédéric LEGENS <flegens@free.fr>
33
*@author        Frédéric LEGENS <flegens@free.fr>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
35
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@copyright     Tela-Botanica 2000-2004
36
*@copyright     Tela-Botanica 2000-2004
37
*@version       $Revision: 1.6 $ $Date: 2005-03-15 15:11:07 $
37
*@version       $Revision: 1.7 $ $Date: 2005-06-09 18:09:52 $
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
*/
39
*/
40
 
40
 
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
43
// +------------------------------------------------------------------------------------------------------+
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
44
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
45
$GLOBALS['alphabet'] = array();
45
$GLOBALS['alphabet'] = array();
46
 
46
 
47
// +------------------------------------------------------------------------------------------------------+
47
// +------------------------------------------------------------------------------------------------------+
48
// |                                            CLASSE de la VUE                                          |
48
// |                                            CLASSE de la VUE                                          |
49
// +------------------------------------------------------------------------------------------------------+
49
// +------------------------------------------------------------------------------------------------------+
50
class formulaire_taxonomique_xhtml implements iVue {
50
class formulaire_taxonomique_xhtml implements iVue {
51
    
51
    
52
    protected $leBlock;
52
    protected $leBlock;
53
    
53
    
54
    function __construct($unBlock)
54
    function __construct($unBlock)
55
    {
55
    {
56
        $this->leBlock = $unBlock;
56
        $this->leBlock = $unBlock;
57
    }
57
    }
58
    
58
    
59
    function serialiser()
59
    function serialiser()
60
    {
60
    {
61
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
61
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
62
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
62
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
63
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
63
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
64
        
64
        
65
        $retour .= '<head>'."\n";
65
        $retour .= '<head>'."\n";
66
        $retour .= '<!-- BEGIN entete -->'."\n";
66
        $retour .= '<!-- BEGIN entete -->'."\n";
67
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
67
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
68
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
68
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
69
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
69
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
70
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
70
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
71
        $retour .= '<title>Liste de noms latins</title>'."\n";
71
        $retour .= '<title>Formulaire de recherche taxonomique</title>'."\n";
72
        $retour .= '<!-- END entete -->'."\n";
72
        $retour .= '<!-- END entete -->'."\n";
73
        $retour .= '</head>'."\n";
73
        $retour .= '</head>'."\n";
74
        
74
        
75
        $retour .= '<body>'."\n";
75
        $retour .= '<body>'."\n";
76
        $retour .= '<!-- BEGIN corps -->'."\n";
76
        $retour .= '<!-- BEGIN corps -->'."\n";
77
        $retour .= '<h2>'.'Consultation par projet'.'</h2>'."\n";
77
        $retour .= '<h2>'.'Consultation par projet'.'</h2>'."\n";
78
        $retour .= '<form id="eflore_form_taxonomie" name="eflore_form_taxonomie" action="{UrlProjetTaxon}" method="post">'."\n";
78
        $retour .= '<form id="eflore_form_taxonomie" name="eflore_form_taxonomie" action="{UrlProjetTaxon}" method="post">'."\n";
79
        $retour .= '<fieldset>'."\n".'<legend>'.'Consultation par projet'.'</legend>'."\n";
79
        $retour .= '<fieldset>'."\n".'<legend>'.'Consultation par projet'.'</legend>'."\n";
80
        $retour .= '<ul>'."\n";
80
        $retour .= '<ul>'."\n";
81
        $retour .= '<li><label for="eflore_projet">'.'Projet : '.'</label>'."\n";
81
        $retour .= '<li><label for="eflore_projet">'.'Projet : '.'</label>'."\n";
82
        $retour .= '<select id="eflore_projet" name="eflore_projet">'."\n";
82
        $retour .= '<select id="eflore_projet" name="eflore_projet">'."\n";
83
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>PROJET_VERSION_TOUS','afficherProjets', null, TRUE);
83
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>PROJET_VERSION_TOUS','afficherProjets', null, TRUE);
84
        $retour .= '</select></li>'."\n";
84
        $retour .= '</select></li>'."\n";
85
        $retour .= '<li id="eflore_ordre_li"><label for="eflore_ordre">'.'afficher les taxons : '.'</label>'."\n";
85
        $retour .= '<li id="eflore_ordre_li"><label for="eflore_ordre">'.'afficher les taxons : '.'</label>'."\n";
86
        $retour .= '<select id="eflore_ordre" name="eflore_ordre">'."\n";
86
        $retour .= '<select id="eflore_ordre" name="eflore_ordre">'."\n";
87
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherOrdre');
87
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherOrdre');
88
        $retour .= '</select></li>'."\n";
88
        $retour .= '</select></li>'."\n";
89
        $retour .= '<li id="eflore_rang_li"><label for="eflore_rang">'.'au rang : '.'</label>'."\n";
89
        $retour .= '<li id="eflore_rang_li"><label for="eflore_rang">'.'au rang : '.'</label>'."\n";
90
        $retour .= '<select id="eflore_rang" name="eflore_rang">'."\n";
90
        $retour .= '<select id="eflore_rang" name="eflore_rang">'."\n";
91
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherRang');
91
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE','afficherRang');
92
        $retour .= '</select></li>'."\n";
92
        $retour .= '</select></li>'."\n";
93
        $retour .= '<li id="eflore_projet_submit"><input type="submit" value="'.'OK'.'" /></li>'."\n";
93
        $retour .= '<li><input id="eflore_taxonomie_submit" type="submit" value="'.'OK'.'" /></li>'."\n";
94
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>TAXON_RECHERCHE','creerAlphabetTaxon');
94
        $retour .= $this->leBlock->afficherPattern('FORMULAIRE_TAXONOMIQUE>TAXON_RECHERCHE','creerAlphabetTaxon');
95
        $retour .= afficherAlphabetTaxon();
95
        $retour .= afficherAlphabetTaxon();
96
        $retour .= '</ul>'."\n";
96
        $retour .= '</ul>'."\n";
97
        $retour .= '</fieldset>'."\n";
97
        $retour .= '</fieldset>'."\n";
98
        $retour .= '</form>'."\n";
98
        $retour .= '</form>'."\n";
99
        $retour .= '<!-- END corps -->'."\n";
99
        $retour .= '<!-- END corps -->'."\n";
100
        $retour .= '</body>'."\n";
100
        $retour .= '</body>'."\n";
101
        $retour .= '</html>'."\n";
101
        $retour .= '</html>'."\n";
102
        
102
        
103
        // Envoi au navigateur après encodage en entité des caractères posant problème
103
        // Envoi au navigateur après encodage en entité des caractères posant problème
104
        echo remplaceEntiteHTLM($retour);
104
        echo remplaceEntiteHTLM($retour);
105
    }
105
    }
106
}
106
}
107
 
107
 
108
// +------------------------------------------------------------------------------------------------------+
108
// +------------------------------------------------------------------------------------------------------+
109
// |                                            LISTE des FONCTIONS                                       |
109
// |                                            LISTE des FONCTIONS                                       |
110
// +------------------------------------------------------------------------------------------------------+
110
// +------------------------------------------------------------------------------------------------------+
111
function afficherProjets($donnees)
111
function afficherProjets($donnees)
112
{
112
{
113
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
113
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
114
    if ($donnees['PROJET_VERSION_TOUS']['eprv_id_version'] == $donnees['FORMULAIRE_TAXONOMIQUE']['nvp']) {
114
    if ($donnees['PROJET_VERSION_TOUS']['eprv_id_version'] == $donnees['FORMULAIRE_TAXONOMIQUE']['nvp']) {
115
        $retour .= '  <option value="'.$donnees['PROJET_VERSION_TOUS']['eprv_id_version'].'" selected="selected">';
115
        $retour .= '  <option value="'.$donnees['PROJET_VERSION_TOUS']['eprv_id_version'].'" selected="selected">';
116
    } else {
116
    } else {
117
        $retour .= '  <option value="'.$donnees['PROJET_VERSION_TOUS']['eprv_id_version'].'">';
117
        $retour .= '  <option value="'.$donnees['PROJET_VERSION_TOUS']['eprv_id_version'].'">';
118
    }
118
    }
119
    $retour .= $donnees['PROJET_VERSION_TOUS']['eprv_nom'].' - '.$donnees['PROJET_VERSION_TOUS']['epr_intitule_projet'];
119
    $retour .= $donnees['PROJET_VERSION_TOUS']['eprv_nom'].' - '.$donnees['PROJET_VERSION_TOUS']['epr_intitule_projet'];
120
    $retour .= '</option>'."\n";
120
    $retour .= '</option>'."\n";
121
    return $retour;
121
    return $retour;
122
}
122
}
123
 
123
 
124
function creerAlphabetTaxon($donnees)
124
function creerAlphabetTaxon($donnees)
125
{
125
{
126
    $chaine = '';
126
    $chaine = '';
127
    if (!empty($donnees['eni_intitule_nom'])) {
127
    if (!empty($donnees['eni_intitule_nom'])) {
128
        $chaine = $donnees['eni_intitule_nom'];
128
        $chaine = $donnees['eni_intitule_nom'];
129
    }
129
    }
130
    if (isset($chaine{0}) AND !isset($GLOBALS['alphabet'][$chaine{0}])) {
130
    if (isset($chaine{0}) AND !isset($GLOBALS['alphabet'][$chaine{0}])) {
131
        $GLOBALS['alphabet'][$chaine{0}] = $chaine{0};
131
        $GLOBALS['alphabet'][$chaine{0}] = $chaine{0};
132
    }
132
    }
133
}
133
}
134
 
134
 
135
function afficherAlphabetTaxon()
135
function afficherAlphabetTaxon()
136
{
136
{
137
    $retour = '';
137
    $retour = '';
138
    if (count($GLOBALS['alphabet']) != 0) {
138
    if (count($GLOBALS['alphabet']) != 0) {
139
        $retour .= '</p>'."\n";
139
        $retour .= '</p>'."\n";
140
        $retour .= '<p>'."\n";
140
        $retour .= '<p>'."\n";
141
        foreach ($GLOBALS['alphabet'] as $cle) {
141
        foreach ($GLOBALS['alphabet'] as $cle) {
142
            $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.ucfirst($cle).'" />'."\n";
142
            $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.ucfirst($cle).'" />'."\n";
143
        }
143
        }
144
        $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.'TOUS'.'" />'."\n";
144
        $retour .= '<input id="eflore_lettre" name="eflore_lettre" type="submit" value="'.'TOUS'.'" />'."\n";
145
    }
145
    }
146
    return $retour;
146
    return $retour;
147
}
147
}
148
 
148
 
149
function afficherOrdre($donnees)
149
function afficherOrdre($donnees)
150
{
150
{
151
    $retour = '';
151
    $retour = '';
152
    $selected_sup = '';
152
    $selected_sup = '';
153
    $selected_ega = '';
153
    $selected_ega = '';
154
    $selected_inf = '';
154
    $selected_inf = '';
155
    $selected = 'selected="selected"';
155
    $selected = 'selected="selected"';
156
    switch ($donnees['od']) {
156
    switch ($donnees['od']) {
157
        case 'sup':
157
        case 'sup':
158
            $selected_sup = $selected;
158
            $selected_sup = $selected;
159
            break;
159
            break;
160
        case 'ega':
160
        case 'ega':
161
            $selected_ega = $selected;
161
            $selected_ega = $selected;
162
            break;
162
            break;
163
        case 'inf':
163
        case 'inf':
164
            $selected_inf = $selected;
164
            $selected_inf = $selected;
165
            break;
165
            break;
166
        default:
166
        default:
167
            $selected_ega = $selected;
167
            $selected_ega = $selected;
168
            break;
168
            break;
169
    }
169
    }
170
    $retour .= '<option value="sup" '.$selected_sup.'>'.'Supérieur'.'</option>'."\n";
170
    $retour .= '<option value="sup" '.$selected_sup.'>'.'Supérieur'.'</option>'."\n";
171
    $retour .= '<option value="ega" '.$selected_ega.'>'.'Égal'.'</option>'."\n";
171
    $retour .= '<option value="ega" '.$selected_ega.'>'.'Égal'.'</option>'."\n";
172
    $retour .= '<option value="inf" '.$selected_inf.'>'.'Inférieur'.'</option>'."\n";
172
    $retour .= '<option value="inf" '.$selected_inf.'>'.'Inférieur'.'</option>'."\n";
173
    return $retour;
173
    return $retour;
174
}
174
}
175
 
175
 
176
function afficherRang($donnees)
176
function afficherRang($donnees)
177
{
177
{
178
    $retour = '';
178
    $retour = '';
179
    $selected_120 = '';
179
    $selected_120 = '';
180
    $selected_160 = '';
180
    $selected_160 = '';
181
    $selected_250 = '';
181
    $selected_250 = '';
182
    $selected_280 = '';
182
    $selected_280 = '';
183
    $selected = 'selected="selected"';
183
    $selected = 'selected="selected"';
184
    switch ($donnees['rg']) {
184
    switch ($donnees['rg']) {
185
        case 120:
185
        case 120:
186
            $selected_120 = $selected;
186
            $selected_120 = $selected;
187
            break;
187
            break;
188
        case 160:
188
        case 160:
189
            $selected_160 = $selected;
189
            $selected_160 = $selected;
190
            break;
190
            break;
191
        case 250:
191
        case 250:
192
            $selected_250 = $selected;
192
            $selected_250 = $selected;
193
            break;
193
            break;
194
        case 280:
194
        case 280:
195
            $selected_280 = $selected;
195
            $selected_280 = $selected;
196
            break;
196
            break;
197
    }
197
    }
198
    $retour .= '<option value="120" '.$selected_120.'>'.'Famille'.'</option>'."\n";
198
    $retour .= '<option value="120" '.$selected_120.'>'.'Famille'.'</option>'."\n";
199
    $retour .= '<option value="160" '.$selected_160.'>'.'Genre'.'</option>'."\n";
199
    $retour .= '<option value="160" '.$selected_160.'>'.'Genre'.'</option>'."\n";
200
    $retour .= '<option value="250" '.$selected_250.'>'.'Espèce'.'</option>'."\n";
200
    $retour .= '<option value="250" '.$selected_250.'>'.'Espèce'.'</option>'."\n";
201
    $retour .= '<option value="280" '.$selected_280.'>'.'Sous-Espèce'.'</option>'."\n";
201
    $retour .= '<option value="280" '.$selected_280.'>'.'Sous-Espèce'.'</option>'."\n";
202
    return $retour;
202
    return $retour;
203
}
203
}
204
 
204
 
205
// +------------------------------------------------------------------------------------------------------+
205
// +------------------------------------------------------------------------------------------------------+
206
// |                                            PIED du PROGRAMME                                         |
206
// |                                            PIED du PROGRAMME                                         |
207
// +------------------------------------------------------------------------------------------------------+
207
// +------------------------------------------------------------------------------------------------------+
208
 
208
 
209
 
209
 
210
/* +--Fin du code ----------------------------------------------------------------------------------------+
210
/* +--Fin du code ----------------------------------------------------------------------------------------+
211
*
211
*
212
* $Log: not supported by cvs2svn $
212
* $Log: not supported by cvs2svn $
-
 
213
* Revision 1.6  2005/03/15 15:11:07  jpm
-
 
214
* Ajout d'une sélection par défaut pour le choix de l'ordre.
-
 
215
*
213
* Revision 1.5  2005/03/15 14:45:59  tam
216
* Revision 1.5  2005/03/15 14:45:59  tam
214
* modifs labels
217
* modifs labels
215
*
218
*
216
* Revision 1.2  2005/02/09 13:06:52  jpm
219
* Revision 1.2  2005/02/09 13:06:52  jpm
217
* Modification pour utiliser le macro-élément PROJET_VERSION_TOUS.
220
* Modification pour utiliser le macro-élément PROJET_VERSION_TOUS.
218
*
221
*
219
* Revision 1.1  2005/01/28 19:45:44  jpm
222
* Revision 1.1  2005/01/28 19:45:44  jpm
220
* Début recheche taxons.
223
* Début recheche taxons.
221
*
224
*
222
* Revision 1.1  2005/01/26 10:45:33  jpm
225
* Revision 1.1  2005/01/26 10:45:33  jpm
223
* Ajout des résultats de recherche par noms vernaculaires.
226
* Ajout des résultats de recherche par noms vernaculaires.
224
*
227
*
225
*
228
*
226
* +-- Fin du code ----------------------------------------------------------------------------------------+
229
* +-- Fin du code ----------------------------------------------------------------------------------------+
227
*/
230
*/
228
?>
231
?>