class box_graph_orders_permonth extends ModeleBoxes (View source)

Class to manage the box to show orders per month graph

Properties

DoliDB $db from  ModeleBoxes
""|"development"|"experimental"|"dolibarr" $version

Must be defined in the box class

from  ModeleBoxes
string $param from  ModeleBoxes
array<array{text: string, nbcol?: int, limit?: int, graph?: int<0, 1>, sublink?: string, subtext?: string, picto?: string, target?: string, td?: string}>|array{text: string, nbcol?: int, limit?: int, graph?: int<0, 1>, sublink?: string, subtext?: string, picto?: string, target?: string, td?: string} $info_box_head from  ModeleBoxes
array<array<array{td?: string, text: string, asis?: int<0, 1>, maxlength?: int}>>|array<array{td?: string, text: string, asis?: int<0, 1>, maxlength?: int}> $info_box_contents from  ModeleBoxes
string $error from  ModeleBoxes
int<0, max> $max from  ModeleBoxes
bool|int $enabled from  ModeleBoxes
bool $hidden from  ModeleBoxes
int $rowid from  ModeleBoxes
int deprecated $id from  ModeleBoxes
int $position from  ModeleBoxes
string $box_order from  ModeleBoxes
int $fk_user from  ModeleBoxes
string $sourcefile from  ModeleBoxes
string $class from  ModeleBoxes
string $box_id from  ModeleBoxes
string $lang from  ModeleBoxes
$boxcode
string $note from  ModeleBoxes
$widgettype
$boximg
$boxlabel
$depends
string $urltoaddentry from  ModeleBoxes
string $msgNoRecords from  ModeleBoxes

Methods

__construct(DoliDB $db, string $param)

Constructor

void
loadBox($max = 5)

Load data into info_box_contents array to show array later.

string
error()

Return last error message

int<-1, 1>
fetch(int $rowid)

Load a box line from its rowid

string
showBox(?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head = null, ?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents = null, int<0, 1> $nooutput = 0)

Method to show box. Called when the box needs to be displayed.

static array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}>
getWidgetsList(?string[] $forcedirwidget = null)

Return list of widget. Function used by admin page htdoc/admin/widget.

Details

__construct(DoliDB $db, string $param)

Constructor

@param  DoliDB  $db         Database handler

Parameters

DoliDB $db

Database handler

string $param

More parameters

void loadBox($max = 5)

Load data into info_box_contents array to show array later.

@param int $max Maximum number of records to load

Parameters

$max

Return Value

void

string error()

Return last error message

Return Value

string

Error message

int<-1, 1> fetch(int $rowid)

Load a box line from its rowid

Parameters

int $rowid

Row id to load

Return Value

int<-1, 1>

Return integer <0 if KO, >0 if OK

string showBox(?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head = null, ?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents = null, int<0, 1> $nooutput = 0)

Method to show box. Called when the box needs to be displayed.

Parameters

?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head

Array with properties of box title

?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents

Array with properties of box lines

int<0, 1> $nooutput

No print, only return string

Return Value

string

static array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}> getWidgetsList(?string[] $forcedirwidget = null)

Return list of widget. Function used by admin page htdoc/admin/widget.

List is sorted by widget filename so by priority to run.

Parameters

?string[] $forcedirwidget

null=All default directories. This parameter is used by modulebuilder module only.

Return Value

array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}>

Array list of widgets