Subversion Repositories Sites.gentiana.org

Rev

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

Rev 86 Rev 87
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 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
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 library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: annuaire.fonct.php,v 1.1 2005/03/24 08:46:07 alex Exp $
22
// CVS : $Id: annuaire.fonct.php,v 1.1 2005/03/24 08:46:07 alex Exp $
23
/**
23
/**
24
* Fonctions du module annuaire
24
* Fonctions du module annuaire
25
*
25
*
26
* Fonctions du module annuaire
26
* Fonctions du module annuaire
27
*
27
*
28
*@package annuaire
28
*@package annuaire
29
//Auteur original :
29
//Auteur original :
30
*@author		Alexandre Granier <alexandre@tela-botanica.org>
30
*@author		Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author		Aucun
32
*@author		Aucun
33
*@copyright	 Tela-Botanica 2000-2004
33
*@copyright	 Tela-Botanica 2000-2004
34
*@version	   $Revision: 1.1 $
34
*@version	   $Revision: 1.1 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |											ENTETE du PROGRAMME									   |
39
// |											ENTETE du PROGRAMME									   |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
 
42
 
43
 
43
 
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
45
// |										   LISTE de FONCTIONS										 |
45
// |										   LISTE de FONCTIONS										 |
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
 
47
 
48
function AUTH_formulaire_login() {
48
function AUTH_formulaire_login() {
49
	$res = '';
49
	$res = '';
50
	
50
	
51
	$url = preg_replace ('/&amp;/', '&', $GLOBALS['ann_url']->getURL()) ;
51
	$url = preg_replace ('/&amp;/', '&', $GLOBALS['ann_url']->getURL()) ;
52
 
52
 
53
	$res .= '<p>'.ANN_IDENTIFICATION_PRESENTATION_XHTML.'</p>'."\n" ;
53
	$res .= '<p>'.ANN_IDENTIFICATION_PRESENTATION_XHTML.'</p>'."\n" ;
54
	
54
	
55
	$form = new HTML_QuickForm ('inscription', 'post', $url) ;
55
	$form = new HTML_QuickForm ('inscription', 'post', $url) ;
56
	$form->addElement ('text', 'username', ANN_EMAIL) ;
56
	$form->addElement ('text', 'username', ANN_EMAIL) ;
57
	$form->addElement ('password', 'password', ANN_MOT_DE_PASSE) ;
57
	$form->addElement ('password', 'password', ANN_MOT_DE_PASSE) ;
58
	$form->addElement('submit', 'valider', ANN_VALIDER);
58
	$form->addElement('submit', 'valider', ANN_VALIDER);
59
	$res .= $form->toHTML() ;
59
	$res .= $form->toHTML() ;
60
 
60
 
61
	return $res;
61
	return $res;
62
}
62
}
63
 
63
 
64
/** function parcourrirAnnu ()  Affiche l'annuaire à partir d'une lettre
64
/** function parcourrirAnnu ()  Affiche l'annuaire à partir d'une lettre
65
*
65
*
66
*
66
*
67
*
67
*
68
*	@return string HTML
68
*	@return string HTML
69
*/
69
*/
70
function parcourrirAnnu($event) {
70
function parcourrirAnnu() {
71
 
71
 
72
	$res = '<p id="annuaire_alphabet">';
72
	$res = '<p id="annuaire_alphabet">';
73
 
73
 
74
	// Alphabet pour la rechercher par lettre du nom des inscrits
74
	// Alphabet pour la rechercher par lettre du nom des inscrits
75
	for ($i = 65 ; $i < 91 ; $i++) {
75
	for ($i = 65 ; $i < 91 ; $i++) {
76
		$GLOBALS['ann_url']->addQueryString('lettre', chr($i));
76
		$GLOBALS['ann_url']->addQueryString('lettre', chr($i));
77
		$url_lettre = $GLOBALS['ann_url']->getURL();
77
		$url_lettre = $GLOBALS['ann_url']->getURL();
78
		$GLOBALS['ann_url']->removeQueryString('lettre');
78
		$GLOBALS['ann_url']->removeQueryString('lettre');
79
		$res .= '<a href="'.$url_lettre.'">'.chr($i).'</a>&nbsp;'."\n";
79
		$res .= '<a href="'.$url_lettre.'">'.chr($i).'</a>&nbsp;'."\n";
80
	}
80
	}
81
	$GLOBALS['ann_url']->addQueryString('lettre', 'tous');
81
	$GLOBALS['ann_url']->addQueryString('lettre', 'tous');
82
	$url_lettre = $GLOBALS['ann_url']->getURL();
82
	$url_lettre = $GLOBALS['ann_url']->getURL();
83
	$GLOBALS['ann_url']->removeQueryString('lettre');
83
	$GLOBALS['ann_url']->removeQueryString('lettre');
84
	$res .= '<a href="'.$url_lettre.'">'.'Tous'.'</a>'."\n";
84
	$res .= '<a href="'.$url_lettre.'">'.'Tous'.'</a>'."\n";
85
	$res .= '</p>'."\n";
85
	$res .= '</p>'."\n";
86
 
86
 
87
	// Si aucune lettre n'est sélectionnée, attribution de la lettre par défaut
87
	// Si aucune lettre n'est sélectionnée, attribution de la lettre par défaut
88
	if (empty($_REQUEST['lettre'])) {
88
	if (empty($_REQUEST['lettre'])) {
89
		$_REQUEST['lettre'] = ANN_LETTRE_DEFAUT;
89
		$_REQUEST['lettre'] = ANN_LETTRE_DEFAUT;
90
	}
90
	}
91
	// Si une lettre est sélectionnée
91
	// Si une lettre est sélectionnée
92
	if (!empty($_REQUEST['lettre'])) {
92
	if (!empty($_REQUEST['lettre'])) {
93
		$requete = "SELECT ".ANN_ANNUAIRE.".*, ".ANN_TABLE_PAYS.".* FROM ".ANN_ANNUAIRE.",".ANN_TABLE_PAYS." WHERE ".ANN_CHAMPS_PAYS." = ".ANN_GC_ID." ";
93
		$requete = 	'SELECT '.ANN_ANNUAIRE.'.*, '.ANN_TABLE_PAYS.'.* '.
-
 
94
					'FROM '.ANN_ANNUAIRE.','.ANN_TABLE_PAYS.' '.
-
 
95
					'WHERE '.ANN_CHAMPS_PAYS.' = '.ANN_GC_ID.' ';
94
		if ($_REQUEST['lettre'] != 'tous') {
96
		if ($_REQUEST['lettre'] != 'tous') {
95
			$requete .= " AND ".ANN_CHAMPS_NOM." LIKE \"".$_REQUEST['lettre']."%\"" ;
97
			$requete .= ' AND '.ANN_CHAMPS_NOM.' LIKE "'.$_REQUEST['lettre'].'%" ' ;
96
		}
98
		}
97
		$requete .= " ORDER BY ".ANN_CHAMPS_NOM ;
99
		$requete .= 'ORDER BY '.ANN_CHAMPS_NOM;
98
		
100
		
99
		$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), $select, '', $GLOBALS['ann_db'], $niveau = 'pays').
101
		$res .= listes_inscrit ($requete, $GLOBALS['ann_url']->getURL(), '', $GLOBALS['ann_db'], $niveau = 'pays').
100
				carto_texte_cocher().
102
				carto_texte_cocher().
101
				carto_formulaire($_POST['titre'], $_POST['corps']) ;
103
				carto_formulaire();
102
	}
104
	}
