From 2764fb240f77c4506bc28b68ce5751e1cb6399c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sun, 10 Jan 2016 00:11:49 +0100 Subject: [PATCH] Fix text color for category tags Fix banner for category translation tab --- htdocs/categories/traduction.php | 17 +++++++++++++++-- htdocs/core/class/html.formother.class.php | 6 +++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 02033b27bff..f3969793ef0 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -158,10 +158,23 @@ print '<table class="border" width="100%">'; // Reference print '<tr>'; -print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'; -print $object->label; +print '<td width="20%" class="notopnoleft">'; +$ways = $object->print_all_ways(); +print $langs->trans("Ref").'</td><td>'; +print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type.'">'.$langs->trans("Root").'</a> >> '; +foreach ($ways as $way) +{ + print $way."<br>\n"; +} print '</td>'; print '</tr>'; + +// Description +print '<tr><td width="20%" class="notopnoleft">'; +print $langs->trans("Description").'</td><td>'; +print dol_htmlentitiesbr($object->description); +print '</td></tr>'; + print '</table>'; if ($action == 'edit') diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d6f1521e49d..1727db5f227 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -598,7 +598,11 @@ class FormOther include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $color = colorArrayToHex(colorStringToArray($color,array()),''); - if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">'; + $textcolor='000'; + $tmpcolorweight=0; + foreach(colorStringToArray($color,array()) as $x) $tmpcolorweight+=$x; + if ($tmpcolorweight < 400) $textcolor='FFF'; + if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; color: #'.$textcolor.'; background-color: #'.$color.'" value="'.$color.'">'; else print $textifnotdefined; } -- GitLab