445 |
florian |
1 |
<?php
|
|
|
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 |
// +------------------------------------------------------------------------------------------------------+
|
1578 |
florian |
22 |
// CVS : $Id: contact.php,v 1.4 2007-09-06 12:33:00 florian Exp $
|
445 |
florian |
23 |
/**
|
|
|
24 |
* Contact
|
|
|
25 |
*
|
|
|
26 |
* Un module d'envoi de mails a une personne de l'annuaire, choisie par une liste déroulante
|
|
|
27 |
*
|
|
|
28 |
*@package inscription
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Florian SCHMITT <florian@ecole-et-nature.org>
|
|
|
31 |
*
|
|
|
32 |
*@copyright Réseau Ecole et Nature 2005
|
1578 |
florian |
33 |
*@version $Revision: 1.4 $ $Date: 2007-09-06 12:33:00 $
|
445 |
florian |
34 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
35 |
*/
|
|
|
36 |
|
|
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
38 |
// | ENTETE du PROGRAMME |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
// | LISTE de FONCTIONS |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
function afficherContenuCorps() {
|
1578 |
florian |
47 |
include_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
|
445 |
florian |
48 |
include_once 'client/contact/langues/contact.langue.'.$GLOBALS['_GEN_commun']['i18n'].'.inc.php'; //appel du fichier de constantes des langues
|
|
|
49 |
$url = preg_replace ('/&/', '&', $GLOBALS['_GEN_commun']['url']->getURL()) ;
|
|
|
50 |
if (isset($_POST['Destinataire'])) {
|
|
|
51 |
$headers = 'From: '.$_POST['Expediteur'].' <'.$_POST['Expediteur'].'>'."\n";
|
|
|
52 |
$headers .= "X-Mailler: Florian\n";
|
|
|
53 |
if ($_POST['Destinataire']==1) $destinataire='isabelle.lepeule@ecole-et-nature.org';
|
|
|
54 |
elseif ($_POST['Destinataire']==2) $destinataire='roland.gerard@ecole-et-nature.org';
|
|
|
55 |
elseif ($_POST['Destinataire']==3) $destinataire='fabienne.chadenier@ecole-et-nature.org';
|
|
|
56 |
elseif ($_POST['Destinataire']==4) $destinataire='gaelle.haussaire@ecole-et-nature.org';
|
|
|
57 |
elseif ($_POST['Destinataire']==5) $destinataire='gregoire.delforge@ecole-et-nature.org';
|
|
|
58 |
elseif ($_POST['Destinataire']==6) $destinataire='delphine.vinck@ecole-et-nature.org';
|
|
|
59 |
elseif ($_POST['Destinataire']==7) $destinataire='catherine.stoven@ecole-et-nature.org';
|
|
|
60 |
elseif ($_POST['Destinataire']==8) $destinataire='florian@ecole-et-nature.org';
|
|
|
61 |
elseif ($_POST['Destinataire']==0) $destinataire='info@ecole-et-nature.org';
|
|
|
62 |
mail($destinataire, $_POST['Subject'], $_POST['Text'], $headers); // Envoi du mail
|
|
|
63 |
$message='<p style="clear:both;border: 2px solid #F00;padding:5px;color:#F00;background:#FFF;text-decoration: blink;">'.CON_VOTRE_MESSAGE.' <em style="font-style: italic;color:#F00;background:#FFF;"> '.$_POST['Subject'].' </em> '.CON_A_ETE_ENVOYE.'</p>';
|
|
|
64 |
}
|
|
|
65 |
$res='';
|
|
|
66 |
if (isset($message)) {$res .= $message;}
|
|
|
67 |
$res .= '<h1>'.CON_CONTACTEZ_NOUS.'</h1>'."\n";
|
|
|
68 |
$res .= '<br />'."\n";
|
|
|
69 |
$res .= '<h3>Adresse postale:</h3>'."\n";
|
|
|
70 |
$res .= '<strong>Réseau Ecole et Nature</strong><br />'."\n";
|
|
|
71 |
$res .= 'Espace République<br />'."\n";
|
|
|
72 |
$res .= '20 rue de la République<br />'."\n";
|
|
|
73 |
$res .= '34 000 Montpellier'."\n";
|
|
|
74 |
$res .= '<br /><br />'."\n";
|
|
|
75 |
$res .= '<h3>Coordonnées téléphoniques:</h3>Tél : 04 67 06 18 70<br />'."\n";
|
|
|
76 |
$res .= 'Fax : 04 67 92 02 58'."\n";
|
|
|
77 |
$res .= '<br /><br />'."\n";
|
|
|
78 |
$res .= '<h3>'.CON_ENVOYER_NOUS_MAIL.'</h3>'."\n";
|
|
|
79 |
$form_contact = new HTML_QuickForm('inscription', 'post', $url);
|
|
|
80 |
$squelette =& $form_contact->defaultRenderer();
|
|
|
81 |
$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
|
707 |
florian |
82 |
$squelette->setElementTemplate( '<label>{label} </label><br />'."\n".'{element}'."\n".
|
|
|
83 |
'<!-- BEGIN required --><span class="symbole_obligatoire">*</span><!-- END required -->'."\n".'<br />'."\n");
|
|
|
84 |
$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire">* {requiredNote}</span>'."\n");
|
|
|
85 |
$option=array('style'=>'width:500px;', 'maxlength'=>100);
|
|
|
86 |
$form_contact->setRequiredNote(CON_CHAMPS_REQUIS) ;
|
|
|
87 |
$form_contact->setJsWarnings(CON_ERREUR_SAISIE,CON_VEUILLEZ_CORRIGER);
|
445 |
florian |
88 |
$form_contact->addElement('text', 'Expediteur', CON_EXPEDITEUR, $option);
|
707 |
florian |
89 |
$form_contact->addRule('Expediteur', CON_EMAIL_REQUIS, 'required','', 'client') ;
|
|
|
90 |
$form_contact->addRule('Expediteur', CON_EMAIL_INCORRECT, 'email', '', 'client') ;
|
445 |
florian |
91 |
$liste_destinataires[0]='service d\'information générale';
|
|
|
92 |
$liste_destinataires[1]='relations nationales';
|
|
|
93 |
$liste_destinataires[2]='relations internationales';
|
|
|
94 |
$liste_destinataires[3]='formations et professionnalisation';
|
|
|
95 |
$liste_destinataires[4]='dispositifs pédagogiques';
|
|
|
96 |
$liste_destinataires[5]='soutien à l\'organisation des acteurs';
|
|
|
97 |
$liste_destinataires[6]='communication / édition';
|
|
|
98 |
$liste_destinataires[7]='service de comptabilité';
|
|
|
99 |
$liste_destinataires[8]='service informatique / hébergement Internet';
|
|
|
100 |
$option=array('style'=>'width:500px;');
|
|
|
101 |
$form_contact->addElement('select', 'Destinataire', CON_DESTINATAIRE, $liste_destinataires, $option);
|
707 |
florian |
102 |
$option=array('style'=>'width:500px;','maxlength'=>100);
|
|
|
103 |
$form_contact->addElement('text', 'Subject', CON_SUJET, $option);
|
|
|
104 |
$form_contact->addRule('Subject', CON_SUJET_REQUIS, 'required','', 'client') ;
|
445 |
florian |
105 |
$option=array('style'=>'width:500px;height:200px;white-space: pre;padding:3px;');
|
830 |
florian |
106 |
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
|
445 |
florian |
107 |
$formtexte= new HTML_QuickForm_textarea('Text', CON_MESSAGE, $option);
|
|
|
108 |
$form_contact->addElement($formtexte) ;
|
707 |
florian |
109 |
$form_contact->addRule('Text', CON_MESSAGE_REQUIS, 'required','', 'client') ;
|
445 |
florian |
110 |
$form_contact->addElement('submit', 'Envoyer', CON_ENVOYER);
|
|
|
111 |
$res .= $form_contact->toHTML();
|
|
|
112 |
return $res ;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
116 |
*
|
707 |
florian |
117 |
* $Log: not supported by cvs2svn $
|
1578 |
florian |
118 |
* Revision 1.3 2006/04/28 11:35:37 florian
|
|
|
119 |
* ajout constantes chemin
|
|
|
120 |
*
|
830 |
florian |
121 |
* Revision 1.2 2006/01/19 10:24:37 florian
|
|
|
122 |
* champs obligatoires pour le formulaire de saisie
|
|
|
123 |
*
|
707 |
florian |
124 |
* Revision 1.1 2005/09/22 13:28:50 florian
|
|
|
125 |
* Application de contact, pour envoyer des mails. Reste a faire: configuration pour choisir les destinataires dans l'annuaire.
|
445 |
florian |
126 |
*
|
|
|
127 |
*
|
707 |
florian |
128 |
*
|
445 |
florian |
129 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
130 |
*/
|
|
|
131 |
?>
|