Ajout info email emetteur sur formulaire email

This commit is contained in:
Laurent Destailleur 2008-01-07 18:39:11 +00:00
parent f718bee3d3
commit 90cce00222
6 changed files with 38 additions and 7 deletions

View File

@ -1763,9 +1763,11 @@ if ($_GET['propalid'] > 0)
$liste[$key]=$value;
}
// Cr<EFBFBD><EFBFBD> l'objet formulaire mail
// Create form object
include_once('../html.formmail.class.php');
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;

View File

@ -1930,6 +1930,8 @@ else
// Cr<43><72> l'objet formulaire mail
include_once('../html.formmail.class.php');
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -2996,8 +2996,8 @@ else
/*
* Affiche formulaire mail
*/
* Affiche formulaire mail
*/
if ($_GET['action'] == 'presend')
{
$facref = sanitize_string($fac->ref);
@ -3031,6 +3031,8 @@ else
// Créé l'objet formulaire mail
include_once(DOL_DOCUMENT_ROOT.'/html.formmail.class.php');
$formmail = new FormMail($db);
$formmail->fromtype = 'user';
$formmail->fromid = $user->id;
$formmail->fromname = $user->fullname;
$formmail->frommail = $user->email;
$formmail->withfrom=1;

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/**
@ -138,7 +137,32 @@ class FormMail
{
print '<input type="hidden" name="fromname" value="'.$this->fromname.'">';
print '<input type="hidden" name="frommail" value="'.$this->frommail.'">';
print "<tr><td width=\"180\">".$langs->trans("MailFrom")."</td><td>".$this->fromname.($this->frommail?(" &lt;".$this->frommail."&gt;"):"")."</td></tr>\n";
print "<tr><td width=\"180\">".$langs->trans("MailFrom")."</td><td>";
if ($this->fromtype == 'user')
{
$langs->load("users");
$fuser=new User($this->db);
$fuser->id=$this->fromid;
$fuser->fetch();
print $fuser->getNomUrl(1);
}
else
{
print $this->fromname;
}
if ($this->frommail)
{
print " &lt;".$this->frommail."&gt;";
}
else
{
if ($this->fromtype)
{
$langs->load("errors");
print '<font class="warning"> &lt;'.$langs->trans("ErrorNoMailDefinedForThisUser").'&gt; </font>';
}
}
print "</td></tr>\n";
print "</td></tr>\n";
}
}

View File

@ -16,4 +16,4 @@ ErrorBadParameters=Bad parameters
UserCannotBeDelete=User can not be deleted. May be it is associated on Dolibarr entities.
ErrorFieldsRequired=Some required fields were not filled.
ErrorFailedToCreateDir=Failed to create a directory. Check that Web server user has permissions to write into Dolibarr documents directory. If parameter <b>safe_mode</b> is enabled on this PHP, check that Dolibarr php files owns to web server user (or group).
ErrorNoMailDefinedForThisUser=No mail defined for this user

View File

@ -16,3 +16,4 @@ ErrorBadParameters=Parametres incorrects
UserCannotBeDelete=L'utilisateur ne peut pas etre supprimée. Peut-être est-il associé à des éléments de Dolibarr.
ErrorFieldsRequired=Des champs obligatoires n'ont pas été renseignés
ErrorFailedToCreateDir=Echec a la creation d'un repertoire. Verifiez que le user du serveur Web a bien les droits d'ecriture dans les repertoires documents de Dolibarr. Si le parametre <b>safe_mode</b> a été activé sur ce PHP, vérifier que les fichiers php dolibarr appartiennent à l'utilisateur du serveur Web.
ErrorNoMailDefinedForThisUser=EMail non defini pour cet utilisateur