Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 170 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 170 Rev 173
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: recherche_nom_vernaculaire_xhtml.php,v 1.3 2005-06-09 18:09:52 jpm Exp $
24
// CVS : $Id: recherche_nom_vernaculaire_xhtml.php,v 1.4 2005-06-30 15:25:07 jpm Exp $
25
/**
25
/**
26
* Vue affichant la liste des noms vernaculaire correspondant à un radical recherché.
26
* Vue affichant la liste des noms vernaculaire correspondant à un radical recherché.
27
*
27
*
28
* Permet de retourner le html correspondant à la liste des noms vernaculaires correspondant à un radical
28
* Permet de retourner le html correspondant à la liste des noms vernaculaires correspondant à un radical
29
* recherché.
29
* recherché.
30
*
30
*
31
*@package eFlore
31
*@package eFlore
32
*@subpackage Vues
32
*@subpackage Vues
33
//Auteur original :
33
//Auteur original :
34
*@author        Frédéric LEGENS <flegens@free.fr>
34
*@author        Frédéric LEGENS <flegens@free.fr>
35
//Autres auteurs :
35
//Autres auteurs :
36
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
36
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
37
*@copyright     Tela-Botanica 2000-2004
37
*@copyright     Tela-Botanica 2000-2004
38
*@version       $Revision: 1.3 $ $Date: 2005-06-09 18:09:52 $
38
*@version       $Revision: 1.4 $ $Date: 2005-06-30 15:25:07 $
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
*/
40
*/
41
 
41
 
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                            ENTETE du PROGRAMME                                       |
43
// |                                            ENTETE du PROGRAMME                                       |
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
-
 
45
/* Inclusion du fichier permettant de gérer l'encodage des noms vernaculaires*/
45
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
46
require_once EFSE_CHEMIN_FONCTION.'eribo_encodage.fonct.php';
-
 
47
/* Variable stockant le nombre de nom verna actuellement affiché*/
46
$GLOBALS['num_nom_verna'] = 1;
48
$GLOBALS['_NOM_VERNA_']['num'] = 0;
-
 
49
/* Variable stockant le n° du message à afficher*/
-
 
50
$GLOBALS['_NOM_VERNA_']['message'] = 1;
-
 
51
/* Variable permettant de savoir si on a déjà afficher l'entête du tableau des noms verna*/
-
 
52
$GLOBALS['_NOM_VERNA_']['tete'] = true;
-
 
53
/* Variable permettant de savoir si on a déjà afficher le pied du tableau des noms verna*/
-
 
54
$GLOBALS['_NOM_VERNA_']['pied'] = true;
47
 
55
 
48
// +------------------------------------------------------------------------------------------------------+
56
// +------------------------------------------------------------------------------------------------------+
49
// |                                            CLASSE de la VUE                                          |
57
// |                                            CLASSE de la VUE                                          |
50
// +------------------------------------------------------------------------------------------------------+
58
// +------------------------------------------------------------------------------------------------------+
51
class recherche_nom_vernaculaire_xhtml implements iVue {
59
class recherche_nom_vernaculaire_xhtml implements iVue {
52
    
60
    
53
    protected $leBlock;
61
    protected $leBlock;
54
    
62
    
55
    function __construct($unBlock)
63
    function __construct($unBlock)
56
    {
64
    {
57
        $this->leBlock = $unBlock;
65
        $this->leBlock = $unBlock;
58
    }
66
    }
59
    
67
    
60
    function serialiser()
68
    function serialiser()
61
    {
69
    {
62
        $retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";
70
        /*$retour = '<?xml version="1.0" encoding="iso-8859-15" ?>'."\n";*/
63
        $retour .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
71
        $retour = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../../../commun/generique/dtd/xhtml1-strict.dtd">'."\n";
64
        $retour .= '<html xmlns="http://w ww.w3.org/1999/xhtml" lang="fr" >'."\n";
72
        $retour .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" >'."\n";
65
        
73
        
66
        $retour .= '<head>'."\n";
74
        $retour .= '<head>'."\n";
67
        $retour .= '<!-- BEGIN entete -->'."\n";
75
        $retour .= '<!-- BEGIN entete -->'."\n";
68
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
76
        $retour .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />'."\n";
69
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
77
        $retour .= '<meta http-equiv="Content-style-type" content="text/css" />'."\n";
70
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
78
        $retour .= '<meta http-equiv="Content-script-type" content="text/javascript />'."\n";
71
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
79
        $retour .= '<meta http-equiv="Content-language" content="fr" />'."\n";
72
        $retour .= '<title>Liste de noms latins</title>'."\n";
80
        $retour .= '<title>'.'Liste de noms vernaculaires'.'</title>'."\n";
73
        $retour .= '<!-- END entete -->'."\n";
81
        $retour .= '<!-- END entete -->'."\n";
74
        $retour .= '</head>'."\n";
82
        $retour .= '</head>'."\n";
75
        
83
        
76
        $retour .= '<body>'."\n";
84
        $retour .= '<body>'."\n";
77
        $retour .= '<!-- BEGIN corps -->'."\n";
85
        $retour .= '<!-- BEGIN corps -->'."\n";
78
        $retour .= '<h1>'.'Liste des noms vernaculaires'.'</h1>'."\n";
86
        $retour .= '<h1>'.'Liste des noms vernaculaires'.'</h1>'."\n";
79
        $retour .= '<table id="eflore_table_resultat_nv">'."\n";
87
        $retour .= '<h2>'.'Résumé de la recherche :'.'</h2>'."\n";
80
        $retour .= '<caption>';
88
        $retour .= '<dl>'."\n";
81
        $retour .= 'Liste des noms vernaculaires correspondant au radical "';
-
 
82
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA','afficherRadical');
89
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA','afficherRadical');
83
        $retour .= '"</caption>'."\n";
90
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA>PROJET_VERSION','afficherResumerRecherche');
84
        $retour .= '<thead>'."\n";
91
        $retour .= '</dl>'."\n";
85
        $retour .= '<tr><th>'.'N°'.'</th><th>'.'Langue'.'</th><th>'.'Pays'.'</th><th>'.'Nom vernaculaire'.'</th><th>'.'Nom latin correspondant'.'</th></tr>'."\n";
92
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA>VERNACULAIRE_RECHERCHE','afficherTableEntete');
86
        $retour .= '</thead>'."\n";
-
 
87
        $retour .= '<tbody>'."\n";
-
 
88
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA>VERNACULAIRE_RECHERCHE','afficherNomVerna');
93
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA>VERNACULAIRE_RECHERCHE','afficherNomVerna');
89
        $retour .= '</tbody>'."\n";
94
        $retour .= $this->leBlock->afficherPattern('FICHE_LISTE_NOMS_VERNA>VERNACULAIRE_RECHERCHE','afficherTablePied');
90
        $retour .= '</table>'."\n";
95
        $retour .= afficherMessage();
91
        $retour .= '<!-- END corps -->'."\n";
96
        $retour .= '<!-- END corps -->'."\n";
92
        $retour .= '</body>'."\n";
97
        $retour .= '</body>'."\n";
93
        $retour .= '</html>'."\n";
98
        $retour .= '</html>'."\n";
94
        
99
        
95
        // Envoi au navigateur après encodage en entité des caractères posant problème
100
        // Envoi au navigateur après encodage en entité des caractères posant problème
96
        echo remplaceEntiteHTLM($retour);
101
        echo remplaceEntiteHTLM($retour);
97
    }
102
    }
98
}
103
}
99
 
104
 
