class CActionComm (View source)

Class to manage different types of events

Properties

string $error
DoliDB $db
int $id
string $code
string $type
$libelle
string $label
int $active
string $color
string $picto
array{id: array<int, string>, code: array<string, string>, all: array<string, array{id: string, label: string, type: string, color: mixed, picto: string}>} $liste_array

Methods

__construct($db)

Constructor

int
fetch($id)

Load action type from database

int<-1, -1>|array{id: array<int, string>, code: array<string, string>, all: array<string, array{id: string, label: string, type: string, color: mixed, picto: string}>, AC_OTH_AUTO?: mixed}
liste_array($active = '', "id"|"code"|"all" $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)

Return list of event types: array(id=>label) or array(code=>label)

getNomUrl(int $withpicto = 0)

Return name of action type as a label translated

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

int fetch($id)

Load action type from database

@param int|string $id id or code of action type to read

Parameters

$id

Return Value

int

1=ok, 0=not found, -1=error

int<-1, -1>|array{id: array<int, string>, code: array<string, string>, all: array<string, array{id: string, label: string, type: string, color: mixed, picto: string}>, AC_OTH_AUTO?: mixed} liste_array($active = '', "id"|"code"|"all" $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)

Return list of event types: array(id=>label) or array(code=>label)

@param ''|int<0,1> $active 1 or 0 to filter on event state active or not ('' by default = no filter)

Parameters

$active
"id"|"code"|"all" $idorcode

'id' or 'code' or 'all' @param string $excludetype Type to exclude ('system' or 'systemauto') @param int<-2,1> $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...) @param string $morefilter Add more SQL filter @param int<0,1> $shortlabel 1=Get short label instead of long label

$excludetype
$onlyautoornot
$morefilter
$shortlabel

Return Value

int<-1, -1>|array{id: array<int, string>, code: array<string, string>, all: array<string, array{id: string, label: string, type: string, color: mixed, picto: string}>, AC_OTH_AUTO?: mixed}

Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.

getNomUrl(int $withpicto = 0)

Return name of action type as a label translated

Parameters

int $withpicto

0=No picto, 1=Include picto into link, 2=Picto only @return string|-1 Label of action type, or -1 if error