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 ''.$langs->trans("HighlightLinesOnMouseHover").''; $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); print ''; - print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print ''; print ''; + + //if ($conf->theme == 'eldy') + //{ + // TopMenuBackgroundColor + $var=!$var; + print ''; + print ''.$langs->trans("TopMenuBackgroundColor").''; + print ''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); + if ($color) print ''; + else print $langs->trans("Default"); + } + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''; + + // BackgroundTableTitleColor + $var=!$var; + print ''; + print ''.$langs->trans("BackgroundTableTitleColor").''; + print ''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1,array()),''),'THEME_ELDY_BACKTITLE1','formcolor',1).' '; + } + else + { + print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default")); + } + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''; + //} + + print ''; } print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index cdc8c639a20..0a1f7af31a0 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1644,3 +1644,9 @@ ConfFileMuseContainCustom=Installing an external module from application save th HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes +BackgroundColor=Background color +TopMenuBackgroundColor=Background color for Top menu +LeftMenuBackgroundColor=Background color for Left menu +BackgroundTableTitleColor=Background color for table title line +BackgroundTableLineOddColor=Background color for odd table lines +BackgroundTableLineEvenColor=Background color for even table lines diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index af3f4adbf5f..df1a9741d56 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -114,12 +114,15 @@ $usegradient=1; // Eldy colors if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) { - $conf->global->THEME_ELDY_TOPMENU_BACK1='140,150,180'; // topmenu (140,160,185) - $conf->global->THEME_ELDY_TOPMENU_BACK2='236,236,236'; + // Case of option always editable + if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1='140,150,180'; // topmenu (140,160,185) + if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1='140,150,180'; // title of arrays TO MATCH ELDY (140,160,185) + //if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1='230,230,230'; // title of arrays TO MATCH BOOTSTRAP + + // Cas of option editable if option THEME_ELDY_ENABLE_PERSONALIZED is on + $conf->global->THEME_ELDY_TOPMENU_BACK2='236,236,236'; $conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu $conf->global->THEME_ELDY_VERMENU_BACK2='255,255,255'; - $conf->global->THEME_ELDY_BACKTITLE1='140,150,180'; // title of arrays TO MATCH ELDY (140,160,185) - //$conf->global->THEME_ELDY_BACKTITLE1='230,230,230'; // title of arrays TO MATCH BOOTSTRAP $conf->global->THEME_ELDY_BACKTITLE2='230,230,230'; $conf->global->THEME_ELDY_BACKTABCARD1='255,255,255'; $conf->global->THEME_ELDY_BACKTABCARD2='210,210,210'; // card @@ -136,7 +139,8 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED)) $conf->global->THEME_ELDY_FONT_SIZE2='11'; } -$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +// Cas of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on +$colorbackhmenu1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); $colorbackhmenu2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK2)?$colorbackhmenu2:$conf->global->THEME_ELDY_TOPMENU_BACK2) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK2)?$colorbackhmenu2:$user->conf->THEME_ELDY_TOPMENU_BACK2); $colorbackvmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$user->conf->THEME_ELDY_VERMENU_BACK1); $colorbackvmenu2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK2)?$colorbackvmenu2:$conf->global->THEME_ELDY_VERMENU_BACK2) :(empty($user->conf->THEME_ELDY_VERMENU_BACK2)?$colorbackvmenu2:$user->conf->THEME_ELDY_VERMENU_BACK2); @@ -155,6 +159,7 @@ $colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( $colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT); $fontsize =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE1) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE1) :(empty($user->conf->THEME_ELDY_FONT_SIZE1)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE1); $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_FONT_SIZE2) ?$fontsize:$conf->global->THEME_ELDY_FONT_SIZE2) :(empty($user->conf->THEME_ELDY_FONT_SIZE2)?$fontsize:$user->conf->THEME_ELDY_FONT_SIZE2); + // Hover can be disabled with THEME_ELDY_USE_HOVER=0 if ((! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && (isset($user->conf->THEME_ELDY_USE_HOVER) && $user->conf->THEME_ELDY_USE_HOVER == '0')) || (empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) && (isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'))) @@ -605,8 +610,9 @@ div.ficheaddleft { $minwidthtmenu=66; /* minimul widht for one top menu entry */ $heightmenu=46; /* height of top menu, part with image */ $heightmenu2=48; /* height of top menu, part with login */ +$disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $maxwidthloginblock = 180; } +if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE) || $dol_optimize_smallscreen) { $disableimages = 1; $maxwidthloginblock = 180; } ?> div#id-top { @@ -622,8 +628,8 @@ div#id-top { background-image: -ms-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(0,0,0,.3)) ); - global->THEME_ELDY_DISABLE_IMAGE)) { ?> - height: 26px; + + height: 28px; height: px; @@ -734,19 +740,19 @@ div.tmenuleft width: 5px; background: url() 0 -6px no-repeat; - global->THEME_ELDY_DISABLE_IMAGE)) { ?> - height: 24px; + + height: 26px; height: px; } div.tmenucenter { - padding-top: global->THEME_ELDY_DISABLE_IMAGE)?'2':'4'; ?>px; + padding-top: px; padding-left: 0px; padding-right: 0px; - global->THEME_ELDY_DISABLE_IMAGE)) { ?> - height: 22px; + + height: 24px; height: px; @@ -892,7 +898,7 @@ foreach($mainmenuusedarray as $val) .tmenuimage { padding:0 0 0 0 !important; margin:0 0px 0 0 !important; - global->THEME_ELDY_DISABLE_IMAGE)) { ?> + display: none; } @@ -1017,7 +1023,7 @@ div.login_block_user { } div.login_block_other { display: inline-block; - clear: both; + clear: both; } div.login_block_other { padding-top: 3px; text-align: right; } .login_block_elem { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 5bf47eb19e0..4cdb28e95b6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1412,7 +1412,7 @@ else { print ''.$langs->trans("ColorUser").''; print ''; - if ($object->color) print ''; + print $formother->showColor($object->color, ''); print ''; print "\n"; }