100
// +------------------------------------------------------------------------------------------------------+
105
// +------------------------------------------------------------------------------------------------------+
101
// |                                            LISTE des FONCTIONS                                       |
106
// |                                            LISTE des FONCTIONS                                       |
102
// +------------------------------------------------------------------------------------------------------+
107
// +------------------------------------------------------------------------------------------------------+
103
function afficherRadical($donnees)
108
function afficherRadical($donnees)
104
{
109
{
-
 
110
    //$retour = '<pre>'.print_r($donnees, true).'</pre>';
-
 
111
    $retour = '<dt>'.'Radical : '.'</dt>'."\n";
105
    return $donnees['radical'];
112
    $retour .= '<dd>'.$donnees['radical'].'</dd>'."\n";
-
 
113
    return $retour;
-
 
114
}
-
 
115
function afficherResumerRecherche($donnees)
-
 
116
{
-
 
117
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
-
 
118
    $retour = '';
-
 
119
    if (!empty($donnees['epr_intitule_projet'])) {
-
 
120
        $retour .= '<dt>'.'Référentiel : '.'</dt>'."\n";
-
 
121
        $retour .= '<dd>'.$donnees['epr_intitule_projet'].' - Version : '.$donnees['eprv_code_version'].'</dd>'."\n";
-
 
122
    }
-
 
123
    return $retour;
-
 
124
}
-
 
125
function afficherTableEntete($donnees)
-
 
126
{
-
 
127
    $retour = '';
-
 
128
    if (isset($donnees['ev_id_nom_vernaculaire']) AND $GLOBALS['_NOM_VERNA_']['tete'] == true) {
-
 
129
        $GLOBALS['_NOM_VERNA_']['tete'] = false;
-
 
130
        $retour .= '<table id="eflore_table_resultat_nv">'."\n";
-
 
131
        $retour .= '<caption>'.'Liste des noms vernaculaires correspondant au radical recherché'.'</caption>'."\n";
-
 
132
        $retour .= '<thead>'."\n";
-
 
133
        $retour .= '<tr><th>'.'N°'.'</th><th>'.'Langue'.'</th><th>'.'Pays'.'</th><th>'.'Nom vernaculaire'.'</th><th>'.'Nom latin correspondant'.'</th></tr>'."\n";
-
 
134
        $retour .= '</thead>'."\n";
-
 
135
        $retour .= '<tbody>'."\n";
-
 
136
    }
-
 
137
    return $retour;
106
}
138
}
107
 
-
 
