Forráskód Böngészése

Standardize color of status

Laurent Destailleur 5 éve
szülő
commit
62fefab5ac

+ 6 - 4
htdocs/comm/propal/index.php

@@ -302,7 +302,8 @@ if ($resql)
 			print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
 
 			print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
-			print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 5).'</td>';
+
+			print '<td class="right">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
 			print '</tr>';
 			$i++;
 		}
@@ -314,7 +315,7 @@ else dol_print_error($db);
 
 
 /*
- * Opened proposals
+ * Open proposals
  */
 if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
 {
@@ -381,9 +382,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
 				$companystatic->canvas = $obj->canvas;
 				print '<td class="left">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>'."\n";
 
-				print '<td class="right">';
-				print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
+				print '<td class="right">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
+
 				print '<td class="right">'.price($obj->total_ttc).'</td>';
+
 				print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
 				print '</tr>'."\n";
 				$i++;

+ 13 - 9
htdocs/commande/index.php

@@ -315,7 +315,7 @@ if ($resql)
             print $companystatic->getNomUrl(1, 'company', 16);
             print '</td>';
 			print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</td>';
-			print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
+			print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
 			print '</tr>';
 			$i++;
 		}
@@ -331,7 +331,7 @@ $max = 10;
  */
 if (!empty($conf->commande->enabled))
 {
-	$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
     $sql .= ", s.client";
     $sql .= ", s.code_client";
     $sql .= ", s.canvas";
@@ -353,7 +353,7 @@ if (!empty($conf->commande->enabled))
         print '<div class="div-table-responsive-no-min">';
 		print '<table class="noborder centpercent">';
 		print '<tr class="liste_titre">';
-		print '<th colspan="3">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
+		print '<th colspan="4">'.$langs->trans("OrdersToProcess").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_VALIDATED.'"><span class="badge">'.$num.'</span></a></th></tr>';
 
 		if ($num)
 		{
@@ -395,13 +395,15 @@ if (!empty($conf->commande->enabled))
                 print $companystatic->getNomUrl(1, 'company', 24);
                 print '</td>';
 
-				print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
+                print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
+
+				print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
 
 				print '</tr>';
 				$i++;
 			}
 			if ($i < $num) {
-				print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td></tr>';
+				print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
 			}
 		}
 
@@ -415,7 +417,7 @@ if (!empty($conf->commande->enabled))
  */
 if (!empty($conf->commande->enabled))
 {
-	$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
     $sql .= ", s.client";
     $sql .= ", s.code_client";
     $sql .= ", s.canvas";
@@ -437,7 +439,7 @@ if (!empty($conf->commande->enabled))
         print '<div class="div-table-responsive-no-min">';
 		print '<table class="noborder centpercent">';
 		print '<tr class="liste_titre">';
-		print '<th colspan="3">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
+		print '<th colspan="4">'.$langs->trans("OnProcessOrders").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut='.Commande::STATUS_ACCEPTED.'"><span class="badge">'.$num.'</span></a></th></tr>';
 
 		if ($num)
 		{
@@ -479,13 +481,15 @@ if (!empty($conf->commande->enabled))
 				print $companystatic->getNomUrl(1, 'company');
 				print '</td>';
 
-				print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 5).'</td>';
+				print '<td class="right">'.dol_print_date($db->jdate($obj->date), 'day').'</td>'."\n";
+
+				print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).'</td>';
 
 				print '</tr>';
 				$i++;
 			}
 			if ($i < $num) {
-				print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td></tr>';
+				print '<tr><td><span class="opacitymedium">'.$langs->trans("More").'...</span></td><td></td><td></td><td></td></tr>';
 			}
 		}
 		print "</table></div><br>";

+ 11 - 10
htdocs/core/lib/functions.lib.php

@@ -3305,6 +3305,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
 		}
 
 		// If we ask an image into $url/$mymodule/img (instead of default path)
+		$regs = array();
 		if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
 			$picto = $regs[1];
 			$path = $regs[2]; // $path is $mymodule
