dolibarr 25.0.0-alpha
customreports.lib.php File Reference

Set of function to manipulate custom reports. More...

Go to the source code of this file.

Functions

 fillArrayOfMeasures ($object, $tablealias, $labelofobject, &$arrayofmesures, $level=0, &$count=0, &$tablepath='')
 Fill arrayofmesures for an object.
 
 fillArrayOfXAxis ($object, $tablealias, $labelofobject, &$arrayofxaxis, $level=0, &$count=0, &$tablepath='')
 Fill arrayofmesures for an object.
 
 fillArrayOfGroupBy ($object, $tablealias, $labelofobject, &$arrayofgroupby, $level=0, &$count=0, &$tablepath='')
 Fill arrayofgroupby for an object.
 
 fillArrayOfFilterFields ($object, $tablealias, $labelofobject, &$arrayoffields, $level=0, &$count=0, &$tablepath='')
 Fill array of possible filter fields for an object.
 
 customReportsSelectMeasures ($htmlname, $arrayofmesures, $selected, $placeholder='')
 Return HTML of the component to select measures.
 
 customReportsSelectFieldCombo ($htmlname, $arrayoffields, $selected, $placeholder='', $allowclear=0)
 Return HTML of a combo to select one field (X axis, group by...).
 
 customReportsSelectXAxis ($htmlname, $arrayofxaxis, $selected, $placeholder='')
 Return HTML of the combo to select the X axis (see customReportsSelectFieldCombo())
 
 customReportsSelectGroupBy ($htmlname, $arrayofgroupby, $selected, $placeholder='')
 Return HTML of the combo to select the group by field (see customReportsSelectFieldCombo()).
 

Detailed Description

Set of function to manipulate custom reports.

Definition in file customreports.lib.php.

Function Documentation

◆ customReportsSelectFieldCombo()

customReportsSelectFieldCombo ( $htmlname,
$arrayoffields,
$selected,
$placeholder = '',
$allowclear = 0 )

Return HTML of a combo to select one field (X axis, group by...).

Same look and principle than the combo of fields of the filter component: the main element is open with its fields, the sub-elements are listed after its fields and are collapsed. Behaviour is managed by core/js/customreports.js. Selection is posted with a hidden input.

Parameters
string$htmlnameName of the HTML field
array<string,array{label:string,labelnohtml:string,position:int|string,table:string,tablefromt:string}>$arrayoffields Array of fields (from fillArrayOfXAxis() or fillArrayOfGroupBy())
string[]$selectedArray of selected keys (only first one is used)
string$placeholderPlaceholder
int<0,1>$allowclear 1 to show a button to clear the selection
Returns
string HTML string of component
Parameters
string$elementkeyKey of the element to render
Returns
string HTML of the element and of its sub-elements

Definition at line 800 of file customreports.lib.php.

References $conf, dol_escape_htmltag(), dol_escape_js(), and dol_string_nohtmltag().

Referenced by customReportsSelectGroupBy(), and customReportsSelectXAxis().

◆ customReportsSelectGroupBy()

customReportsSelectGroupBy ( $htmlname,
$arrayofgroupby,
$selected,
$placeholder = '' )

Return HTML of the combo to select the group by field (see customReportsSelectFieldCombo()).

Selection can be cleared.

Parameters
string$htmlnameName of the HTML field
array<string,array{label:string,labelnohtml:string,position:int|string,table:string,tablefromt:string}>$arrayofgroupby Array of group by (from fillArrayOfGroupBy())
string[]$selectedArray of selected keys (only first one is used)
string$placeholderPlaceholder
Returns
string HTML string of component

Definition at line 945 of file customreports.lib.php.

References customReportsSelectFieldCombo().

◆ customReportsSelectMeasures()

customReportsSelectMeasures ( $htmlname,
$arrayofmesures,
$selected,
$placeholder = '' )

Return HTML of the component to select measures.

Fields are listed first and, for fields with variants (sum, average, min, max, standard deviation), variants are shown in an expandable sub list. Behaviour is managed by core/js/customreports.js. Selection is posted with a hidden multiple select.

