235 |
alex |
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 |
// +------------------------------------------------------------------------------------------------------+
|
311 |
alex |
22 |
// CVS : $Id: annuaire.php,v 1.4 2005-03-24 08:24:39 alex Exp $
|
235 |
alex |
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
|
311 |
alex |
34 |
*@version $Revision: 1.4 $
|
235 |
alex |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
include_once 'client/annuaire/configuration/ann_config.inc.php' ;
|
243 |
alex |
43 |
include_once ANN_CHEMIN_LIBRAIRIE.'annuaire.fonct.php' ;
|
235 |
alex |
44 |
if (isset($lang)) {
|
243 |
alex |
45 |
include_once ANN_CHEMIN_APPLI."/langues/ann_langue_$lang.inc.php" ;
|
235 |
alex |
46 |
} else {
|
243 |
alex |
47 |
include_once ANN_CHEMIN_APPLI.'/langues/ann_langue_fr.inc.php' ;
|
235 |
alex |
48 |
}
|
|
|
49 |
|
|
|
50 |
include_once 'HTML/QuickForm.php' ;
|
|
|
51 |
|
243 |
alex |
52 |
/**
|
|
|
53 |
* Renvoie le code HTML de l'application
|
|
|
54 |
*
|
|
|
55 |
* @return string HTML
|
|
|
56 |
*/
|
235 |
alex |
57 |
|
243 |
alex |
58 |
function afficherContenuCorps () {
|
245 |
alex |
59 |
$res = "<h1 class=\"annuaire_titre1\">".ANN_TITRE."</h1>\n" ;
|
243 |
alex |
60 |
if (!$GLOBALS['AUTH']->getAuth()) {
|
245 |
alex |
61 |
$res .= AUTH_formulaire_login() ;
|
235 |
alex |
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()'";
|
245 |
alex |
81 |
GEN_stockerCodeScript($java) ;
|
235 |
alex |
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
|
311 |
alex |
86 |
if (isset($_POST['select']) && is_array ($_POST['select'])) $res .= envoie_mail () ;
|
235 |
alex |
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 |
|
311 |
alex |
104 |
/*
|
235 |
alex |
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 = "" ;
|
311 |
alex |
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() ;
|
235 |
alex |
135 |
}
|
311 |
alex |
136 |
}*/
|
235 |
alex |
137 |
/**------------------------------------------------------------------------------
|
|
|
138 |
* $Log: not supported by cvs2svn $
|
311 |
alex |
139 |
* Revision 1.3 2005/01/06 15:44:33 alex
|
|
|
140 |
* correction du javascript
|
|
|
141 |
*
|
245 |
alex |
142 |
* Revision 1.2 2005/01/06 15:17:39 alex
|
|
|
143 |
* ajout de commentaires
|
|
|
144 |
*
|
243 |
alex |
145 |
* Revision 1.1.1.1 2005/01/03 17:27:49 alex
|
|
|
146 |
* Import initial
|
|
|
147 |
*
|
235 |
alex |
148 |
* Revision 1.1 2005/01/03 17:18:43 alex
|
|
|
149 |
* retour vers la liste des participants après un ajout.
|
|
|
150 |
*
|
|
|
151 |
*
|
|
|
152 |
*-- End of source ------------------------------------------------------------*/
|
|
|
153 |
?>
|