@@ -8425,16 +8426,16 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
 
         // For backward compatibility. Image's filename are still in French, so we use this array to convert
         $statusImg = array(
-        	'status0' => 'statut0'
-        	,'status1' => 'statut1'
-        	,'status2' => 'statut2'
-        	,'status3' => 'statut3'
-        	,'status4' => 'statut4'
-        	,'status5' => 'statut5'
-        	,'status6' => 'statut6'
-        	,'status7' => 'statut7'
-        	,'status8' => 'statut8'
-        	,'status9' => 'statut9'
+        	'status0' => 'statut0',
+        	'status1' => 'statut1',
+        	'status2' => 'statut2',
+        	'status3' => 'statut3',
+        	'status4' => 'statut4',
+        	'status5' => 'statut5',
+        	'status6' => 'statut6',
+        	'status7' => 'statut7',
+        	'status8' => 'statut8',
+        	'status9' => 'statut9'
         );
 
         if (!empty($statusImg[$statusType])) {

+ 15 - 11
htdocs/fourn/class/fournisseur.commande.class.php

@@ -104,6 +104,8 @@ class CommandeFournisseur extends CommonOrder
     //  Note: billed or not is on another field "billed"
     public $statuts; // List of status
 
+    public $billed;
+
     public $socid;
     public $fourn_id;
     public $date;
@@ -354,6 +356,7 @@ class CommandeFournisseur extends CommonOrder
             $this->socid = $obj->fk_soc;
             $this->fourn_id = $obj->fk_soc;
             $this->statut				= $obj->fk_statut;
+            $this->status				= $obj->fk_statut;
             $this->billed				= $obj->billed;
             $this->user_author_id = $obj->fk_user_author;
             $this->user_valid_id = $obj->fk_user_valid;
@@ -694,7 +697,7 @@ class CommandeFournisseur extends CommonOrder
      *  Return label of a status
      *
      * 	@param  int		$status		Id statut
-     *  @param  int		$mode       0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
+	 *  @param  int		$mode       0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
      *  @param  int     $billed     1=Billed
      *  @return string				Label of status
      */
@@ -731,14 +734,14 @@ class CommandeFournisseur extends CommonOrder
 
         $statustrans = array(
             0 => 'status0',
-            1 => 'status1',
-            2 => 'status3',
-            3 => 'status3',
-            4 => 'status3',
-            5 => 'status4',
-            6 => 'status5',
-            7 => 'status5',
-            9 => 'status5',
+            1 => 'status1b',
+            2 => 'status1',
+            3 => 'status4',
+            4 => 'status4b',
+            5 => 'status6',
+            6 => 'status9',
+            7 => 'status9',
+            9 => 'status9',
         );
 
         $statusClass = 'status0';
@@ -747,9 +750,10 @@ class CommandeFournisseur extends CommonOrder
         }
 
         $billedtext = '';
-        if ($mode == 4 && $billed) {
-            $billedtext = ' - '.$langs->trans("Billed");
+        if ($billed) {
+        	$billedtext = ' - '.$langs->trans("Billed");
         }
+        if ($status == 5 && $billed) $statusClass = 'status6';
 
         $statusLong = $langs->trans($this->statuts[$status]).$billedtext;
         $statusShort = $langs->trans($this->statutshort[$status]);

+ 22 - 60
htdocs/fourn/commande/index.php

@@ -76,7 +76,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS))     // This is useles
  * Statistics
  */
 
-$sql = "SELECT count(cf.rowid), fk_statut";
+$sql = "SELECT count(cf.rowid) as nb, fk_statut as status";
 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
 $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
 if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -93,7 +93,6 @@ if ($resql)
 	$i = 0;
 
 	$total = 0;
-	$totalinprocess = 0;
 	$dataseries = array();
 	$vals = array();
 	//	0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
@@ -101,27 +100,36 @@ if ($resql)
 	//	-> 6=Canceled -> (reopen) 2=Approved
 	while ($i < $num)
 	{
-		$row = $db->fetch_row($resql);
-		if ($row)
+		$obj = $db->fetch_object($resql);
+		if ($obj)
 		{
-			if ($row[1] != 7 && $row[1] != 6 && $row[1] != 5)
-			{
-				$vals[$row[1]] = $row[0];
-				$totalinprocess += $row[0];
-			}
-			$total += $row[0];
+			$vals[($obj->status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER ? CommandeFournisseur::STATUS_CANCELED : $obj->status)] = $obj->nb;
+
+			$total += $obj->nb;
 		}
 		$i++;
 	}
 	$db->free($resql);
 