108
function afficherNomVerna($donnees)
139
function afficherNomVerna($donnees)
109
{
140
{
-
 
141
    $retour = '';
-
 
142
    //$retour .= '<pre>'.print_r($donnees, true).'</pre>';
-
 
143
    if (isset($donnees['ev_id_nom_vernaculaire'])) {
-
 
144
        $GLOBALS['_NOM_VERNA_']['message'] = 0;
110
    $retour .= '<tr>'."\n";
145
        $retour .= '<tr>'."\n";
111
    $retour .= '<td>'.$GLOBALS['num_nom_verna']++.'</td>'."\n";
146
        $retour .= '<td>'.++$GLOBALS['_NOM_VERNA_']['num'].'</td>'."\n";
112
    $retour .= '<td><abbr title="'.$donnees['ezg_intitule_principal_zg'].'">'.$donnees['ezg_code_zg'].'</abbr></td>'."\n";
147
        $retour .= '<td><abbr title="'.$donnees['ezg_intitule_principal_zg'].'">'.$donnees['ezg_code_zg'].'</abbr></td>'."\n";
113
    $retour .= '<td><abbr title="'.$donnees['el_nom_langue_principal'].'">'.$donnees['el_code_langue'].'</abbr></td>'."\n";
148
        $retour .= '<td><abbr title="'.$donnees['el_nom_langue_principal'].'">'.$donnees['el_code_langue'].'</abbr></td>'."\n";
114
    $retour .= '<td>'.$donnees['ev_intitule_nom_vernaculaire'].'</td>'."\n";
149
        $retour .= '<td>'.$donnees['ev_intitule_nom_vernaculaire'].'</td>'."\n";
115
    if (isset($donnees['esn_ce_statut'])) {
150
        if (isset($donnees['esn_ce_statut'])) {
116
        if ($donnees['esn_ce_statut'] == 3) {//Nom retenu
151
            if ($donnees['esn_ce_statut'] == 3) {//Nom retenu
117
            $retour .= '<td><strong><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['et_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></strong></td>';
152
                $retour .= '<td><strong><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></strong></td>';
118
        } else {
153
            } else {
119
            $retour .= '<td><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></td>';
154
                $retour .= '<td><a href="func_UrlFicheNom('.$donnees['en_id_nom'].', '.$donnees['esn_id_version_projet_taxon'].')">'.$donnees['eni_intitule_nom'].'</a></td>';
-
 
155
            }
120
        }
156
        }
-
 
157
        $retour .= '</tr>'."\n";
-
 
158
    }
-
 
159
    return $retour;
-
 
160
}
-
 
161
function afficherTablePied($donnees)
-
 
162
{
-
 
163
    $retour = '';
-
 
164
    if (isset($donnees['ev_id_nom_vernaculaire']) AND $GLOBALS['_NOM_VERNA_']['pied'] == true) {
-
 
165
        $GLOBALS['_NOM_VERNA_']['pied'] = false;
-
 
166
        $retour .= '</tbody>'."\n";
-
 
167
        $retour .= '</table>'."\n";
-
 
168
    }
-
 
169
    return $retour;
-
 
170
}
-
 
171
function afficherMessage($donnees = array())
-
 
172
{
-
 
173
    $retour = '';
-
 
174
    if ($GLOBALS['_NOM_VERNA_']['message'] == 1 AND $GLOBALS['_NOM_VERNA_']['num'] == 0) {
-
 
175
        $retour .= '<p class="information">'.'Les noms vernaculaires de ce référentiel n\'ont pas encore été renseignés!'.'</p>'."\n";
-
 
176
    } elseif ($GLOBALS['_NOM_VERNA_']['num'] == 0) {
-
 
177
        $retour .= '<p class="information">'.'Aucun nom vernaculaire ne correspond à ce radical!'.'</p>'."\n";
121
    }
178
    }
122
    $retour .= '</tr>'."\n";
-
 
123
    return $retour;
179
    return $retour;
124
}
180
}
125
 
-
 
126
// +------------------------------------------------------------------------------------------------------+
181
// +------------------------------------------------------------------------------------------------------+
127
// |                                            PIED du PROGRAMME                                         |
182
// |                                            PIED du PROGRAMME                                         |
128
// +------------------------------------------------------------------------------------------------------+
183
// +------------------------------------------------------------------------------------------------------+
129
 
184
 
130
 
185
 
131
/* +--Fin du code ----------------------------------------------------------------------------------------+
186
/* +--Fin du code ----------------------------------------------------------------------------------------+
132
*
187
*
133
* $Log: not supported by cvs2svn $
188
* $Log: not supported by cvs2svn $
-
 
189
* Revision 1.3  2005/06/09 18:09:52  jpm
-
 
190
* Début gestion des référenciels dans la recherche nomenclaturale.
-
 
191
*
134
* Revision 1.2  2005/01/28 19:47:09  jpm
192
* Revision 1.2  2005/01/28 19:47:09  jpm
135
* Amélioration du rendu par ajout d'entité à la place des caractères posant pb et changement de l'encodage.
193
* Amélioration du rendu par ajout d'entité à la place des caractères posant pb et changement de l'encodage.
136
*
194
*
137
* Revision 1.1  2005/01/26 10:45:33  jpm
195
* Revision 1.1  2005/01/26 10:45:33  jpm
138
* Ajout des résultats de recherche par noms vernaculaires.
196
* Ajout des résultats de recherche par noms vernaculaires.
139
*
197
*
140
*
198
*
141
* +-- Fin du code ----------------------------------------------------------------------------------------+
199
* +-- Fin du code ----------------------------------------------------------------------------------------+
142
*/
200
*/
143
?>
201
?>