diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index c4cebfcf68a..c0218be92e2 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -73,7 +73,23 @@ class box_funnel_of_prospection extends ModeleBoxes public function loadBox($max = 5) { global $conf; - include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + + // default values + $badgeStatus0 = '#cbd3d3'; // draft + $badgeStatus1 = '#bc9526'; // validated + $badgeStatus1b = '#bc9526'; // validated + $badgeStatus2 = '#9c9c26'; // approved + $badgeStatus3 = '#bca52b'; + $badgeStatus4 = '#25a580'; // Color ok + $badgeStatus4b = '#25a580'; // Color ok + $badgeStatus5 = '#cad2d2'; + $badgeStatus6 = '#cad2d2'; + $badgeStatus7 = '#baa32b'; + $badgeStatus8 = '#993013'; + $badgeStatus9 = '#e7f0f0'; + if (file_exists(DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php')) { + include DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; + } $listofoppstatus = array(); $listofopplabel = array(); $listofoppcode = array(); @@ -113,7 +129,9 @@ class box_funnel_of_prospection extends ModeleBoxes } $i++; } - } else dol_print_error($this->db); + } else { + dol_print_error($this->db); + } global $conf, $user, $langs; @@ -134,7 +152,7 @@ class box_funnel_of_prospection extends ModeleBoxes $sql .= " GROUP BY p.fk_opp_status, cls.code"; $resql = $this->db->query($sql); - $form = new Form($ths->db); + $form = new Form($this->db); if ($resql) { $num = $this->db->num_rows($resql); $i = 0; @@ -153,7 +171,9 @@ class box_funnel_of_prospection extends ModeleBoxes $valsnb[$obj->opp_status] = $obj->nb; $valsamount[$obj->opp_status] = $obj->opp_amount; $totalnb += $obj->nb; - if ($obj->opp_status) $totaloppnb += $obj->nb; + if ($obj->opp_status) { + $totaloppnb += $obj->nb; + } if (!in_array($obj->code, array('WON', 'LOST'))) { $totalamount += $obj->opp_amount; $ponderated_opp_amount += $obj->ponderated_opp_amount; @@ -171,8 +191,12 @@ class box_funnel_of_prospection extends ModeleBoxes $labelStatus = ''; if ($status != 7) { $code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code'); - if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); - if (empty($labelStatus)) $labelStatus = $listofopplabel[$status]; + if ($code) { + $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code); + } + if (empty($labelStatus)) { + $labelStatus = $listofopplabel[$status]; + } $dataseries[] = array($labelStatus,(isset($valsamount[$status]) ? (float) $valsamount[$status] : 0)); if (!$conf->use_javascript_ajax) {