+	include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+
 	print '<div class="div-table-responsive-no-min">';
 	print '<table class="noborder nohover centpercent">';
 	print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';
 	print "</tr>\n";
-	foreach (array(0, 1, 2, 3, 4, 5, 6) as $status)
+	$listofstatus=array(0, 1, 2, 3, 4, 5, 6, 9);
+	foreach ($listofstatus as $status)
 	{
 		$dataseries[] = array($commandestatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
+		if ($status == CommandeFournisseur::STATUS_DRAFT) $colorseries[$status] = '-'.$badgeStatus0;
+		if ($status == CommandeFournisseur::STATUS_VALIDATED) $colorseries[$status] = '-'.$badgeStatus1;
+		if ($status == CommandeFournisseur::STATUS_ACCEPTED) $colorseries[$status] = $badgeStatus1;
+		if ($status == CommandeFournisseur::STATUS_REFUSED) $colorseries[$status] = $badgeStatus9;
+		if ($status == CommandeFournisseur::STATUS_ORDERSENT) $colorseries[$status] = $badgeStatus4;
+		if ($status == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) $colorseries[$status] = '-'.$badgeStatus4;
+		if ($status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) $colorseries[$status] = $badgeStatus6;
+		if ($status == CommandeFournisseur::STATUS_CANCELED || $status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER) $colorseries[$status] = $badgeStatus9;
+
 		if (!$conf->use_javascript_ajax)
 		{
 			print '<tr class="oddeven">';
@@ -137,6 +145,7 @@ if ($resql)
 		include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
 		$dolgraph = new DolGraph();
 		$dolgraph->SetData($dataseries);
+		$dolgraph->SetDataColor(array_values($colorseries));
 		$dolgraph->setShowLegend(2);
 		$dolgraph->setShowPercent(1);
 		$dolgraph->SetType(array('pie'));
@@ -157,53 +166,6 @@ else
 	dol_print_error($db);
 }
 
-/*
- * Legends / Status
- */
-
-$sql = "SELECT count(cf.rowid) as nb, cf.fk_statut";
-$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
-$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
-if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
-$sql .= " WHERE cf.fk_soc = s.rowid";
-$sql .= " AND cf.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing
-if ($user->socid) $sql .= ' AND cf.fk_soc = '.$user->socid;
-if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
-$sql .= " GROUP BY cf.fk_statut";
-
-$resql = $db->query($sql);
-if ($resql)
-{
-	$num = $db->num_rows($resql);
-	$i = 0;
-
-	print '<div class="div-table-responsive-no-min">';
-	print '<table class="liste centpercent">';
-
-	print '<tr class="liste_titre"><th>'.$langs->trans("Status").'</th>';
-	print '<th class="right">'.$langs->trans("Nb").'</th>';
-	print "</tr>\n";
-
-	while ($i < $num)
-	{
-		$obj = $db->fetch_object($resql);
-
-		print '<tr class="oddeven">';
-		print '<td>'.$commandestatic->LibStatut($obj->nb).'</td>';
-		print '<td class="right"><a href="list.php?statut='.$obj->fk_statut.'">'.$obj->nb.' '.$commandestatic->LibStatut($obj->fk_statut, 3).'</a></td>';
-
-		print "</tr>\n";
-		$i++;
-	}
-	print "</table></div><br>";
-	$db->free($resql);
-}
-else
-{
-	dol_print_error($db);
-}
-
-
 /*
  * Draft orders
  */
@@ -322,7 +284,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
 */
 $max = 5;
 
-$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.tms, s.nom as name, s.rowid as socid";
+$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.tms, c.billed, s.nom as name, s.rowid as socid";
 $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
 $sql .= ", ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -376,7 +338,7 @@ if ($resql)
 
 			print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.$obj->name.'</a></td>';
 			print '<td>'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
-			print '<td class="right">'.$commandestatic->LibStatut($obj->fk_statut, 5).'</td>';
+			print '<td class="right">'.$commandestatic->LibStatut($obj->status, 3, $obj->billed).'</td>';
 			print '</tr>';
 			$i++;
 		}

+ 5 - 5
htdocs/supplier_proposal/card.php

@@ -1150,7 +1150,7 @@ if ($action == 'create')
 	} else {
 		print '<td colspan="2">';
 		print $form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
-		print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddThirdParty").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span></a>';
+		print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
 		print '</td>';
 	}
 	print '</tr>'."\n";
