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