diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a35fc566ea1..50a1a8d0e06 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -229,7 +229,7 @@ class Categorie extends CommonObject $error=0; dol_syslog(get_class($this).'::create', LOG_DEBUG); - + // Clean parameters $this->label = trim($this->label); $this->description = trim($this->description); @@ -405,7 +405,7 @@ class Categorie extends CommonObject // End call triggers $this->db->commit(); - + return 1; } else @@ -571,12 +571,12 @@ class Categorie extends CommonObject if ($this->id == -1) return -2; // For backward compatibility - if ($type == 'societe') + if ($type == 'societe') { $type = 'customer'; dol_syslog(get_class($this) . "::add_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING); } - elseif ($type == 'fournisseur') + elseif ($type == 'fournisseur') { $type = 'supplier'; dol_syslog(get_class($this) . "::add_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING); @@ -1353,16 +1353,17 @@ class Categorie extends CommonObject * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param string $option Sur quoi pointe le lien ('', 'xyz') * @param int $maxlength Max length of text + * @param string $forced_color Hexadecimal code to force link color * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='',$maxlength=0) + function getNomUrl($withpicto=0,$option='',$maxlength=0, $forced_color='') { global $langs; $result=''; $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label); - $link = ''; + $link = ''; $linkend=''; $picto='category'; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index e57cd22d5fd..a01ea17e969 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -148,7 +148,13 @@ foreach($fulltree as $key => $val) $categstatic->ref=$val['label']; $categstatic->color=$val['color']; $categstatic->type=$type; - $li=$categstatic->getNomUrl(1,'',60); + // Check contrast with background and correct text color + $color = colorArrayToHex(colorStringToArray($categstatic->color,array()),''); + $textcolor='000'; + $tmpcolorweight=0; + foreach(colorStringToArray($color,array()) as $x) $tmpcolorweight+=$x; + if ($tmpcolorweight < 400) $textcolor='FFF'; + $li=$categstatic->getNomUrl(1,'',60, $textcolor); $desc=dol_htmlcleanlastbr($val['description']); $data[] = array( diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 14154d01f51..a756e1f941c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -653,7 +653,7 @@ div.arearef { margin-bottom: 10px; } div.heightref { - min-height: 80px; + min-height: 80px; } div.divphotoref { padding-right: 20px; @@ -1177,8 +1177,8 @@ div.vmenu, td.vmenu { width: 188px; } -.menu_contenu { - padding-top: 5px; +.menu_contenu { + padding-top: 5px; padding-bottom: 2px; } #menu_contenu_logo { padding-right: 4px; } @@ -1247,7 +1247,7 @@ div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks, div.blockvmen -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD; - */ + */ } div.blockvmenusearch @@ -2078,7 +2078,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-bottom-width: 1px; border-bottom-color: #BBB; border-bottom-style: solid; - + margin: 0px 0px 5px 0px; -moz-box-shadow: 2px 2px 4px #CCC; @@ -3661,10 +3661,10 @@ a span.select2-chosen box-shadow: none; -webkit-box-shadow: none !important; box-shadow: none !important; - color: #fff !important; + color: #fff; } span.noborderoncategories a, li.noborderoncategories a { - color: #fff !important; + color: #fff; line-height: normal; vertical-align: top; } @@ -3772,10 +3772,10 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i } select { /* display: inline-block; */ /* We can't set this. This disable ability to make */ - /* TODO added by jmobile, replace jmobile with pure css*/ + /* TODO added by jmobile, replace jmobile with pure css*/ overflow:hidden; white-space: nowrap; - text-overflow: ellipsis; + text-overflow: ellipsis; } .fiche .ui-controlgroup { margin: 0px; @@ -3953,11 +3953,11 @@ border-top-right-radius: 6px; @media only screen and (max-width: 767px) { .imgopensurveywizard { width:95%; height: auto; } - + #tooltip { position: absolute; width: px; - } + } } @@ -3997,14 +3997,14 @@ border-top-right-radius: 6px; top: 4px; max-width: 82px; } - + div.mainmenu { min-width: 20px; } .topmenuimage { background-size: 20px auto; } - + #tooltip { position: absolute; width: px;