@@ -1230,8 +1230,8 @@ if ($action == 'create')
 		print '<tr>';
 		print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
 
-		$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1);
-		print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
+		$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
+		print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
 
 		print '</td>';
 		print '</tr>';
@@ -1534,7 +1534,7 @@ if ($action == 'create')
 	print '<table class="nobordernopadding" width="100%"><tr><td>';
 	print $langs->trans('PaymentConditionsShort');
 	print '</td>';
-	if ($action != 'editconditions' && $object->statut == SupplierProposal::STATUS_DRAFT)
+	if ($action != 'editconditions' && $object->statut != SupplierProposal::STATUS_NOTSIGNED)
 		print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
 	print '</tr></table>';
 	print '</td><td colspan="3">';
@@ -1575,7 +1575,7 @@ if ($action == 'create')
 	print '<table class="nobordernopadding" width="100%"><tr><td>';
 	print $langs->trans('PaymentMode');
 	print '</td>';
-	if ($action != 'editmode' && $object->statut == $object::STATUS_VALIDATED)
+	if ($action != 'editmode' && $object->statut != SupplierProposal::STATUS_NOTSIGNED)
 		print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
 	print '</tr></table>';
 	print '</td><td colspan="3">';

+ 2 - 2
htdocs/supplier_proposal/class/supplier_proposal.class.php

@@ -13,7 +13,7 @@
  * Copyright (C) 2014      Marcos García            <marcosgdf@gmail.com>
  * Copyright (C) 2016      Ferran Marcet            <fmarcet@2byte.es>
  * Copyright (C) 2018      Nicolas ZABOURI			<info@inovea-conseil.com>
- * Copyright (C) 2019       Frédéric France         <frederic.france@netlogic.fr>
+ * Copyright (C) 2019      Frédéric France          <frederic.france@netlogic.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -2233,7 +2233,7 @@ class SupplierProposal extends CommonObject
     	if ($status == self::STATUS_DRAFT) $statusnew = 'status0';
     	elseif ($status == self::STATUS_VALIDATED) $statusnew = 'status1';
     	elseif ($status == self::STATUS_SIGNED) $statusnew = 'status4';
-    	elseif ($status == self::STATUS_NOTSIGNED) $statusnew = 'status5';
+    	elseif ($status == self::STATUS_NOTSIGNED) $statusnew = 'status9';
     	elseif ($status == self::STATUS_CLOSE) $statusnew = 'status6';
 
     	return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusnew, $mode);

+ 1 - 1
htdocs/supplier_proposal/index.php

@@ -292,7 +292,7 @@ if ($resql)
 			print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
 
 			print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</td>';
-			print '<td class="right">'.$supplier_proposalstatic->LibStatut($obj->fk_statut, 5).'</td>';
+			print '<td class="right">'.$supplier_proposalstatic->LibStatut($obj->fk_statut, 3).'</td>';
 			print '</tr>';
 			$i++;
 		}

+ 13 - 13
htdocs/theme/eldy/badges.inc.php

@@ -1,9 +1,6 @@
 <?php
 if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
