Subversion Repositories Sites.gentiana.org

Rev

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

Rev 85 Rev 87
1
<?
1
<?
2
// +------------------------------------------------------------------------------------------------------+
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 4.1                                                                                      |
3
// | PHP version 4.1                                                                                      |
4
// +------------------------------------------------------------------------------------------------------+
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
6
// +------------------------------------------------------------------------------------------------------+
7
// | This library is free software; you can redistribute it and/or                                        |
7
// | This library is free software; you can redistribute it and/or                                        |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | License as published by the Free Software Foundation; either                                         |
9
// | License as published by the Free Software Foundation; either                                         |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// |                                                                                                      |
11
// |                                                                                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | Lesser General Public License for more details.                                                      |
15
// | Lesser General Public License for more details.                                                      |
16
// |                                                                                                      |
16
// |                                                                                                      |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | License along with this library; if not, write to the Free Software                                  |
18
// | License along with this library; if not, write to the Free Software                                  |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// +------------------------------------------------------------------------------------------------------+
20
// +------------------------------------------------------------------------------------------------------+
21
/**
21
/**
22
* programme principal du module annuaire
22
* programme principal du module annuaire
23
*
23
*
24
* programme principal du module annuaire
24
* programme principal du module annuaire
25
*
25
*
26
*@package annuaire
26
*@package annuaire
27
//Auteur original :
27
//Auteur original :
28
*@author		Alexandre Granier <alexandre@tela-botanica.org>
28
*@author		Alexandre Granier <alexandre@tela-botanica.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
30
*@author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
31
*@copyright	 Tela-Botanica 2000-2007
31
*@copyright	 Tela-Botanica 2000-2007
32
*@version	   $Id: annuaire.php,v 1.4 2005/03/24 08:24:39 alex Exp $
32
*@version	   $Id: annuaire.php,v 1.4 2005/03/24 08:24:39 alex Exp $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
// |											ENTETE du PROGRAMME									   |
37
// |											ENTETE du PROGRAMME									   |
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
 
39
 
40
include_once 'client/annuaire/configuration/ann_config.inc.php' ;
40
include_once 'client/annuaire/configuration/ann_config.inc.php' ;
41
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ;
41
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ;
42
/** Constante "dynamique" stockant la langue demandée par l'utilisateur pour l'application.*/
42
/** Constante "dynamique" stockant la langue demandée par l'utilisateur pour l'application.*/
43
define('INS_LANGUE', substr($GLOBALS['_GEN_commun']['i18n'], 0, 2));
43
define('INS_LANGUE', substr($GLOBALS['_GEN_commun']['i18n'], 0, 2));
44
$fichier_lg = ANN_CHEMIN_APPLI.'/langues/ann_langue_'.INS_LANGUE.'.inc.php';
44
$fichier_lg = ANN_CHEMIN_APPLI.'/langues/ann_langue_'.INS_LANGUE.'.inc.php';
45
if (file_exists($fichier_lg)) {
45
if (file_exists($fichier_lg)) {
46
	include_once $fichier_lg;
46
	include_once $fichier_lg;
47
} else {
47
} else {
48
	include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
48
	include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
49
}
49
}
50
include_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
50
include_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
51
 
51
 
52
// Ajout d'une feuille de style externe
52
// Ajout d'une feuille de style externe
53
GEN_stockerStyleExterne ('inscription', 'client/annuaire/annuaire.css') ;
53
GEN_stockerStyleExterne ('inscription', 'client/annuaire/annuaire.css') ;
54
 
54
 
55
/**
55
/**
56
 *  Renvoie le code HTML de l'application
56
 *  Renvoie le code HTML de l'application
57
 *
57
 *
58
 * @return  string  HTML
58
 * @return  string  HTML
59
 */
59
 */
