Standardize color of status

This commit is contained in:
Laurent Destailleur 2020-03-24 19:06:37 +01:00
parent d922eb270d
commit 62fefab5ac
10 changed files with 93 additions and 118 deletions

View File

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

View File

@ -315,7 +315,7 @@ if ($resql)
print $companystatic->getNomUrl(1, 'company', 16); print $companystatic->getNomUrl(1, 'company', 16);
print '</td>'; print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'day').'</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>'; print '</tr>';
$i++; $i++;
} }
@ -331,7 +331,7 @@ $max = 10;
*/ */
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.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
$sql .= ", s.canvas"; $sql .= ", s.canvas";
@ -353,7 +353,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; 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) if ($num)
{ {
@ -395,13 +395,15 @@ if (!empty($conf->commande->enabled))
print $companystatic->getNomUrl(1, 'company', 24); print $companystatic->getNomUrl(1, 'company', 24);
print '</td>'; 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>'; print '</tr>';
$i++; $i++;
} }
if ($i < $num) { 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)) 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.client";
$sql .= ", s.code_client"; $sql .= ", s.code_client";
$sql .= ", s.canvas"; $sql .= ", s.canvas";
@ -437,7 +439,7 @@ if (!empty($conf->commande->enabled))
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
print '<tr class="liste_titre">'; 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) if ($num)
{ {
@ -479,13 +481,15 @@ if (!empty($conf->commande->enabled))
print $companystatic->getNomUrl(1, 'company'); print $companystatic->getNomUrl(1, 'company');
print '</td>'; 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>'; print '</tr>';
$i++; $i++;
} }
if ($i < $num) { 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>"; print "</table></div><br>";

View File

@ -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) // If we ask an image into $url/$mymodule/img (instead of default path)
$regs = array();
if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) { if (preg_match('/^([^@]+)@([^@]+)$/i', $picto, $regs)) {
$picto = $regs[1]; $picto = $regs[1];
$path = $regs[2]; // $path is $mymodule $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 // For backward compatibility. Image's filename are still in French, so we use this array to convert
$statusImg = array( $statusImg = array(
'status0' => 'statut0' 'status0' => 'statut0',
,'status1' => 'statut1' 'status1' => 'statut1',
,'status2' => 'statut2' 'status2' => 'statut2',
,'status3' => 'statut3' 'status3' => 'statut3',
,'status4' => 'statut4' 'status4' => 'statut4',
,'status5' => 'statut5' 'status5' => 'statut5',
,'status6' => 'statut6' 'status6' => 'statut6',
,'status7' => 'statut7' 'status7' => 'statut7',
,'status8' => 'statut8' 'status8' => 'statut8',
,'status9' => 'statut9' 'status9' => 'statut9'
); );
if (!empty($statusImg[$statusType])) { if (!empty($statusImg[$statusType])) {

View File

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

View File

@ -76,7 +76,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
* Statistics * 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 .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -93,7 +93,6 @@ if ($resql)
$i = 0; $i = 0;
$total = 0; $total = 0;
$totalinprocess = 0;
$dataseries = array(); $dataseries = array();
$vals = array(); $vals = array();
// 0=Draft -> 1=Validated -> 2=Approved -> 3=Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially // 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 // -> 6=Canceled -> (reopen) 2=Approved
while ($i < $num) while ($i < $num)
{ {
$row = $db->fetch_row($resql); $obj = $db->fetch_object($resql);
if ($row) if ($obj)
{ {
if ($row[1] != 7 && $row[1] != 6 && $row[1] != 5) $vals[($obj->status == CommandeFournisseur::STATUS_CANCELED_AFTER_ORDER ? CommandeFournisseur::STATUS_CANCELED : $obj->status)] = $obj->nb;
{
$vals[$row[1]] = $row[0]; $total += $obj->nb;
$totalinprocess += $row[0];
}
$total += $row[0];
} }
$i++; $i++;
} }
$db->free($resql); $db->free($resql);
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">'; print '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("SuppliersOrders").'</th></tr>';
print "</tr>\n"; 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)); $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) if (!$conf->use_javascript_ajax)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -137,6 +145,7 @@ if ($resql)
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
$dolgraph = new DolGraph(); $dolgraph = new DolGraph();
$dolgraph->SetData($dataseries); $dolgraph->SetData($dataseries);
$dolgraph->SetDataColor(array_values($colorseries));
$dolgraph->setShowLegend(2); $dolgraph->setShowLegend(2);
$dolgraph->setShowPercent(1); $dolgraph->setShowPercent(1);
$dolgraph->SetType(array('pie')); $dolgraph->SetType(array('pie'));
@ -157,53 +166,6 @@ else
dol_print_error($db); 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 * Draft orders
*/ */
@ -322,7 +284,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
*/ */
$max = 5; $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 .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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><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>'.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>'; print '</tr>';
$i++; $i++;
} }

View File

@ -1150,7 +1150,7 @@ if ($action == 'create')
} else { } else {
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company('', 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); 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 '</td>';
} }
print '</tr>'."\n"; print '</tr>'."\n";
@ -1230,8 +1230,8 @@ if ($action == 'create')
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td colspan="2">'; 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); $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="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>'; 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 '</td>';
print '</tr>'; print '</tr>';
@ -1534,7 +1534,7 @@ if ($action == 'create')
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentConditionsShort'); print $langs->trans('PaymentConditionsShort');
print '</td>'; 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 '<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 '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
@ -1575,7 +1575,7 @@ if ($action == 'create')
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
print '</td>'; 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 '<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 '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';

View File

@ -2233,7 +2233,7 @@ class SupplierProposal extends CommonObject
if ($status == self::STATUS_DRAFT) $statusnew = 'status0'; if ($status == self::STATUS_DRAFT) $statusnew = 'status0';
elseif ($status == self::STATUS_VALIDATED) $statusnew = 'status1'; elseif ($status == self::STATUS_VALIDATED) $statusnew = 'status1';
elseif ($status == self::STATUS_SIGNED) $statusnew = 'status4'; 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'; elseif ($status == self::STATUS_CLOSE) $statusnew = 'status6';
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusnew, $mode); return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusnew, $mode);

View File

@ -292,7 +292,7 @@ if ($resql)
print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>'; print '<td>'.$companystatic->getNomUrl(1, 'customer').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datec), 'day').'</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>'; print '</tr>';
$i++; $i++;
} }

View File

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

View File

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