-/* <style type="text/css" > */
-/*
- Badge style is based on boostrap framework
- */
+/* Badge style is based on boostrap framework */
 
 .badge {
     display: inline-block;
@@ -174,9 +171,7 @@ a.badge-dark:focus, a.badge-dark:hover {
 }
 
 
-/*
- * STATUS BADGES
- */
+/* STATUS BADGES */
 <?php
 for ($i = 0; $i <= 9; $i++) {
 	/* Default Status */
@@ -186,6 +181,10 @@ for ($i = 0; $i <= 9; $i++) {
 	_createStatusBadgeCss($i, 'colorblind_deuteranopes_', "COLORBLIND STATUS".$i, 'body[class*="colorblind-"] ');
 }
 
+_createStatusBadgeCss('1b', '', "STATUS1b");
+_createStatusBadgeCss('4b', '', "STATUS4b");
+
+
 /**
  * Create status badge
  *
@@ -202,26 +201,27 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
 
 	if (!empty(${$statusVarNamePrefix.'badgeStatus'.$statusName})) {
 		print "\n/* ".strtoupper($commentLabel)." */\n";
+
 		$thisBadgeBackgroundColor = $thisBadgeBorderColor = ${$statusVarNamePrefix.'badgeStatus'.$statusName};
 
-		$TBadgeBorderOnly = array(0, 3, 5, 7);
+		$TBadgeBorderOnly = array('0', '1b', '3', '4b', '5', '7');
 		$thisBadgeTextColor = colorIsLight(${$statusVarNamePrefix.'badgeStatus'.$statusName}) ? '#212529' : '#ffffff';
 
 		if (!empty(${$statusVarNamePrefix.'badgeStatus_textColor'.$statusName})) {
 			$thisBadgeTextColor = ${$statusVarNamePrefix.'badgeStatus_textColor'.$statusName};
 		}
 
-		if (in_array($statusName, $TBadgeBorderOnly)) {
+		if (in_array((string) $statusName, $TBadgeBorderOnly)) {
 			$thisBadgeTextColor = '#212529';
 			$thisBadgeBackgroundColor = "#fff";
 		}
 
-		if (in_array($statusName, array(0, 5, 9))) $thisBadgeTextColor = '#999999';
-		if (in_array($statusName, array(6))) $thisBadgeTextColor = '#777777';
+		if (in_array((string) $statusName, array('0', '5', '9'))) $thisBadgeTextColor = '#999999';
+		if (in_array((string) $statusName, array('6'))) $thisBadgeTextColor = '#777777';
 
 		print $cssPrefix.".badge-status".$statusName." {\n";
 		print "        color: ".$thisBadgeTextColor." !important;\n";
-		if (in_array($statusName, $TBadgeBorderOnly)) {
+		if (in_array((string) $statusName, $TBadgeBorderOnly)) {
 			print "        border-color: ".$thisBadgeBorderColor.";\n";
 		}
 		print "        background-color: ".$thisBadgeBackgroundColor.";\n";
@@ -239,7 +239,7 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL
 		print $cssPrefix.".badge-status".$statusName.":focus, ".$cssPrefix.".badge-status".$statusName.":hover {\n";
 		print "    color: ".$thisBadgeTextColor." !important;\n";
 		//print "    background-color: " . colorDarker($thisBadgeBackgroundColor, 10) . ";\n";
-		if (in_array($statusName, $TBadgeBorderOnly)) {
+		if (in_array((string) $statusName, $TBadgeBorderOnly)) {
 			print "        border-color: ".colorDarker($thisBadgeBorderColor, 10).";\n";
 		}
 		print "}\n";

+ 5 - 3
htdocs/theme/eldy/theme_vars.inc.php

@@ -104,11 +104,13 @@ $colorblind_deuteranopes_badgeWarning   = '#e4e411';
 *  So this badges status uses default value according to theme eldy status img
 *  TODO: use color definition vars above for define badges color status X -> exemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive ....
 */
-$badgeStatus0 = '#cbd3d3';
-$badgeStatus1 = '#bc9526';
-$badgeStatus2 = '#e6f0f0';
+$badgeStatus0 = '#cbd3d3';	// draft
+$badgeStatus1 = '#bc9526';	// validated
+$badgeStatus1b = '#bc9526';	// validated
+$badgeStatus2 = '#9c9c26';	// approved
 $badgeStatus3 = '#bca52b';
 $badgeStatus4 = '#55a580'; // Color ok
+$badgeStatus4b = '#55a580'; // Color ok
 $badgeStatus5 = '#cad2d2';
 $badgeStatus6 = '#cad2d2';
 $badgeStatus7 = '#baa32b';