103
	return $res;
105
	return $res;
104
}
106
}
105
 
107
 
106
/**
108
/**
107
 *  Renvoie le code HTML de la liste des inscrits
109
 *  Renvoie le code HTML de la liste des inscrits
108
 *  en fonction de la requete passé en parametre
110
 *  en fonction de la requete passé en parametre
109
 *
111
 *
110
 * @return  Renvoie le code HTML de la liste des inscrits
112
 * @return  Renvoie le code HTML de la liste des inscrits
111
 */
113
 */
112
function listes_inscrit ($requete, $url, $select, $argument, &$db, $niveau = 'pays') {
114
function listes_inscrit($requete, $url, $argument, &$db, $niveau = 'pays') {
113
	$resultat = $GLOBALS['ann_db']->query($requete);
115
	$resultat = $GLOBALS['ann_db']->query($requete);
114
	(DB::isError($resultat)) ? die($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) : '';
116
	(DB::isError($resultat)) ? die($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) : '';
115
	
117
	
116
	if ($resultat->numRows() > 0) {
118
	if ($resultat->numRows() > 0) {
117
		$res = "<form action=\"$url?mailer=1&amp;lettre=".$_REQUEST['lettre']."\" method=\"post\" name=\"formmail\">\n";
119
		$res = '<form action="'.$url.'?mailer=1&amp;lettre='.$_REQUEST['lettre'].'" method="post" name="formmail">'."\n";
118
		$res .= '<div id="annuaire" class="conteneur_table">	
120
		$res .= '<div id="annuaire" class="conteneur_table">	
119
					<table id="table_inscrit" class="table_cadre">
121
					<table id="table_inscrit" class="table_cadre">
120
						<colgroup>
122
						<colgroup>
121
							<col />
123
							<col />
122
							<col />
124
							<col />
123
							<col />
125
							<col />
124
							<col />
126
							<col />
125
							<col />
127
							<col />
126
							<col />
128
							<col />
127
							<col />
129
							<col />
128
						</colgroup>
130
						</colgroup>
129
							<thead class="entete_fixe">
131
							<thead class="entete_fixe">
130
								<tr>
132
								<tr>
131
									<th>&nbsp;</th>
133
									<th>&nbsp;</th>
132
									<th>'.ANN_NOM.'</th>
134
									<th>'.ANN_NOM.'</th>
133
									<th>'.ANN_PRENOM.'</th>
135
									<th>'.ANN_PRENOM.'</th>
134
									<th>'.ANN_DATE_INS.'</th>
136
									<th>'.ANN_DATE_INS.'</th>
135
									<th>'.ANN_CP.'</th>
137
									<th>'.ANN_CP.'</th>
136
									<th>'.ANN_VILLE.'</th>
138
									<th>'.ANN_VILLE.'</th>
137
									<th>'.ANN_PAYS.'</th>
139
									<th>'.ANN_PAYS.'</th>
138
								</tr>
140
								</tr>
139
							</thead>
141
							</thead>
140
							<tbody class="contenu_deroulant">';
142
							<tbody class="contenu_deroulant">';
141
		$indic = 0;
143
		$indic = 0;
142
		$i = 1;
144
		$i = 1;
143
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
145
		while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
144
			if ($indic==0) {
146
			if ($indic == 0) {
145
				$res.="<tr class=\"ligne_impaire\">\n";
147
				$res .= '<tr class="ligne_impaire">'."\n";
146
				$indic=1;
148
				$indic = 1;
147
			} else {
149
			} else {
148
				$res.="<tr class=\"ligne_paire\">\n";
150
				$res .= '<tr class="ligne_paire">'."\n";
149
				$indic=0;
151
				$indic = 0;
150
			}
152
			}
151
			$res.= "<td><input type=\"checkbox\" name=\"select[]\" value=\"".$ligne[ANN_CHAMPS_MAIL]."\" /></td>\n
153
			$res.= '<td><input type="checkbox" name="select[]" value="'.$ligne[ANN_CHAMPS_MAIL].'" /></td>'."\n".
152
							<td>".strtoupper($ligne[ANN_CHAMPS_NOM])."&nbsp;</td>\n
154
							'<td>'.strtoupper($ligne[ANN_CHAMPS_NOM]).'&nbsp;</td>'."\n".
153
							<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM]))))."&nbsp;</td>\n
155
							'<td>'.str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', $ligne[ANN_CHAMPS_PRENOM])))).'&nbsp;</td>'."\n".
154
							<td>".date("d m Y", strtotime($ligne[ANN_CHAMPS_DATE_INS]))."&nbsp;</td>\n
156
							'<td>'.date('d m Y', strtotime($ligne[ANN_CHAMPS_DATE_INS])).'&nbsp;</td>'."\n".
155
							<td>".$ligne[ANN_CHAMPS_CODE_POSTAL]."&nbsp;</td>\n
157
							'<td>'.$ligne[ANN_CHAMPS_CODE_POSTAL].'&nbsp;</td>'."\n".
156
							<td>".strtoupper($ligne[ANN_CHAMPS_VILLE])."&nbsp;</td>\n
158
							'<td>'.strtoupper($ligne[ANN_CHAMPS_VILLE]).'&nbsp;</td>'."\n".
157
							<td>".str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM])))))."&nbsp;</td>\n" ;
159
							'<td>'.str_replace(' - ', '-', ucwords(strtolower(str_replace('-', ' - ', ($ligne[ANN_GC_NOM]))))).'&nbsp;</td>'."\n";
158
			$res .= "</tr>\n";
160
			$res .= '</tr>'."\n";
159
		}
161
		}
