diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 2d1450b8ae5..74a5c9b014e 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -244,7 +244,7 @@ if ($mode && !count($data)) {
if (count($arrayjs) && $mode == 'memberbycountry') {
$color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
if (is_readable($color_file)) {
- include_once $color_file;
+ include $color_file;
}
// Assume we've already included the proper headers so just call our script inline
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 6e0bc4ab1e1..6c2812d4d27 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -1327,7 +1327,7 @@ $cacheusers = array();
// Define theme_datacolor array
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/theme_vars.inc.php";
if (is_readable($color_file)) {
- include_once $color_file;
+ include $color_file;
}
if (!is_array($theme_datacolor)) {
$theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 74032b7fb01..8d436f0e0f6 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -742,7 +742,7 @@ $cacheusers = array();
// Define theme_datacolor array
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/theme_vars.inc.php";
if (is_readable($color_file)) {
- include_once $color_file;
+ include $color_file;
}
if (!is_array($theme_datacolor)) {
$theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index dd6886fa196..3ad2d31b353 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -765,7 +765,7 @@ $cacheusers = array();
// Define theme_datacolor array
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/theme_vars.inc.php";
if (is_readable($color_file)) {
- include_once $color_file;
+ include $color_file;
}
if (!is_array($theme_datacolor)) {
$theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 7b47915f0ea..a47ae365635 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -131,7 +131,7 @@ if ($resql) {
}
$db->free($resql);
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '
';
print '
';
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 66798c94157..ecbffa75028 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -131,7 +131,7 @@ if ($resql) {
}
$db->free($resql);
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '
';
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 6b1aecf1162..46a89209996 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -187,7 +187,7 @@ if ($resql) {
$colorseries = array();
-include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '
';
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 3672f7faa07..921c102fd43 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -113,7 +113,7 @@ class DolGraph
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
if (is_readable($color_file)) {
- include_once $color_file;
+ include $color_file;
if (isset($theme_bordercolor)) {
$this->bordercolor = $theme_bordercolor;
}
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 334817cccb7..0883d8c82be 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -270,6 +270,8 @@ function getCustomerInvoicePieChart($socid = 0)
$db->free($resql);
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+
$result = '';
$result .= '
';
$result .= '';
@@ -285,6 +287,19 @@ function getCustomerInvoicePieChart($socid = 0)
$objectstatic->paye = $status == Facture::STATUS_CLOSED ? -1 : 0;
$dataseries[] = [$objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0)];
+ if ($status == Facture::STATUS_DRAFT) {
+ $colorseries[$status] = '-'.$badgeStatus0;
+ }
+ if ($status == Facture::STATUS_VALIDATED) {
+ $colorseries[$status] = $badgeStatus1;
+ }
+ if ($status == Facture::STATUS_CLOSED) {
+ $colorseries[$status] = $badgeStatus9;
+ }
+ if ($status == Facture::STATUS_ABANDONED) {
+ $colorseries[$status] = $badgeStatus6;
+ }
+
if (!$conf->use_javascript_ajax) {
$result .= '
';
$result .= '| '.$objectstatic->getLibStatut(0).' | ';
@@ -296,6 +311,7 @@ function getCustomerInvoicePieChart($socid = 0)
if ($conf->use_javascript_ajax) {
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
+ $dolgraph->SetDataColor(array_values($colorseries));
$dolgraph->setShowLegend(2);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(['pie']);
@@ -373,6 +389,8 @@ function getPurchaseInvoicePieChart($socid = 0)
$db->free($resql);
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+
$result = '';
$result .= '
';
@@ -389,6 +407,19 @@ function getPurchaseInvoicePieChart($socid = 0)
$objectstatic->paye = $status == FactureFournisseur::STATUS_CLOSED ? -1 : 0;
$dataseries[] = [$objectstatic->getLibStatut(1), (isset($vals[$status]) ? (int) $vals[$status] : 0)];
+ if ($status == FactureFournisseur::STATUS_DRAFT) {
+ $colorseries[$status] = '-'.$badgeStatus0;
+ }
+ if ($status == FactureFournisseur::STATUS_VALIDATED) {
+ $colorseries[$status] = $badgeStatus1;
+ }
+ if ($status == FactureFournisseur::STATUS_CLOSED) {
+ $colorseries[$status] = $badgeStatus9;
+ }
+ if ($status == FactureFournisseur::STATUS_ABANDONED) {
+ $colorseries[$status] = $badgeStatus6;
+ }
+
if (!$conf->use_javascript_ajax) {
$result .= '';
$result .= '| '.$objectstatic->getLibStatut(0).' | ';
@@ -400,6 +431,7 @@ function getPurchaseInvoicePieChart($socid = 0)
if ($conf->use_javascript_ajax) {
$dolgraph = new DolGraph();
$dolgraph->SetData($dataseries);
+ $dolgraph->SetDataColor(array_values($colorseries));
$dolgraph->setShowLegend(2);
$dolgraph->setShowPercent(1);
$dolgraph->SetType(['pie']);
diff --git a/htdocs/don/index.php b/htdocs/don/index.php
index 98a4bdcde08..dfdeb76f2a9 100644
--- a/htdocs/don/index.php
+++ b/htdocs/don/index.php
@@ -120,7 +120,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is usel
$dataseries = array();
$colorseries = array();
-include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '';
diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php
index 863463e8d0e..52bde29e660 100644
--- a/htdocs/fichinter/index.php
+++ b/htdocs/fichinter/index.php
@@ -129,7 +129,7 @@ if ($resql) {
}
$db->free($resql);
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '
';
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index d46456b52dc..9164a223d04 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -115,7 +115,7 @@ if ($resql) {
}
$db->free($resql);
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '
';
diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php
index f86a52f4aae..cbb7b5da305 100644
--- a/htdocs/mrp/index.php
+++ b/htdocs/mrp/index.php
@@ -77,7 +77,7 @@ if ($conf->use_javascript_ajax) {
$colorseries = array();
$vals = array();
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
while ($i < $num) {
$obj = $db->fetch_object($resql);
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 78e9d85aa1a..f42a0553893 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -134,7 +134,7 @@ print_barre_liste($form->textwithpicto($title, $tooltiphelp), 0, $_SERVER["PHP_S
// Get list of ponderated percent and colors for each status
-include_once 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(); $colorseries = array();
$sql = "SELECT cls.rowid, cls.code, cls.percent, cls.label";
$sql .= " FROM ".MAIN_DB_PREFIX."c_lead_status as cls";
diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php
index 51e49370b6a..3b6ff756b3c 100644
--- a/htdocs/recruitment/recruitmentindex.php
+++ b/htdocs/recruitment/recruitmentindex.php
@@ -90,7 +90,7 @@ if ($conf->use_javascript_ajax) {
$colorseries = array();
$vals = array();
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
while ($i < $num) {
$obj = $db->fetch_object($resql);
@@ -168,7 +168,7 @@ if ($conf->use_javascript_ajax) {
$colorseries = array();
$vals = array();
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
while ($i < $num) {
$obj = $db->fetch_object($resql);
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index 0982abe467d..9a7b6fcbb95 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -120,7 +120,7 @@ if ($resql) {
}
$db->free($resql);
- include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+ include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
print '';
print '
';
diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php
index 589c10ddf62..12dd2836ea2 100644
--- a/htdocs/takepos/css/pos.css.php
+++ b/htdocs/takepos/css/pos.css.php
@@ -67,7 +67,7 @@ if (empty($dolibarr_nocache)) {
}
-require DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
+include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
if (defined('THEME_ONLY_CONSTANT')) {
return;
}