diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 782d8d2c96b..b9e378aff6d 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -26,7 +26,8 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); -require_once DOL_DOCUMENT_ROOT.'/comm/mailing/mailing.class.php'; +require_once(DOL_DOCUMENT_ROOT."/comm/mailing/mailing.class.php"); +require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); $langs->load("mails"); @@ -326,6 +327,14 @@ if ($_POST["action"] == 'add') $mil->titre = trim($_POST["titre"]); $mil->sujet = trim($_POST["sujet"]); $mil->body = trim($_POST["body"]); + $mil->bgcolor = trim($_POST["bgcolor"]); + $mil->bgimage = trim($_POST["bgimage"]); + + if (!empty($mil->bgcolor)) + { + $htmlother = new FormOther($db); + $htmlother->CreateIcon($mil->bgcolor,$mil->id); + } if (! $mil->titre) $message.=($message?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle")); if (! $mil->sujet) $message.=($message?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic")); @@ -354,6 +363,14 @@ if ($_POST["action"] == 'update') $mil->titre = $_POST["titre"]; $mil->sujet = $_POST["sujet"]; $mil->body = $_POST["body"]; + $mil->bgcolor = $_POST["bgcolor"]; + $mil->bgimage = $_POST["bgimage"]; + + if (!empty($mil->bgcolor)) + { + $htmlother = new FormOther($db); + $htmlother->CreateIcon($mil->bgcolor,$mil->id); + } if ($mil->update()) { @@ -459,13 +476,15 @@ llxHeader("","","Fiche Mailing"); $html = new Form($db); +$htmlother = new FormOther($db); + $mil = new Mailing($db); if ($_GET["action"] == 'create') { // EMailing in creation mode - print '
'."\n"; + print ''."\n"; print ''; print ''; @@ -475,10 +494,13 @@ if ($_GET["action"] == 'create') print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -605,8 +627,16 @@ else print ''; } - // Sujet + // Subject print ''; + + // Background color + if ($mil->bgcolor) + { + print ''; + } // Message print ''; @@ -737,7 +767,8 @@ else /* * Mailing en mode edition */ - print ''."\n"; + + print ''."\n"; print ''; print ''; print ''; @@ -747,6 +778,9 @@ else print ''; print ''; print ''; + print ''; print ''); + intTblDisp++; + } + } + if (intTblDisp != 256) { + for (i = intTblDisp; i < 256; i++) { + if (i % 16 == 0) {objSB.Append('');} + objSB.Append(''); + } + } +} + +fctIsInSys = function(strColor) +{ + var strOut = ''; + for (ii = 0; ii < arrSys.length; ii++) { + if (arrSys[ii][0] == strColor) {strOut = arrSys[ii][1]; break;} + } + return strOut; +} + +fctIsInName = function(strColor) +{ + var strOut = ''; + for (ii = 0; ii < arrName.length; ii++) { + if (arrName[ii][0] == strColor) {strOut = arrName[ii][1]; break;} + } + return strOut; +} + +fctOver = function(strColor, strTxt) +{ + objPreview.style.backgroundColor = strColor; + objPreviewTxt.innerHTML = strColor + '
' + strTxt; +} + +fctOut = function() +{ + objPreview.style.backgroundColor = ''; + objPreviewTxt.innerHTML = ''; +} + +fctSetColor = function(strColor, strTxt) +{ + strCurrent = strColor; + objSelected.style.backgroundColor = strColor; + objSelectedTxt.innerHTML = strColor + '
' + strTxt; +} + +fctSelect = function(strArr, strTxt) +{ + objLegend.innerHTML = ' ' + strTxt + ' '; + objGray.style.display = (strArr == 'Gray') ? 'block' : 'none'; + objSafe.style.display = (strArr == 'Safe') ? 'block' : 'none'; + objSys.style.display = (strArr == 'Sys') ? 'block' : 'none'; + objName.style.display = (strArr == 'Name') ? 'block' : 'none'; +} + +fctHide = function() +{ + fctReset(); + objGlobal.style.display = 'none'; + objCurrent = null; +} + +fctReset = function() +{ + objSelected.style.backgroundColor = ''; + objSelectedTxt.innerHTML = ''; + strCurrent = ''; +} + +fctOk = function() +{ + objCurrent.value = strCurrent.toUpperCase(); + fctHide(); +} + +fctShow = function(objForm) +{ + if (objForm) { + objCurrent = objForm; + if (objForm.value + '' != '') { + strColor = objForm.value.replace('#', ''); + strColorTxt = '' + fctIsInName(strColor); + if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} + fctSetColor('#' + strColor, strColorTxt) + } else { + fctReset(); + } + fctSelect('Name', 'Named'); + } + if (objCurrent) { + var w = h = t = l = 0; + if (self.innerHeight) { + w = self.innerWidth; + h = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { + w = document.documentElement.clientWidth; + h = document.documentElement.clientHeight; + } else if (document.body) { + w = document.body.clientWidth; + h = document.body.clientHeight; + } + if (self.pageYOffset) { + l = self.pageXOffset; + t = self.pageYOffset; + } else if (document.documentElement && document.documentElement.scrollTop) { + l = document.documentElement.scrollLeft; + t = document.documentElement.scrollTop; + } else if (document.body) { + l = document.body.scrollLeft; + t = document.body.scrollTop; + } + if (objGlobal.style.display != 'block') {objGlobal.style.display = 'block';} + objGlobal.style.top = parseInt(((h - objGlobal.offsetHeight) / 2) + t, 10) + 'px'; + objGlobal.style.left = parseInt(((w - objGlobal.offsetWidth) / 2) + l, 10) + 'px'; + } +} + +fctLoad = function() +{ + var objDiv = document.createElement('DIV'); + objDiv.id = 'objCP'; + objDiv.style.display = 'inline'; + document.body.appendChild(objDiv); + objDiv.innerHTML = objSB.toString(); + objPreview = document.getElementById('objPreview'); + objSelected = document.getElementById('objSelected'); + objPreviewTxt = document.getElementById('objPreviewTxt'); + objSelectedTxt = document.getElementById('objSelectedTxt'); + objGlobal = document.getElementById('tblGlobal'); + objGray = document.getElementById('tblGray'); + objSafe = document.getElementById('tblSafe'); + objSys = document.getElementById('tblSys'); + objName = document.getElementById('tblName'); + objLegend = document.getElementById('objLegend'); + fctSelect('Name', 'Named'); +} + +objSB.Append('
'.$langs->trans("MailTitle").'
'.$langs->trans("MailTitle").'
 
'.$langs->trans("MailFrom").'
'.$langs->trans("MailTopic").'
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColor").''; + $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing'); + print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; foreach($substitutionarray as $key => $val) @@ -491,12 +513,12 @@ if ($_GET["action"] == 'create') if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('body','',320,'dolibarr_mailings','',true,true); + $doleditor=new DolEditor('body',$_POST['body'],320,'dolibarr_mailings','',true,true); $doleditor->Create(); } else { - print ''; + print ''; } print '
'.dol_print_date($mil->date_envoi,"dayhour").'
'.$langs->trans("MailTopic").''.$mil->sujet.'
'.$langs->trans("BackgroundColor").''; + print $htmlother->img_icon($langs->trans("BackgroundColor"),$mil->id); + print '
'.$langs->trans("MailMessage").'
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColor").''; + $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing'); + print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; print '__ID__ = '.$langs->trans("IdRecord").'
'; diff --git a/htdocs/comm/mailing/mailing.class.php b/htdocs/comm/mailing/mailing.class.php index 8c4868ebe64..3e38769662a 100644 --- a/htdocs/comm/mailing/mailing.class.php +++ b/htdocs/comm/mailing/mailing.class.php @@ -45,6 +45,8 @@ class Mailing extends CommonObject var $sujet; var $body; var $nbemail; + var $bgcolor; + var $bgimage; var $email_from; var $email_replyto; @@ -139,9 +141,11 @@ class Mailing extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; $sql .= " SET titre = '".addslashes($this->titre)."'"; - $sql .= " , sujet = '".addslashes($this->sujet)."'"; - $sql .= " , body = '".addslashes($this->body)."'"; - $sql .= " , email_from = '".$this->email_from."'"; + $sql .= ", sujet = '".addslashes($this->sujet)."'"; + $sql .= ", body = '".addslashes($this->body)."'"; + $sql .= ", email_from = '".$this->email_from."'"; + $sql .= ", bgcolor = '".($this->bgcolor?$this->bgcolor:null)."'"; + $sql .= ", bgimage = '".($this->bgimage?$this->bgimage:null)."'"; $sql .= " WHERE rowid = ".$this->id; dol_syslog("Mailing::Update sql=".$sql); @@ -165,7 +169,7 @@ class Mailing extends CommonObject */ function fetch($rowid) { - $sql = "SELECT m.rowid, m.titre, m.sujet, m.body"; + $sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage"; $sql .= ", m.email_from, m.email_replyto, m.email_errorsto"; $sql .= ", m.statut, m.nbemail"; $sql .= ", m.fk_user_creat, m.fk_user_valid"; @@ -190,6 +194,8 @@ class Mailing extends CommonObject $this->titre = $obj->titre; $this->sujet = $obj->sujet; $this->body = $obj->body; + $this->bgcolor = $obj->bgcolor; + $this->bgimage = $obj->bgimage; $this->email_from = $obj->email_from; $this->email_replyto = $obj->email_replyto; diff --git a/htdocs/html.formother.class.php b/htdocs/html.formother.class.php index fb0613aaf37..288a22ba812 100644 --- a/htdocs/html.formother.class.php +++ b/htdocs/html.formother.class.php @@ -185,6 +185,85 @@ class FormOther print '
'.$langs->trans("NoProject").'
'; } } + + /** + * Affiche zone de selection de couleur + * @param set_color Couleur de pré-sélection + * @param prefix Prefix pour nom champ + * @param form_name Nom du formulaire de provenance. + */ + function select_color($set_color='', $prefix='f_color', $form_name='objForm') + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + + /** + * Creation d'un icone de couleur + * @param color Couleur de l'image + * @param name Nom de l'image + */ + function CreateIcon($color,$name) + { + global $conf; + + $file = $conf->mailing->dir_temp.'/'.$name.'.png'; + + // On cree le repertoire contenant les icones + if (! file_exists($conf->mailing->dir_temp)) + { + create_exdir($conf->mailing->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 + $image = imagecreatetruecolor($x,$y); + + $color = substr($color,1,6); + + $rouge = hexdec(substr($color,0,2)); //conversion du canal rouge + $vert = hexdec(substr($color,2,2)); //conversion du canal vert + $bleu = hexdec(substr($color,4,2)); //conversion du canal bleu + + $couleur = imagecolorallocate($image,$rouge,$vert,$bleu); + //print $rouge.$vert.$bleu; + imagefill($image,0,0,$couleur); //on remplit l'image + // On cree la couleur et on l'attribue à une variable pour ne pas la perdre + ImagePng($image,$file); //renvoie une image sous format png + 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 ''.$alt.''; + } } diff --git a/htdocs/includes/modules/modMailing.class.php b/htdocs/includes/modules/modMailing.class.php index 3934c322d22..c4c6383ca07 100644 --- a/htdocs/includes/modules/modMailing.class.php +++ b/htdocs/includes/modules/modMailing.class.php @@ -82,7 +82,7 @@ class modMailing extends DolibarrModules $this->rights[1][0] = 221; // id de la permission $this->rights[1][1] = 'Consulter les mailings'; // libelle de la permission $this->rights[1][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[1][3] = 1; // La permission est-elle une permission par d�faut + $this->rights[1][3] = 1; // La permission est-elle une permission par defaut $this->rights[1][4] = 'lire'; $this->rights[2][0] = 222; diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index 047266519fd..647415c74aa 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -695,19 +695,12 @@ class CMailFile * @param unknown_type $msg * @return unknown */ - function checkIfHTML($msg,$bg='') + function checkIfHTML($msg,$css='') { if (!eregi('^[ \t]*'; - } + if (!empty($css)) $out.= $css; $out.= ""; $out.= $msg; $out.= ""; @@ -719,6 +712,24 @@ class CMailFile return $out; } + + /** + * Build a css style + * + * @param $value + * @return css + */ + function buildCSS($value) + { + // Todo: finir la construction + $out = ''; + + return $out; + } /** \brief Permet d'attacher un fichier diff --git a/htdocs/lib/lib_colorpicker.js b/htdocs/lib/lib_colorpicker.js new file mode 100644 index 00000000000..3798c7ad95e --- /dev/null +++ b/htdocs/lib/lib_colorpicker.js @@ -0,0 +1,260 @@ +StringBuilder = function() +{ + this.arrStr = new Array(); + this.Append = function( inVAL ) + { + this.arrStr[this.arrStr.length] = inVAL; + } + this.toString = function() + { + return this.arrStr.join(''); + } + this.Init = function() + { + this.arrStr = null; + this.arrStr = new Array(); + } +} + +var objSB = new StringBuilder(); + +var arrGray = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); +var arrSafe = new Array('00','33','66','99','CC','FF'); +var arrSys = [['D4D0C8', 'ActiveBorder'],['0A246A', 'ActiveCaption'],['808080', 'AppWorkspace'],['3A6EA5', 'Background'],['D4D0C8', 'ButtonFace'],['FFFFFF', 'ButtonHighlight'],['808080', 'ButtonShadow'],['000000', 'ButtonText'],['FFFFFF', 'CaptionText'],['808080', 'GrayText'],['0A246A', 'Highlight'],['FFFFFF', 'HighlightText'],['D4D0C8', 'InactiveBorder'],['0A246A', 'InactiveCaption'],['D4D0C8', 'InactiveCaptionText'],['FFFFE1', 'InfoBackground'],['000000', 'InfoText'],['D4D0C8', 'Menu'],['000000', 'MenuText'],['D4D0C8', 'Scrollbar'],['404040', 'ThreedDarkShadow'],['D4D0C8', 'ThreedFace'],['FFFFFF', 'ThreedHighlight'],['D4D0C8', 'ThreedLightShadow'],['808080', 'ThreedShadow'],['FFFFFF', 'Window'],['000000', 'WindowFrame'],['000000', 'WindowText']]; +var arrName = [['FF0000', 'red'],['FFFF00', 'yellow'],['00FF00', 'lime'],['00FFFF', 'cyan'],['0000FF', 'blue'],['FF00FF', 'magenta'],['FFFFFF', 'white'],['F5F5F5', 'whitesmoke'],['DCDCDC', 'gainsboro'],['D3D3D3', 'lightgrey'],['C0C0C0', 'silver'],['A9A9A9', 'darkgray'],['808080', 'gray'],['696969', 'dimgray'],['000000', 'black'],['2F4F4F', 'darkslategray'],['708090', 'slategray'],['778899', 'lightslategray'],['4682B4', 'steelblue'],['4169E1', 'royalblue'],['6495ED', 'cornflowerblue'],['B0C4DE', 'lightsteelblue'],['7B68EE', 'mediumslateblue'],['6A5ACD', 'slateblue'],['483D8B', 'darkslateblue'],['191970', 'midnightblue'],['000080', 'navy'],['00008B', 'darkblue'],['0000CD', 'mediumblue'],['1E90FF', 'dodgerblue'],['00BFFF', 'deepskyblue'],['87CEFA', 'lightskyblue'],['87CEEB', 'skyblue'],['ADD8E6', 'lightblue'],['B0E0E6', 'powderblue'],['F0FFFF', 'azure'],['E0FFFF', 'lightcyan'],['AFEEEE', 'paleturquoise'],['48D1CC', 'mediumturquoise'],['20B2AA', 'lightseagreen'],['008B8B', 'darkcyan'],['008080', 'teal'],['5F9EA0', 'cadetblue'],['00CED1', 'darkturquoise'],['00FFFF', 'aqua'],['40E0D0', 'turquoise'],['7FFFD4', 'aquamarine'],['66CDAA', 'mediumaquamarine'],['8FBC8F', 'darkseagreen'],['3CB371', 'mediumseagreen'],['2E8B57', 'seagreen'],['006400', 'darkgreen'],['008000', 'green'],['228B22', 'forestgreen'],['32CD32', 'limegreen'],['00FF00', 'lime'],['7FFF00', 'chartreuse'],['7CFC00', 'lawngreen'],['ADFF2F', 'greenyellow'],['98FB98', 'palegreen'],['90EE90', 'lightgreen'],['00FF7F', 'springgreen'],['00FA9A', 'mediumspringgreen'],['556B2F', 'darkolivegreen'],['6B8E23', 'olivedrab'],['808000', 'olive'],['BDB76B', 'darkkhaki'],['B8860B', 'darkgoldenrod'],['DAA520', 'goldenrod'],['FFD700', 'gold'],['F0E68C', 'khaki'],['EEE8AA', 'palegoldenrod'],['FFEBCD', 'blanchedalmond'],['FFE4B5', 'moccasin'],['F5DEB3', 'wheat'],['FFDEAD', 'navajowhite'],['DEB887', 'burlywood'],['D2B48C', 'tan'],['BC8F8F', 'rosybrown'],['A0522D', 'sienna'],['8B4513', 'saddlebrown'],['D2691E', 'chocolate'],['CD853F', 'peru'],['F4A460', 'sandybrown'],['8B0000', 'darkred'],['800000', 'maroon'],['A52A2A', 'brown'],['B22222', 'firebrick'],['CD5C5C', 'indianred'],['F08080', 'lightcoral'],['FA8072', 'salmon'],['E9967A', 'darksalmon'],['FFA07A', 'lightsalmon'],['FF7F50', 'coral'],['FF6347', 'tomato'],['FF8C00', 'darkorange'],['FFA500', 'orange'],['FF4500', 'orangered'],['DC143C', 'crimson'],['FF0000', 'red'],['FF1493', 'deeppink'],['FF00FF', 'fuchsia'],['FF69B4', 'hotpink'],['FFB6C1', 'lightpink'],['FFC0CB', 'pink'],['DB7093', 'palevioletred'],['C71585', 'mediumvioletred'],['800080', 'purple'],['8B008B', 'darkmagenta'],['9370DB', 'mediumpurple'],['8A2BE2', 'blueviolet'],['4B0082', 'indigo'],['9400D3', 'darkviolet'],['9932CC', 'darkorchid'],['BA55D3', 'mediumorchid'],['DA70D6', 'orchid'],['EE82EE', 'violet'],['DDA0DD', 'plum'],['D8BFD8', 'thistle'],['E6E6FA', 'lavender'],['F8F8FF', 'ghostwhite'],['F0F8FF', 'aliceblue'],['F5FFFA', 'mintcream'],['F0FFF0', 'honeydew'],['FAFAD2', 'lightgoldenrodyellow'],['FFFACD', 'lemonchiffon'],['FFF8DC', 'cornsilk'],['FFFFE0', 'lightyellow'],['FFFFF0', 'ivory'],['FFFAF0', 'floralwhite'],['FAF0E6', 'linen'],['FDF5E6', 'oldlace'],['FAEBD7', 'antiquewhite'],['FFE4C4', 'bisque'],['FFDAB9', 'peachpuff'],['FFEFD5', 'papayawhip'],['FFF5EE', 'seashell'],['FFF0F5', 'lavenderblush'],['FFE4E1', 'mistyrose'],['FFFAFA', 'snow']]; + +var intTdDisp = intTblDisp = 0; +var i = j = k = 0; +var objCurrent = objGray = objSafe = objSys = objName = objLegend = objPreview = objSelected = objPreviewTxt = objSelectedTxt = objGlobal = null; +var strColor = '', strColorTxt = '', strCurrent = ''; + +fctTblFeed = function() +{ + if (intTdDisp != 16) { + for (i = intTdDisp; i < 16; i++) { + objSB.Append('
 
 
'); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append('
'); + +objSB.Append(''); +for (i = 0; i < arrGray.length; i++) { + for (j = 0; j < arrGray.length; j++) { + strColor = '' + arrGray[i] + arrGray[j] + arrGray[i] + arrGray[j] + arrGray[i] + arrGray[j]; + strColorTxt = '' + fctIsInName(strColor); + if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} + objSB.Append(''); + intTdDisp++; + intTblDisp++; + } + if (i < arrGray.length - 1) { + objSB.Append(''); + intTdDisp = 0; + } +} +fctTblFeed(); +objSB.Append('
 
'); +intTdDisp = intTblDisp = 0; + +objSB.Append(''); +for (i = 0; i < arrSafe.length; i++) { + for (j = 0; j < arrSafe.length; j++) { + for (k = 0; k < arrSafe.length; k++) { + if (intTblDisp % 16 == 0 && intTdDisp != 0) { + objSB.Append(''); + intTdDisp = 0; + } + strColor = '' + arrSafe[i] + arrSafe[j] + arrSafe[k]; + strColorTxt = '' + fctIsInName(strColor); + if (strColorTxt == '') {strColorTxt = '' + fctIsInSys(strColor);} + objSB.Append(''); + intTdDisp++; + intTblDisp++; + } + } +} +fctTblFeed(); +objSB.Append('
 
'); +intTdDisp = intTblDisp = 0; + +objSB.Append(''); +for (i = 0; i < arrSys.length; i++) { + if (intTblDisp % 16 == 0 && intTdDisp != 0) { + objSB.Append(''); + intTdDisp = 0; + } + strColor = '' + arrSys[i][0]; + strColorTxt = '' + arrSys[i][1]; + objSB.Append(''); + intTdDisp++; + intTblDisp++; +} +fctTblFeed(); +objSB.Append('
 
'); +intTdDisp = intTblDisp = 0; + +objSB.Append(''); +for (i = 0; i < arrName.length; i++) { + if (intTblDisp % 16 == 0 && intTdDisp != 0) { + objSB.Append(''); + intTdDisp = 0; + } + strColor = '' + arrName[i][0]; + strColorTxt = '' + arrName[i][1]; + objSB.Append(''); + intTdDisp++; + intTblDisp++; +} +fctTblFeed(); +objSB.Append('
 
'); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append('
  
  
'); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append('
'); \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index a746d7922f9..8181a45dc34 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -753,7 +753,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } - // This one is required fox boxes + // This one is required for boxes if (! defined('DISABLE_SCRIPTACULOUS')) { print ''."\n"; diff --git a/htdocs/theme/common/colorpicker.css b/htdocs/theme/common/colorpicker.css new file mode 100644 index 00000000000..441f02db521 --- /dev/null +++ b/htdocs/theme/common/colorpicker.css @@ -0,0 +1,90 @@ +TABLE, THEAD, TBODY, TFOOT, TH, TR, TD { + margin : 0px; + padding : 0px; + border-spacing : 0px; +} +FIELDSET { + padding : 0px; + margin : 0px; + color : black; +} +LEGEND { + font-family : Tahoma; + font-size : 10pt; + color : black; +} +A.color, A.color:active, A.color:visited { + position : relative; + display : block; + text-decoration : none; + width : 10px; + height : 10px; + line-height : 10px; + margin : 0px; + padding : 0px; + border : 1px inset white; +} +A.color:hover { + border : 1px outset white; +} +A.none, A.none:active, A.none:visited, A.none:hover { + position : relative; + display : block; + text-decoration : none; + width : 10px; + height : 10px; + line-height : 10px; + margin : 0px; + padding : 0px; + cursor : default; + border : 1px solid threedface; +} +.tblColor { + display : none; +} +.tdColor { + padding : 1px; +} +.tblContainer { + background-color : threedface; +} +.tblGlobal { + position : absolute; + top : 0px; + left : 0px; + display : none; + background-color : threedface; + border : 2px outset; +} +.tdContainer { + padding : 5px; +} +.tdDisplay { + width : 50%; + height : 20px; + line-height : 20px; + border : 1px outset white; +} +.tdDisplayTxt { + width : 50%; + height : 24px; + line-height : 12px; + font-family : Tahoma; + font-size : 8pt; + color : black; + text-align : center; +} +.btnColor { + width : 100%; + font-family : Tahoma; + font-size : 10pt; + padding : 0px; + margin : 0px; +} +.btnPalette { + width : 100%; + font-family : Tahoma; + font-size : 8pt; + padding : 0px; + margin : 0px; +} \ No newline at end of file diff --git a/htdocs/theme/common/colorpicker.png b/htdocs/theme/common/colorpicker.png new file mode 100644 index 00000000000..4ba6114aae9 Binary files /dev/null and b/htdocs/theme/common/colorpicker.png differ diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index f2c8d8dc0fc..620557aa043 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -297,6 +297,13 @@ if ($modulepart) //$original_file=$conf->barcode->dir_temp.'/'.$original_file; $original_file=''; } + + // Wrapping pour les icones de background des mailings + elseif ($modulepart == 'iconmailing') + { + $accessallowed=1; + $original_file=$conf->mailing->dir_temp.'/'.$original_file; + } // Wrapping generique (allows any module to open a file if file is in directory // called DOL_DATA_ROOT/modulepart). diff --git a/mysql/migration/2.6.0-2.7.0.sql b/mysql/migration/2.6.0-2.7.0.sql index b0d03a5650c..1893b65992b 100644 --- a/mysql/migration/2.6.0-2.7.0.sql +++ b/mysql/migration/2.6.0-2.7.0.sql @@ -142,3 +142,5 @@ ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, en alter table llx_commande_fournisseur add column ref_supplier varchar(30) after entity; +alter table llx_mailing add column bgcolor varchar(8) after body; +alter table llx_mailing add column bgimage varchar(255) after bgcolor; \ No newline at end of file diff --git a/mysql/tables/llx_mailing.sql b/mysql/tables/llx_mailing.sql index 68bad43cdec..3a478bfb913 100644 --- a/mysql/tables/llx_mailing.sql +++ b/mysql/tables/llx_mailing.sql @@ -33,6 +33,8 @@ create table llx_mailing entity integer DEFAULT 1 NOT NULL, -- multi company id sujet varchar(60), -- Sujet of mailing body text, + bgcolor varchar(8), -- Backgroud color of mailing + bgimage varchar(255), -- Backgroud image of mailing cible varchar(60), nbemail integer, email_from varchar(160), -- Email address of sender