Fix color of reports. Fix include_once into include.

This commit is contained in:
Laurent Destailleur 2021-04-06 22:18:32 +02:00
parent 90b122035f
commit 12e847ade1
17 changed files with 49 additions and 17 deletions

View File

@ -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

View File

@ -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));

View File

@ -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));

View File

@ -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));

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';

View File

@ -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;
}

View File

@ -270,6 +270,8 @@ function getCustomerInvoicePieChart($socid = 0)
$db->free($resql);
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
$result = '<div class="div-table-responsive-no-min">';
$result .= '<table class="noborder nohover centpercent">';
$result .= '<tr class="liste_titre">';
@ -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 .= '<tr class="oddeven">';
$result .= '<td>'.$objectstatic->getLibStatut(0).'</td>';
@ -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 = '<div class="div-table-responsive-no-min">';
$result .= '<table class="noborder nohover centpercent">';
@ -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 .= '<tr class="oddeven">';
$result .= '<td>'.$objectstatic->getLibStatut(0).'</td>';
@ -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']);

View File

@ -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 '<table class="noborder nohover centpercent">';
print '<tr class="liste_titre">';

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder nohover centpercent">';

View File

@ -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);

View File

@ -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";

View File

@ -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);

View File

@ -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 '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';

View File

@ -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;
}