Add option MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH

This commit is contained in:
Laurent Destailleur 2021-01-09 02:28:50 +01:00
parent 69c614ec2a
commit b3461161ec
5 changed files with 10 additions and 5 deletions

View File

@ -120,7 +120,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
$startyear = $endyear - 1;
$startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 1 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$mode = 'customer';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';

View File

@ -117,7 +117,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
$startyear = $endyear - 1;
$startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 1 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$mode = 'supplier';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';

View File

@ -120,7 +120,8 @@ class box_graph_orders_permonth extends ModeleBoxes
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
$startyear = $endyear - 1;
$startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 1 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$mode = 'customer';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';

View File

@ -119,7 +119,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
$startyear = $endyear - 1;
$startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 1 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$mode = 'supplier';
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';

View File

@ -120,7 +120,8 @@ class box_graph_propales_permonth extends ModeleBoxes
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) $endyear = $nowarray['year'];
$startyear = $endyear - 1;
$startyear = $endyear - (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 1 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
$HEIGHT = '192';