Parameters
string$htmlnameName of the HTML field (posted as $htmlname[])
array<string,array{label:string,labelnohtml:string,position:int|string,table:string,tablefromt:string}>$arrayofmesures Array of measures (from fillArrayOfMeasures())
string[]$selectedArray of selected keys
string$placeholderPlaceholder
Returns
string HTML string of component

Definition at line 689 of file customreports.lib.php.

References $conf, dol_escape_htmltag(), dol_escape_js(), and dol_strtolower().

◆ customReportsSelectXAxis()

customReportsSelectXAxis ( $htmlname,
$arrayofxaxis,
$selected,
$placeholder = '' )

Return HTML of the combo to select the X axis (see customReportsSelectFieldCombo())

Parameters
string$htmlnameName of the HTML field
array<string,array{label:string,labelnohtml:string,position:int|string,table:string,tablefromt:string}>$arrayofxaxis Array of X axis (from fillArrayOfXAxis())
string[]$selectedArray of selected keys (only first one is used)
string$placeholderPlaceholder
Returns
string HTML string of component

Definition at line 930 of file customreports.lib.php.

References customReportsSelectFieldCombo().

◆ fillArrayOfFilterFields()

fillArrayOfFilterFields ( $object,
$tablealias,
$labelofobject,
& $arrayoffields,
$level = 0,
& $count = 0,
& $tablepath = '' )

Fill array of possible filter fields for an object.

Parameters
CommonObject$objectAny object
string$tablealiasAlias of table ('t' for example)
string$labelofobjectLabel of object
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string,type:string,bi?:int<0,1>}>$arrayoffields Array of fields already filled
int$levelLevel
int$countCount
string$tablepathPath of all tables ('t' or 't,contract' or 't,contract,societe'...)
Returns
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string,type:string,bi?:int<0,1>}> Array of fields

Definition at line 556 of file customreports.lib.php.

References $object, dol_eval(), dol_include_once(), and fillArrayOfFilterFields().

Referenced by fillArrayOfFilterFields().

◆ fillArrayOfGroupBy()

fillArrayOfGroupBy ( $object,
$tablealias,
$labelofobject,
& $arrayofgroupby,
$level = 0,
& $count = 0,
& $tablepath = '' )

Fill arrayofgroupby for an object.

Parameters
CommonObject$objectAny object
string$tablealiasAlias of table
string$labelofobjectLabel of object
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}>$arrayofgroupby Array of groupby already filled
int$levelLevel
int$countCount
string$tablepathPath of all tables ('t' or 't,contract' or 't,contract,societe'...)
Returns
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}> Array of groupby

Definition at line 381 of file customreports.lib.php.

References $object, dol_eval(), dol_include_once(), and fillArrayOfGroupBy().

Referenced by fillArrayOfGroupBy().

◆ fillArrayOfMeasures()

fillArrayOfMeasures ( $object,
$tablealias,
$labelofobject,
& $arrayofmesures,
$level = 0,
& $count = 0,
& $tablepath = '' )

Fill arrayofmesures for an object.

Parameters
mixed$objectAny object
string$tablealiasAlias of table
string$labelofobjectLabel of object
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}>$arrayofmesures Array of measures already filled
int$levelLevel
int$countCount
string$tablepathPath of all tables ('t' or 't,contract' or 't,contract,societe'...)
Returns
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}> Array of measures

Definition at line 39 of file customreports.lib.php.

References $object, dol_eval(), dol_include_once(), and fillArrayOfMeasures().

Referenced by fillArrayOfMeasures().

◆ fillArrayOfXAxis()

fillArrayOfXAxis ( $object,
$tablealias,
$labelofobject,
& $arrayofxaxis,
$level = 0,
& $count = 0,
& $tablepath = '' )

Fill arrayofmesures for an object.

Parameters
mixed$objectAny object
string$tablealiasAlias of table ('t' for example)
string$labelofobjectLabel of object
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}>$arrayofxaxis Array of xaxis already filled
int$levelLevel
int$countCount
string$tablepathPath of all tables ('t' or 't,contract' or 't,contract,societe'...)
Returns
array<string,array{label:string,labelnohtml:string,position:int,table:string,tablefromt:string}> Array of xaxis

Definition at line 202 of file customreports.lib.php.

References $object, dol_eval(), dol_include_once(), and fillArrayOfXAxis().

Referenced by fillArrayOfXAxis().