fix warnings
This commit is contained in:
parent
f56b46bd3e
commit
a256bfeb46
@ -73,7 +73,23 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
public function loadBox($max = 5)
|
public function loadBox($max = 5)
|
||||||
{
|
{
|
||||||
global $conf;
|
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();
|
$listofoppstatus = array();
|
||||||
$listofopplabel = array();
|
$listofopplabel = array();
|
||||||
$listofoppcode = array();
|
$listofoppcode = array();
|
||||||
@ -113,7 +129,9 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else dol_print_error($this->db);
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
@ -134,7 +152,7 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
$sql .= " GROUP BY p.fk_opp_status, cls.code";
|
$sql .= " GROUP BY p.fk_opp_status, cls.code";
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
$form = new Form($ths->db);
|
$form = new Form($this->db);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $this->db->num_rows($resql);
|
$num = $this->db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -153,7 +171,9 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
$valsnb[$obj->opp_status] = $obj->nb;
|
$valsnb[$obj->opp_status] = $obj->nb;
|
||||||
$valsamount[$obj->opp_status] = $obj->opp_amount;
|
$valsamount[$obj->opp_status] = $obj->opp_amount;
|
||||||
$totalnb += $obj->nb;
|
$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'))) {
|
if (!in_array($obj->code, array('WON', 'LOST'))) {
|
||||||
$totalamount += $obj->opp_amount;
|
$totalamount += $obj->opp_amount;
|
||||||
$ponderated_opp_amount += $obj->ponderated_opp_amount;
|
$ponderated_opp_amount += $obj->ponderated_opp_amount;
|
||||||
@ -171,8 +191,12 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||||||
$labelStatus = '';
|
$labelStatus = '';
|
||||||
if ($status != 7) {
|
if ($status != 7) {
|
||||||
$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
|
$code = dol_getIdFromCode($this->db, $status, 'c_lead_status', 'rowid', 'code');
|
||||||
if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
|
if ($code) {
|
||||||
if (empty($labelStatus)) $labelStatus = $listofopplabel[$status];
|
$labelStatus = $langs->transnoentitiesnoconv("OppStatus" . $code);
|
||||||
|
}
|
||||||
|
if (empty($labelStatus)) {
|
||||||
|
$labelStatus = $listofopplabel[$status];
|
||||||
|
}
|
||||||
|
|
||||||
$dataseries[] = array($labelStatus,(isset($valsamount[$status]) ? (float) $valsamount[$status] : 0));
|
$dataseries[] = array($labelStatus,(isset($valsamount[$status]) ? (float) $valsamount[$status] : 0));
|
||||||
if (!$conf->use_javascript_ajax) {
|
if (!$conf->use_javascript_ajax) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user