diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 62ce7345217..ce5e49bf33a 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -462,6 +462,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index 28f221131e1..c1baf0bc979 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -68,7 +68,15 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
- dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
+ $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
+ if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
+ else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', join(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity);
+
+ $val=(join(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
+ if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
+ else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
+
+ dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER"],'chaine',0,'',$conf->entity);
@@ -148,7 +156,7 @@ if ($action == 'edit') // Edit
print ' '."\n";
- // Themes
+ // Themes and themes options
show_theme(null,1);
print ' ';
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 4f286d26eb7..7f0e27ac27d 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -582,6 +582,24 @@ class FormOther
}
}
+
+ /**
+ * Output a HTML thumb of color or a text if not defined.
+ *
+ * @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255')
+ * @param string $textifnotdefined Text to show if color not defined
+ * @return string HTML code for color thumb
+ * @see selectColor
+ */
+ static function showColor($color, $textifnotdefined='')
+ {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+
+ $color = colorArrayToHex(colorStringToArray($color,array()),'');
+ if ($color) print '';
+ else print $textifnotdefined;
+ }
+
/**
* Output a HTML code to select a color
*
@@ -591,7 +609,7 @@ class FormOther
* @param int $showcolorbox 1=Show color code and color box, 0=Show only color code
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
* @return void
- * @deprecated
+ * @deprecated Use instead selectColor
* @see selectColor()
*/
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
@@ -609,8 +627,9 @@ class FormOther
* @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813')
* @param string $morecss Add css style into input field
* @return string
+ * @see showColor
*/
- function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
+ static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='')
{
// Deprecation warning
if ($form_name) {
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 09801972ce5..e7566107613 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -651,7 +651,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$masktri='00000';
$maskcounter='00000';
}
-
+
$maskraz=-1;
$maskoffset=0;
$resetEveryMonth=false;
@@ -670,7 +670,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
if (dol_strlen($maskrefclient_maskcounter) > 0 && dol_strlen($maskrefclient_maskcounter) < 3) return 'ErrorCounterMustHaveMoreThan3Digits';
}
else $maskrefclient='';
-
+
// fail if there is neither a global nor a third party counter
if (! $hasglobalcounter && ($maskrefclient_maskcounter == ''))
{
@@ -1915,29 +1915,30 @@ function fetchObjectByElement($element_id,$element_type) {
/**
- * Convert an array with RGB value into hex RGB value
+ * Convert an array with RGB value into hex RGB value.
+ * This is the opposite function of colorStringToArray
*
* @param array $arraycolor Array
* @param string $colorifnotfound Color code to return if entry not defined or not a RGB format
- * @return string RGB hex value (without # before). For example: FF00FF
- * @see Make the opposite of colorStringToArray
+ * @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02'
+ * @see colorStringToArray
*/
function colorArrayToHex($arraycolor,$colorifnotfound='888888')
{
if (! is_array($arraycolor)) return $colorifnotfound;
if (empty($arraycolor)) return $colorifnotfound;
- return dechex($arraycolor[0]).dechex($arraycolor[1]).dechex($arraycolor[2]);
+ return sprintf("%02s",dechex($arraycolor[0])).sprintf("%02s",dechex($arraycolor[1])).sprintf("%02s",dechex($arraycolor[2]));
}
-
/**
* Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,255).
+ * This is the opposite function of colorArrayToHex.
* If entry is already an array, return it.
*
* @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255')
* @param array $colorifnotfound Color code array to return if entry not defined
* @return string RGB hex value (without # before). For example: FF00FF
- * @see Make the opposite of colorArrayToHex
+ * @see colorArrayToHex
*/
function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
{
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index e3895bacf54..3dceff31009 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -254,7 +254,10 @@ function entity_prepare_head($object, $aEntities)
*/
function show_theme($fuser,$edit=0,$foruserprofile=false)
{
- global $conf,$langs,$bc;
+ global $conf,$langs,$db;
+ global $bc;
+
+ $formother = new FormOther($db);
//$dirthemes=array(empty($conf->global->MAIN_FORCETHEMEDIR)?'/theme':$conf->global->MAIN_FORCETHEMEDIR.'/theme');
$dirthemes=array('/theme');
@@ -380,9 +383,48 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '