Fix: apercu du background inutile car en visu sur la fiche
This commit is contained in:
parent
842d240980
commit
29600cddb9
@ -334,12 +334,6 @@ if ($_POST["action"] == 'add')
|
|||||||
$mil->bgcolor = trim($_POST["bgcolor"]);
|
$mil->bgcolor = trim($_POST["bgcolor"]);
|
||||||
$mil->bgimage = trim($_POST["bgimage"]);
|
$mil->bgimage = trim($_POST["bgimage"]);
|
||||||
|
|
||||||
if (!empty($mil->bgcolor))
|
|
||||||
{
|
|
||||||
$htmlother = new FormOther($db);
|
|
||||||
$htmlother->CreateIcon($mil->bgcolor,$mil->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $mil->titre) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle"));
|
if (! $mil->titre) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle"));
|
||||||
if (! $mil->sujet) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic"));
|
if (! $mil->sujet) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic"));
|
||||||
|
|
||||||
@ -370,12 +364,6 @@ if ($_POST["action"] == 'update')
|
|||||||
$mil->bgcolor = $_POST["bgcolor"];
|
$mil->bgcolor = $_POST["bgcolor"];
|
||||||
$mil->bgimage = $_POST["bgimage"];
|
$mil->bgimage = $_POST["bgimage"];
|
||||||
|
|
||||||
if (!empty($mil->bgcolor))
|
|
||||||
{
|
|
||||||
$htmlother = new FormOther($db);
|
|
||||||
$htmlother->CreateIcon($mil->bgcolor,$mil->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($mil->update())
|
if ($mil->update())
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$mil->id);
|
Header("Location: fiche.php?id=".$mil->id);
|
||||||
@ -634,14 +622,6 @@ else
|
|||||||
// Subject
|
// Subject
|
||||||
print '<tr><td>'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>';
|
print '<tr><td>'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>';
|
||||||
|
|
||||||
// Background color
|
|
||||||
if ($mil->bgcolor)
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("BackgroundColor").'</td><td colspan="3">';
|
|
||||||
print $htmlother->img_icon($langs->trans("BackgroundColor"),$mil->id);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Message
|
// Message
|
||||||
print '<tr><td valign="top">'.$langs->trans("MailMessage").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("MailMessage").'</td>';
|
||||||
print '<td colspan="3" bgcolor="'.($mil->bgcolor?$mil->bgcolor:'white').'">';
|
print '<td colspan="3" bgcolor="'.($mil->bgcolor?$mil->bgcolor:'white').'">';
|
||||||
|
|||||||
@ -255,6 +255,8 @@ class Mailing extends CommonObject
|
|||||||
$object->titre = $langs->trans("Draft").' '.mktime();
|
$object->titre = $langs->trans("Draft").' '.mktime();
|
||||||
$object->sujet = '';
|
$object->sujet = '';
|
||||||
$object->body = '';
|
$object->body = '';
|
||||||
|
$object->bgcolor = '';
|
||||||
|
$object->bgimage = '';
|
||||||
|
|
||||||
$object->email_from = '';
|
$object->email_from = '';
|
||||||
$object->email_replyto = '';
|
$object->email_replyto = '';
|
||||||
|
|||||||
@ -217,24 +217,23 @@ class FormOther
|
|||||||
/**
|
/**
|
||||||
* Creation d'un icone de couleur
|
* Creation d'un icone de couleur
|
||||||
* @param color Couleur de l'image
|
* @param color Couleur de l'image
|
||||||
|
* @param module Nom du module
|
||||||
* @param name Nom de l'image
|
* @param name Nom de l'image
|
||||||
|
* @param x Largeur de l'image en pixels
|
||||||
|
* @param y Hauteur de l'image en pixels
|
||||||
*/
|
*/
|
||||||
function CreateIcon($color,$name)
|
function CreateColorIcon($color,$module,$name,$x='12',$y='12')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$file = $conf->mailing->dir_temp.'/'.$name.'.png';
|
$file = $conf->$module->dir_temp.'/'.$name.'.png';
|
||||||
|
|
||||||
// On cree le repertoire contenant les icones
|
// On cree le repertoire contenant les icones
|
||||||
if (! file_exists($conf->mailing->dir_temp))
|
if (! file_exists($conf->$module->dir_temp))
|
||||||
{
|
{
|
||||||
create_exdir($conf->mailing->dir_temp);
|
create_exdir($conf->$module->dir_temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//header("Content-type: image/png");
|
|
||||||
$x = 12; //largeur de mon image en PIXELS uniquement !
|
|
||||||
$y = 12; //hauteur de mon image en PIXELS uniquement !
|
|
||||||
|
|
||||||
// On cree l'image en vraies couleurs
|
// On cree l'image en vraies couleurs
|
||||||
$image = imagecreatetruecolor($x,$y);
|
$image = imagecreatetruecolor($x,$y);
|
||||||
|
|
||||||
@ -252,18 +251,6 @@ class FormOther
|
|||||||
ImageDestroy($image);
|
ImageDestroy($image);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Affiche logo
|
|
||||||
* @param alt Texte sur le alt de l'image
|
|
||||||
* @param name Nom de l'image
|
|
||||||
* @return string Retourne tag img
|
|
||||||
*/
|
|
||||||
function img_icon($alt = "default",$name)
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
if ($alt=="default") $alt=$langs->trans("Icon");
|
|
||||||
return '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=iconmailing&file='.$name.'.png" border="0" alt="'.$alt.'" title="'.$alt.'">';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user