* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ */ /** \file htdocs/html.formmail.class.php \brief Fichier de la classe permettant la génération du formulaire html d'envoi de mail unitaire \version $Revision$ */ include_once ("html.form.class.php"); /** \class FormMail \brief Classe permettant la génération du formulaire html d'envoi de mail unitaire \remarks Utilisation: $formail = new FormMail($db) \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs \remarks $formmail->show_form() affiche le formulaire */ class FormMail { var $db; var $fromname; var $frommail; var $replytoname; var $replytomail; var $toname; var $tomail; var $withfrom; var $withto; var $withtocc; var $withtopic; var $withfile; var $withbody; var $withfromreadonly; var $withreplytoreadonly; var $withtoreadonly; var $withtoccreadonly; var $withtopicreadonly; var $substit=array(); var $param=array(); var $errorstr; /** \brief Constructeur \param DB handler d'accès base de donnée */ function FormMail($DB) { $this->db = $DB; $this->withfrom=1; $this->withto=1; $this->withtocc=1; $this->withtopic=1; $this->withfile=0; $this->withbody=1; $this->withfromreadonly=1; $this->withreplytoreadonly=1; $this->withtoreadonly=0; $this->withtoccreadonly=0; $this->withtopicreadonly=0; $this->withbodyreadonly=0; return 1; } /* * \brief Effectue les substitutions des mots clés par les données en fonction du tableau $this->substit * \param chaine chaine dans laquelle faire les substitutions * \return string chaine avec les substitutions effectuées */ function make_substitutions($chaine) { foreach ($this->substit as $key=>$value) { $chaine=ereg_replace($key,$value,$chaine); } return $chaine; } /* * \brief Affiche la partie de formulaire pour saisie d'un mail en fonction des propriétés */ function show_form() { global $conf, $langs, $user; $langs->load("other"); $langs->load("mails"); $form=new Form($DB); print "\n\n"; print "
\n"; print "\n"; } /* * \brief Affiche la partie de formulaire pour saisie d'un mail * \param withtopic 1 pour proposer à la saisie le sujet * \param withbody 1 pour proposer à la saisie le corps du message * \param withfile 1 pour proposer à la saisie l'ajout d'un fichier joint * \todo Fonction a virer quand fichier /comm/mailing.php viré (= quand ecran dans /comm/mailing prets) */ function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody) { global $langs; $langs->load("other"); print "| ".$langs->trans("MailTopic")." | "; print ""; print ""; print " |
| ".$langs->trans("MailText")." | "; print ""; print ""; print " |
| ".$langs->trans("MailFile")." | "; print ""; print "trans("Upload")."\"/>"; print " |