160
		$res .= "</tbody></table></div>\n";
162
		$res .= '</tbody></table></div>'."\n";
161
	} else {
163
	} else {
162
		$res = '<p class="information">Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'."\n";
164
		$res = '<p class="information">'.'Aucun inscrit n\'a de nom commençant par '.$_REQUEST['lettre'].'</p>'."\n";
163
	}
165
	}
164
	return $res;
166
	return $res;
165
}
167
}
166
 
168
 
167
 
169
 
168
function carto_formulaire ($titre_mail="", $corps = "") {
170
function carto_formulaire() {
169
	$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
171
	$res = '<h2 class="chapo">'.ANN_ENVOYER_MAIL.'</h2>'."\n";
170
	$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>'."\n";
172
	$res .= '<p class="attention surveillance">'.ANN_SURVEILLANCE.'</p>'."\n";
171
	$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>'."\n";
173
	$res .= '<p class="information message_a_tous">'.sprintf(ANN_MESSAGE_A_TOUS, '<a href="'.ANN_URL_ACTUALITE.'">'.ANN_ACTUALITE.'</a>').'</p>'."\n";
172
	$res .= '<table>'."\n".
174
	$res .= '<table>'."\n".
173
			'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n".
175
			'<tr><td class="texte">'.ANN_SUJET.' :</td>'."\n".
174
			'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$GLOBALS['titre_mail'].'"/></td>'."\n".
176
			'<td><input class="forml" type="text" name="titre_mail" size="60" value="'.$_POST['titre_mail'].'"/></td>'."\n".
175
			'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.'&nbsp;:&nbsp;</td>'."\n".
177
			'</tr><tr><td class="texte" valign="top">'.ANN_MESSAGE.'&nbsp;:&nbsp;</td>'."\n".
176
			'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$GLOBALS['corps'].'</textarea></td>'."\n".
178
			'<td><textarea class="forml" name="corps" rows="5" cols="60">'.$_POST['corps'].'</textarea></td>'."\n".
177
			'</tr><tr><td></td><td align="center">';
179
			'</tr><tr><td></td><td align="center">';
178
	$res .= '<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'."\n";
180
	$res .= '<input class="spip_bouton" type="submit" value="'.ANN_ENVOYER.'" />'."\n";
179
	$res .= '</td>'."\n";
181
	$res .= '</td>'."\n";
180
	$res .= '</tr>'."\n";
182
	$res .= '</tr>'."\n";
181
	$res .= '</table>'."\n";
183
	$res .= '</table>'."\n";
182
	$res .= '</form>'."\n";
184
	$res .= '</form>'."\n";
183
	return $res;
185
	return $res;
184
}
186
}
185
 
187
 
186
 
188
 
187
/** function carto_texte_cocher ()
189
/** function carto_texte_cocher ()
188
*
190
*
189
*
191
*
190
*	@return string  HTML
192
*	@return string  HTML
191
*/
193
*/
192
function carto_texte_cocher () {
194
function carto_texte_cocher() {
193
	$res .= '<div class="texte">'.ANN_CHECK_UNCHECK."\n";
195
	$res .= '<div class="texte">'.ANN_CHECK_UNCHECK."\n";
194
	$res .= '&nbsp;<input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"/>'."\n";
196
	$res .= '&nbsp;<input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"/>'."\n";
195
	$res .= '</div>';
197
	$res .= '</div>';
196
	return $res;
198
	return $res;
197
}
199
}
198
 
200
 
199
 
201
 
200
/** envoie_mail()
202
/** envoie_mail()
201
 *
203
 *
202
 *
204
 *
203
 * @return  envoie l'email
205
 * @return  envoie l'email
204
 */
206
 */
