4 |
david |
1 |
<?
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This library is free software; you can redistribute it and/or |
|
|
|
9 |
// | modify it under the terms of the GNU Lesser General Public |
|
|
|
10 |
// | License as published by the Free Software Foundation; either |
|
|
|
11 |
// | version 2.1 of the License, or (at your option) any later version. |
|
|
|
12 |
// | |
|
|
|
13 |
// | This library is distributed in the hope that it will be useful, |
|
|
|
14 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
15 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
16 |
// | Lesser General Public License for more details. |
|
|
|
17 |
// | |
|
|
|
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 |
|
|
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
22 |
// CVS : $Id: annuaire.php,v 1.4 2005/03/24 08:24:39 alex Exp $
|
|
|
23 |
/**
|
|
|
24 |
* programme principal du module annuaire
|
|
|
25 |
*
|
|
|
26 |
* programme principal du module annuaire
|
|
|
27 |
*
|
|
|
28 |
*@package annuaire
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Aucun
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
|
|
34 |
*@version $Revision: 1.4 $
|
|
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
include_once 'client/annuaire/configuration/ann_config.inc.php' ;
|
|
|
43 |
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ;
|
|
|
44 |
if (isset($lang)) {
|
|
|
45 |
include_once ANN_CHEMIN_APPLI."/langues/ann_langue_$lang.inc.php" ;
|
|
|
46 |
} else {
|
|
|
47 |
include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
include_once 'HTML/QuickForm.php' ;
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* Renvoie le code HTML de l'application
|
|
|
54 |
*
|
|
|
55 |
* @return string HTML
|
|
|
56 |
*/
|
|
|
57 |
|
|
|
58 |
function afficherContenuCorps () {
|
|
|
59 |
$res = "<h1 class=\"annuaire_titre1\">".ANN_TITRE."</h1>\n" ;
|
|
|
60 |
if (!$GLOBALS['AUTH']->getAuth()) {
|
|
|
61 |
$res .= AUTH_formulaire_login() ;
|
|
|
62 |
} else {
|
|
|
63 |
// Le code javascript des cases à cocher
|
|
|
64 |
$java =
|
|
|
65 |
"function setCheckboxes(the_form)
|
|
|
66 |
{
|
|
|
67 |
var do_check=document.forms[the_form].elements['selecttotal'].checked;
|
|
|
68 |
var elts = document.forms[the_form].elements['select[]'];
|
|
|
69 |
var elts_cnt = (typeof(elts.length) != 'undefined')
|
|
|
70 |
? elts.length
|
|
|
71 |
: 0;
|
|
|
72 |
if (elts_cnt) {
|
|
|
73 |
for (var i = 0; i < elts_cnt; i++) {
|
|
|
74 |
elts[i].checked = do_check;
|
|
|
75 |
} // Fin for
|
|
|
76 |
} else {
|
|
|
77 |
elts.checked = do_check;
|
|
|
78 |
} // Fin if... else
|
|
|
79 |
return true;
|
|
|
80 |
} // Fin de la fonction 'setCheckboxes()'";
|
|
|
81 |
GEN_stockerCodeScript($java) ;
|
|
|
82 |
|
|
|
83 |
$res .= "<h2 class=\"annuaire_titre2\">".ANN_CLIQUEZ_LETTRE."</h2>\n";
|
|
|
84 |
|
|
|
85 |
// S'il y a un mail a envoyé, on l'envoie
|
|
|
86 |
if (isset($_POST['select']) && is_array ($_POST['select'])) $res .= envoie_mail () ;
|
|
|
87 |
|
|
|
88 |
$res .= parcourrirAnnu("") ;
|
|
|
89 |
}
|
|
|
90 |
return $res;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
//==============================================================================
|
|
|
94 |
// FUNCTION putFooter ()
|
|
|
95 |
//
|
|
|
96 |
// Generation of footer.
|
|
|
97 |
//==============================================================================
|
|
|
98 |
|
|
|
99 |
function putFooter () {
|
|
|
100 |
return ' ';
|
|
|
101 |
}
|
|
|
102 |
|
|
|
103 |
|
|
|
104 |
/*
|
|
|
105 |
function envoie_mail () {
|
|
|
106 |
global $titre, $corps, $HTTP_POST_VARS, $select, $AUTH, $db ;
|
|
|
107 |
|
|
|
108 |
// On vérifie qu'un email aie été sélectionné
|
|
|
109 |
if (!is_array($select)) {
|
|
|
110 |
$res ="<div class=\"annuaire_erreur\">".ANN_VERIF_MAIL_COCHE."</divr>";
|
|
|
111 |
return $res ;
|
|
|
112 |
}
|
|
|
113 |
if ($titre == "" || $corps == "") {
|
|
|
114 |
$res = "<div class=\"annuaire_erreur\">".ANN_VERIF_TITRE."</div>\n" ;
|
|
|
115 |
return $res ;
|
|
|
116 |
}
|
|
|
117 |
|
|
|
118 |
// On récupère le mail de l'expéditeur
|
|
|
119 |
$req_exp = "select ".ANN_CHAMPS_MAIL." from ".ANN_ANNUAIRE." where ".ANN_CHAMPS_ID."=".$AUTH->getAuthData(ANN_CHAMPS_ID) ;
|
|
|
120 |
$res_exp = $db->query($req_exp) ;
|
|
|
121 |
if (DB::isError($res_exp)) {
|
|
|
122 |
die ("Echec de la requete sur annuaire_tela <br>".$res_exp->getMessage()) ;
|
|
|
123 |
}
|
|
|
124 |
$ligne_exp = $res_exp->fetchRow(DB_FETCHMODE_ASSOC) ;
|
|
|
125 |
$expediteur = $ligne_exp[ANN_CHAMPS_MAIL] ;
|
|
|
126 |
|
|
|
127 |
$corps .= ANN_PIED_MESSAGE ;
|
|
|
128 |
$liste = "" ;
|
|
|
129 |
|
|
|
130 |
if (!is_array($select)) {
|
|
|
131 |
$res.= CAR_NO_DESTINATAIRE;
|
|
|
132 |
} else {
|
|
|
133 |
$res .= "<div class=\"$classe_titre\">".CAR_MESSAGE_ENVOYE."</div>\n" ;
|
|
|
134 |
envoie_mail() ;
|
|
|
135 |
}
|
|
|
136 |
}*/
|
|
|
137 |
/**------------------------------------------------------------------------------
|
|
|
138 |
* $Log: annuaire.php,v $
|
|
|
139 |
* Revision 1.4 2005/03/24 08:24:39 alex
|
|
|
140 |
* --
|
|
|
141 |
*
|
|
|
142 |
* Revision 1.3 2005/01/06 15:44:33 alex
|
|
|
143 |
* correction du javascript
|
|
|
144 |
*
|
|
|
145 |
* Revision 1.2 2005/01/06 15:17:39 alex
|
|
|
146 |
* ajout de commentaires
|
|
|
147 |
*
|
|
|
148 |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex
|
|
|
149 |
* Import initial
|
|
|
150 |
*
|
|
|
151 |
* Revision 1.1 2005/01/03 17:18:43 alex
|
|
|
152 |
* retour vers la liste des participants après un ajout.
|
|
|
153 |
*
|
|
|
154 |
*
|
|
|
155 |
*-- End of source ------------------------------------------------------------*/
|
|
|
156 |
?>
|