Uniformize code

This commit is contained in:
Juanjo Menent
2011-09-02 14:31:53 +00:00
parent d1d145620d
commit 8f19ee66e4
33 changed files with 639 additions and 696 deletions

View File

@@ -380,7 +380,7 @@ class FormMail
$liste=array();
$soc=new Societe($this->db);
$soc->fetch($this->withtosocid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
{
$liste[$key]=$value;
}
@@ -414,7 +414,7 @@ class FormMail
$liste=array();
$soc=new Societe($this->db);
$soc->fetch($this->withtoccsocid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
{
$liste[$key]=$value;
}
@@ -448,7 +448,7 @@ class FormMail
$liste=array();
$soc=new Societe($this->db);
$soc->fetch($this->withtosocid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
foreach ($soc->thirdparty_and_contact_email_array() as $key=>$value)
{
$liste[$key]=$value;
}
@@ -630,6 +630,58 @@ class FormMail
return $out;
}
/**
* \brief Affiche la partie de formulaire pour saisie d'un mail
* \param withtopic 1 pour proposer a la saisie le sujet
* \param withbody 1 pour proposer a la saisie le corps du message
* \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint
* \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets)
*/
function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody)
{
global $langs;
$langs->load("other");
print "<table class=\"border\" width=\"100%\">";
// Topic
if ($withtopic)
{
print "<tr>";
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
print "<td>";
print "<input type=\"text\" size=\"60\" name=\"subject\" value=\"\">";
print "</td></tr>";
}
// Message
if ($withbody)
{
print "<tr>";
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
print "<td>";
print "<textarea rows=\"8\" cols=\"72\" name=\"message\">";
print $defaultbody;
print "</textarea>";
print "</td></tr>";
}
// Si fichier joint
if ($withfile)
{
print "<tr>";
print "<td width=\"180\">".$langs->trans("MailFile")."</td>";
print "<td>";
print "<input type=\"file\" name=\"addedfile\" value=\"".$langs->trans("Upload")."\"/>";
print "</td></tr>";
}
print "</table>";
}
}
?>