205
function envoie_mail () {
207
function envoie_mail($selection, $titre_mail, $corps) {
206
	$requete = 	'SELECT '.ANN_CHAMPS_MAIL.' '.
208
	$requete = 	'SELECT '.ANN_CHAMPS_MAIL.' '.
207
				'FROM '.ANN_ANNUAIRE.' '.
209
				'FROM '.ANN_ANNUAIRE.' '.
208
				'WHERE '.ANN_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(ANN_CHAMPS_ID).'" ';
210
				'WHERE '.ANN_CHAMPS_ID.' = "'.$GLOBALS['AUTH']->getAuthData(ANN_CHAMPS_ID).'" ';
209
	$resultat = $GLOBALS['ann_db']->query($requete);
211
	$resultat = $GLOBALS['ann_db']->query($requete);
210
	if (DB::isError($resultat)) {
212
	if (DB::isError($resultat)) {
211
		die($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
213
		die($resultat->getMessage().'<br />'.$resultat->getDebugInfo());
212
	}
214
	}
213
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
215
	$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
214
	$entete = 'From: <'.$ligne[ANN_CHAMPS_MAIL].">\n";
216
	$entete = 'From: <'.$ligne[ANN_CHAMPS_MAIL].">\n";
215
	
217
 
216
	$_POST['corps'] .= "\n".ANN_PIED_MESSAGE;
218
	$corps .= "\n".ANN_PIED_MESSAGE;
217
	$_POST['corps'] = stripslashes($_POST['corps']);
-
 
-
 
219
 
218
	$liste = '';
220
	$liste = '';
219
	foreach ($_POST['select'] as $key => $value) {
221
	foreach ($selection as $key => $value) {
220
		mail($value, stripslashes($_POST['titre_mail']), $_POST['corps'] , $entete);
222
		mail($value, $titre_mail, $corps, $entete);
221
		$liste .= $value."\n";
223
		$liste .= $value."\n";
222
	}
224
	}
223
	
225
	
224
	$_POST['corps'] .= "\n----------------------------------------------------------------------------";
226
	$corps .= "\n----------------------------------------------------------------------------";
225
	$_POST['corps'] .= "\n".ANN_MESSAGE_APPLI."\n" ;
227
	$corps .= "\n".ANN_MESSAGE_APPLI."\n" ;
226
	$_POST['corps'] .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
228
	$corps .= "\n".ANN_MESSAGE_ENVOYE_A." :\n $liste" ;
227
	
-
 
228
	mail(ANN_MAIL_ADMIN, stripslashes($_POST['titre_mail']), $_POST['corps'], $entete);
-
 
-
 
229
	
229
	$_POST['corps'] = '';
230
	mail(ANN_MAIL_ADMIN, $titre_mail, $corps, $entete);
230
	$_POST['titre_mail'] = '';
231
 
-
 
232
	return '<div class="information">'.ANN_MAIL_ENVOYER.'</div>' ;
-
 
233
}
-
 
234
/** translittererVersIso88591()
-
 
235
 *
-
 
236
 * Convertit les caractères CP1252 (= ANSI) non présent dans l'ISO-8859-1 par un équivalant ressemblant.
-
 
237
 *
-
 
238
 * @return  envoie l'email
-
 
239
 */
-
 
240
function translittererCp1252VersIso88591($str, $translit = true) {
-
 
241
	$cp1252_entite_map = array(
-
 
242
	   '\x80' => '&#8364;', /* EURO SIGN */
-
 
243
	   '\x82' => '&#8218;', /* SINGLE LOW-9 QUOTATION MARK */
-
 
244
	   '\x83' => '&#402;',     /* LATIN SMALL LETTER F WITH HOOK */
-
 
245
	   '\x84' => '&#8222;', /* DOUBLE LOW-9 QUOTATION MARK */
-
 
246
	   '\x85' => '&#8230;', /* HORIZONTAL ELLIPSIS */
-
 
247
	   '\x86' => '&#8224;', /* DAGGER */
-
 
248
	   '\x87' => '&#8225;', /* DOUBLE DAGGER */
-
 
249
	   '\x88' => '&#710;',     /* MODIFIER LETTER CIRCUMFLEX ACCENT */
-
 
250
	   '\x89' => '&#8240;', /* PER MILLE SIGN */
-
 
251
	   '\x8a' => '&#352;',     /* LATIN CAPITAL LETTER S WITH CARON */
-
 
252
	   '\x8b' => '&#8249;', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
-
 
253
	   '\x8c' => '&#338;',     /* LATIN CAPITAL LIGATURE OE */
-
 
254
	   '\x8e' => '&#381;',     /* LATIN CAPITAL LETTER Z WITH CARON */
-
 
255
	   '\x91' => '&#8216;', /* LEFT SINGLE QUOTATION MARK */
-
 
256
	   '\x92' => '&#8217;', /* RIGHT SINGLE QUOTATION MARK */
-
 
257
	   '\x93' => '&#8220;', /* LEFT DOUBLE QUOTATION MARK */
-
 
258
	   '\x94' => '&#8221;', /* RIGHT DOUBLE QUOTATION MARK */
-
 
259
	   '\x95' => '&#8226;', /* BULLET */
-
 
260
	   '\x96' => '&#8211;', /* EN DASH */
-
 
261
	   '\x97' => '&#8212;', /* EM DASH */
-
 
262
	   '\x98' => '&#732;',     /* SMALL TILDE */
-
 
263
	   '\x99' => '&#8482;', /* TRADE MARK SIGN */
-
 
264
	   '\x9a' => '&#353;',     /* LATIN SMALL LETTER S WITH CARON */
-
 
265
	   '\x9b' => '&#8250;', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
-
 
266
	   '\x9c' => '&#339;',     /* LATIN SMALL LIGATURE OE */
-
 
267
	   '\x9e' => '&#382;',     /* LATIN SMALL LETTER Z WITH CARON */
-
 
268
	   '\x9f' => '&#376;'      /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
-
 
269
	);
-
 
270
	$translit_map = array(
-
 
271
	   '&#8364;' => 	'Euro', /* EURO SIGN */
-
 
272
	   '&#8218;' => ',', /* SINGLE LOW-9 QUOTATION MARK */
-
 
273
	   '&#402;' => 'f',  /* LATIN SMALL LETTER F WITH HOOK */
-
 
274
	   '&#8222;' => ',,', /* DOUBLE LOW-9 QUOTATION MARK */
-
 
275
	   '&#8230;' => '...', /* HORIZONTAL ELLIPSIS */
-
 
276
	   '&#8224;' => '+', /* DAGGER */
-
 
277
	   '&#8225;' => '++', /* DOUBLE DAGGER */
-
 
278
	   '&#710;' => '^',  /* MODIFIER LETTER CIRCUMFLEX ACCENT */
-
 
279
	   '&#8240;' => '0/00', /* PER MILLE SIGN */
-
 
280
	   '&#352;' => 'S',  /* LATIN CAPITAL LETTER S WITH CARON */
-
 
281
	   '&#8249;' => '<', /* SINGLE LEFT-POINTING ANGLE QUOTATION */
-
 
282
	   '&#338;' => 'OE',  /* LATIN CAPITAL LIGATURE OE */
-
 
283
	   '&#381;' => 'Z',  /* LATIN CAPITAL LETTER Z WITH CARON */
-
 
284
	   '&#8216;' => "'", /* LEFT SINGLE QUOTATION MARK */
-
 
285
	   '&#8217;' => "'", /* RIGHT SINGLE QUOTATION MARK */
-
 
286
	   '&#8220;' => '"', /* LEFT DOUBLE QUOTATION MARK */
-
 
287
	   '&#8221;' => '"', /* RIGHT DOUBLE QUOTATION MARK */
-
 
288
	   '&#8226;' => '*', /* BULLET */
-
 
289
	   '&#8211;' => '-', /* EN DASH */
-
 
290
	   '&#8212;' => '--', /* EM DASH */
-
 
291
	   '&#732;' => '~',  /* SMALL TILDE */
-
 
292
	   '&#8482;' => '(TM)', /* TRADE MARK SIGN */
-
 
293
	   '&#353;' => 's',  /* LATIN SMALL LETTER S WITH CARON */
-
 
294
	   '&#8250;' => '>', /* SINGLE RIGHT-POINTING ANGLE QUOTATION*/
-
 
295
	   '&#339;' => 'oe',  /* LATIN SMALL LIGATURE OE */
-
 
296
	   '&#382;' => 'z',  /* LATIN SMALL LETTER Z WITH CARON */
-
 
297
	   '&#376;' => 'Y'   /* LATIN CAPITAL LETTER Y WITH DIAERESIS*/
-
 
298
	);
-
 
299
	$str = strtr($str, $cp1252_entite_map);
-
 
300
	if ($translit) {
-
 
301
		$str = strtr($str, $translit_map);
-
 
302
	}
231
	return '<div class="information">'.ANN_MAIL_ENVOYER.'</div>' ;
303
	return $str;
232
}
304
}
233
?>
305
?>