class FormActions (View source)

Class to manage building of HTML components

Properties

DoliDB $db
string $error

Methods

__construct($db)

Constructor

form_select_status_action($formname, string $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100', $nooutput = 0)

Show list of action status

int
showactions($object, string $typeelement, int $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0)

Show list of actions for element

select_type_actions($selected = '', string $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = 'minwidth300', $showempty = 0)

Output html select list of type of event

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

form_select_status_action($formname, string $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100', $nooutput = 0)

Show list of action status

@param  string      $formname       Name of form where select is included

Parameters

$formname
string $selected

Preselected value (-1..100) @param int<0,1> $canedit 1=can edit, 0=read only @param string $htmlname Name of html prefix for html fields (selectX and valX) @param integer $showempty Show an empty line if select is used @param integer $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) @param string $morecss More css on select field @param int<0,1> $nooutput 1=No output, return string. 0=Print on output @return void|string @phpstan-return ($nooutput is 1 ? void : string)

$canedit
$htmlname
$showempty
$onlyselect
$morecss
$nooutput

int showactions($object, string $typeelement, int $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0)

Show list of actions for element

@param Object $object Object

Parameters

$object
string $typeelement

'invoice', 'propal', 'order', 'invoice_supplier', 'order_supplier', 'fichinter'

int $socid

Socid of user @param int $forceshowtitle Show title even if there is no actions to show @param string $morecss More css on table @param int $max Max number of record @param string $moreparambacktopage More param for the backtopage @param string $morehtmlcenter More html text on center of title line @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions)

$forceshowtitle
$morecss
$max
$moreparambacktopage
$morehtmlcenter
$assignedtouser

Return Value

int

Return integer <0 if KO, >=0 if OK

select_type_actions($selected = '', string $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0, $morecss = 'minwidth300', $showempty = 0)

Output html select list of type of event

@param string[]|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.

Parameters

$selected
string $htmlname

Name of select field @param string $excludetype A type to exclude ('systemauto', 'system', '') @param int<-2,1> $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet) @param int<-1,1> $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value @param int<0,1> $multiselect 1=Allow multiselect of action type @param int<0,1> $nooutput 1=No output @param string $morecss More css to add to SELECT component. @param int<0,1>|string $showempty 0 or 1 or 'Placeholder string' @return string

$excludetype
$onlyautoornot
$hideinfohelp
$multiselect
$nooutput
$morecss
$showempty