60
function afficherContenuCorps () {
60
function afficherContenuCorps () {
61
	$res = '<h1 class="annuaire_titre1">'.ANN_TITRE.'</h1>'."\n";
61
	$res = '<h1 class="annuaire_titre1">'.ANN_TITRE.'</h1>'."\n";
62
	if (!$GLOBALS['AUTH']->getAuth())  {
62
	if (!$GLOBALS['AUTH']->getAuth())  {
63
		$res .= AUTH_formulaire_login();
63
		$res .= AUTH_formulaire_login();
64
	} else {
64
	} else {
65
		// Le code javascript des cases à cocher
65
		// Le code javascript des cases à cocher
66
		$java =
66
		$java =
67
			"function setCheckboxes(the_form)
67
			"function setCheckboxes(the_form)
68
			{
68
			{
69
			var do_check=document.forms[the_form].elements['selecttotal'].checked;
69
			var do_check=document.forms[the_form].elements['selecttotal'].checked;
70
			var elts			= document.forms[the_form].elements['select[]'];
70
			var elts			= document.forms[the_form].elements['select[]'];
71
			var elts_cnt = (typeof(elts.length) != 'undefined')
71
			var elts_cnt = (typeof(elts.length) != 'undefined')
72
								? elts.length
72
								? elts.length
73
								: 0;
73
								: 0;
74
			if (elts_cnt) {
74
			if (elts_cnt) {
75
				for (var i = 0; i < elts_cnt; i++) {
75
				for (var i = 0; i < elts_cnt; i++) {
76
					elts[i].checked = do_check;
76
					elts[i].checked = do_check;
77
				} // Fin for
77
				} // Fin for
78
			} else {
78
			} else {
79
				elts.checked = do_check;
79
				elts.checked = do_check;
80
			} // Fin if... else
80
			} // Fin if... else
81
			return true;
81
			return true;
82
		} // Fin de la fonction 'setCheckboxes()'";
82
		} // Fin de la fonction 'setCheckboxes()'";
83
		GEN_stockerCodeScript($java) ;
83
		GEN_stockerCodeScript($java) ;
84
 
84
 
85
		$res .= '<h2 class="annuaire_titre2">'.ANN_CLIQUEZ_LETTRE.'</h2>'."\n";
85
		$res .= '<h2 class="annuaire_titre2">'.ANN_CLIQUEZ_LETTRE.'</h2>'."\n";
-
 
86
		
-
 
87
		// Nettoyage des variables du POST
-
 
88
		$cles = array('corps', 'titre_mail');
-
 
89
		foreach ($cles as $cle) {
-
 
90
			if (isset($_POST[$cle]) && !empty($_POST[$cle])) {
-
 
91
				$_POST[$cle] = translittererCp1252VersIso88591(stripslashes($_POST[$cle]));
-
 
92
			}
-
 
93
		}
86
 
94
 
87
			// S'il y a un mail a envoyé, on l'envoie
95
		// S'il y a un mail a envoyé, on l'envoie
88
		if (isset($_POST['select']) && is_array ($_POST['select'])) {
96
		if (isset($_POST['select']) && is_array($_POST['select'])) {
-
 
97
			if (isset($_POST['corps']) && isset($_POST['titre_mail'])) {
-
 
98
				$res .= envoie_mail($_POST['select'], $_POST['titre_mail'], $_POST['corps']) ;
89
			$res .= envoie_mail() ;
99
			}
90
		}
100
		}
91
 
101
 
92
		$res .= parcourrirAnnu('') ;
102
		$res .= parcourrirAnnu() ;
93
	}
103
	}
94
	return $res;
104
	return $res;
95
}
105
}
96
 
106
 
97
function afficherContenuPied () {
107
function afficherContenuPied () {
98
	$sortie  = 	'<p id="annuaire_pied_page">'.ANN_PIED_INFO.
108
	$sortie  = 	'<p id="annuaire_pied_page">'.ANN_PIED_INFO.
99
					'<a href="mailto:'.ANN_PIED_MAIL.'">'.ANN_PIED_MAIL.'</a>.'.
109
					'<a href="mailto:'.ANN_PIED_MAIL.'">'.ANN_PIED_MAIL.'</a>.'.
100
				'</p>';
110
				'</p>';
101
	return $sortie;
111
	return $sortie;
102
}
112
}
103
?>
113
?>