dolibarr 25.0.0-alpha
dashboard.lib.php File Reference

Functions shared by the home pages of modules (index.php with statistics and widgets) More...

Go to the source code of this file.

Functions

 getThemeBadgeStatusColors ()
 Return the colors of status badges defined by the current theme (theme_vars.inc.php)
 
 getStatusPieChart ($title, $series, $options=array())
 Return the HTML table with a pie chart of values by status, as shown on the home page of a module.
 

Detailed Description

Functions shared by the home pages of modules (index.php with statistics and widgets)

Definition in file dashboard.lib.php.

Function Documentation

◆ getStatusPieChart()

getStatusPieChart ( $title,
$series,
$options = array() )

Return the HTML table with a pie chart of values by status, as shown on the home page of a module.

When javascript is disabled, the chart is replaced by one row per slice.

Parameters
string$titleTitle of the table (already translated)
array<int|string,array{label:string,nb:int|float,color?:string,url?:string,labelnojs?:string}>$series Ordered slices. 'label' is the legend label, 'nb' the value, 'color' a color like '#rrggbb' or '-#rrggbb' for a lighter shade, 'url' the link of the value in no-js mode, 'labelnojs' the label to show in no-js mode instead of 'label' (can contain HTML).
array{graphid?:string,height?:int|string,width?:int|string,showpercent?:int,total?:int|float|string|false,totallabel?:string}$options Options: 'graphid' (default 'idgraphstatus'), 'height' (default 200), 'width', 'showpercent' (default 1), 'total' (default: sum of 'nb', false to hide the total row), 'totallabel' (default: "Total").
Returns
string HTML content
See also
getThemeBadgeStatusColors()

Definition at line 66 of file dashboard.lib.php.

References $conf, and dol_escape_htmltag().

Referenced by getCustomerOrderPieChart().

◆ getThemeBadgeStatusColors()

getThemeBadgeStatusColors ( )

Return the colors of status badges defined by the current theme (theme_vars.inc.php)

Returns
array<int|string,string> Colors indexed by badge status key: 0 (draft), 1 (validated), '1b', 2, 3, 4 (ok), '4b', 5, 6, 7, 8, 9 ...
See also
getStatusPieChart()

Definition at line 31 of file dashboard.lib.php.

References $conf, and dol_getThemeFilePath().

Referenced by getCustomerOrderPieChart().