diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index f1778d8b76e..b6cb6c33ac6 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -613,7 +613,7 @@ if ($_GET["action"] == 'create') print ''; print ''; print ''; print ''; print '
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing'); + $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; @@ -986,7 +986,7 @@ else //} print '
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing'); + $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing',0); print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 276b94c328f..a34729304a0 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -258,6 +258,7 @@ class FormAdmin * \param selected Color pre-selected * \param htmlname Name of html select zone */ +/* function select_colors($selected='', $htmlname, $arrayofcolors='', $showcolorbox=1) { global $langs,$conf; @@ -287,6 +288,7 @@ class FormAdmin print '
'; } } +*/ } ?> diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 4f1037e4dae..bfa1e954c5e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -346,33 +346,76 @@ class FormOther /** - * Affiche zone de selection de couleur - * @param set_color Couleur de pre-selection - * @param prefix Prefix pour nom champ - * @param form_name Nom du formulaire de provenance. + * Output a HTML code to select a color + * @param set_color Pre-selected color + * @param prefix Name of HTML field + * @param form_name Name of form + * @param showcolorbox 1=Show color code and color box, 0=Show only color code + * @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') */ - function select_color($set_color='', $prefix='f_color', $form_name='objForm') + function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') { - print "\n".'
'; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; - print ''."\n"; - print '
'; + if (! is_array($arrayofcolors) || sizeof($arrayofcolors) < 1) + { + // No list of colors forced, we can suggest any color + print "\n".''; + + if ($showcolorbox) + { + print ''; + } + + print '
'; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + } + else + { + // List of colors is forced + if ($showcolorbox) print '
'; + + print ''; + + if ($showcolorbox) + { + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + } + } } /** diff --git a/htdocs/lib/lib_colorpicker.js b/htdocs/lib/lib_colorpicker.js index 3798c7ad95e..1074068f1cf 100644 --- a/htdocs/lib/lib_colorpicker.js +++ b/htdocs/lib/lib_colorpicker.js @@ -1,3 +1,7 @@ +// \file htdocs/lib/lib_colorpicker.js +// \brief File with javascript function to output a color picker +// \version $Revision$ + StringBuilder = function() { this.arrStr = new Array(); @@ -122,7 +126,7 @@ fctShow = function(objForm) } else { fctReset(); } - fctSelect('Name', 'Named'); + fctSelect('Safe', 'Safety'); } if (objCurrent) { var w = h = t = l = 0; @@ -173,10 +177,10 @@ fctLoad = function() } objSB.Append('
'); -objSB.Append(''); -objSB.Append(''); -objSB.Append(''); -objSB.Append(''); +//objSB.Append(''); +objSB.Append(''); +objSB.Append(''); +objSB.Append(''); objSB.Append('
'); objSB.Append(''); @@ -254,7 +258,7 @@ 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