Subversion Repositories Applications.papyrus

Rev

Rev 707 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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