FormSetupItem
class FormSetupItem (View source)
This class help to create item for class formSetup
Properties
| DoliDB | $db | ||
| Translate | $langs | ||
| int | $entity | ||
| Form | $form | ||
| string | $confKey | ||
| string|false | $nameText | ||
| string | $helpText | ||
| string | $picto | ||
| ?string | $fieldValue | ||
| ?string | $defaultFieldValue | ||
| array{name?: string, id?: string, value?: mixed, class?: string, disabled?: ?int<0, 1>, type?: string, size?: int, placeholder?: string, step?: float|string, min?: int, max?: int} | $fieldAttr | ||
| bool|string | $fieldOverride | ||
| bool|string | $fieldInputOverride | ||
| bool|string | $fieldOutputOverride | ||
| int | $rank | ||
| array<string, string|array{id: int|string, label: string, color: string, picto: string, labelhtml: string}> | $fieldOptions | ||
| array<string, string|int|array{id: int|string, label: string, color: string, picto: string, labelhtml: string}> | $fieldParams | ||
| callable | $saveCallBack | ||
| callable | $setValueFromPostCallBack | ||
| string[] | $errors | ||
| protected string | $type | TODO each type must have setAs{type} method to help configuration And set var as protected when its done configuration must be done by method this is important for retrocompatibility of future versions |
|
| int<0, 1> | $enabled | ||
| string | $cssClass |
Methods
Constructor
load conf value from databases
Save const value based on htdocs/core/actions_setmoduleoptions.inc.php
Set an override function for saving data
Set an override function for get data from post
Save const value based on htdocs/core/actions_setmoduleoptions.inc.php
Get help text or generate it
Get field name text or generate it
generate input field
Generate default input field
Generate default input field
Generate default input field
Generate default input field
generate input field for textarea
generate input field for html
generate input field for categories
generate input field for email template selector
generate input field for secure key
generate input field for a password
generateInputFieldMultiSelect
generateInputFieldSelect
generateInputFieldSelect
No description
get the type : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set or get directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily
set the type from string : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily
Add error
generateOutputField
generateOutputFieldMultiSelect
generateOutputFieldColor
generateInputFieldColor
generateOutputFieldSelect
generateOutputFieldSelectUser
Set type of input as string
Set type of input as number
Set type of input as string
Set type of input as string
Set type of input as color
Set type of input as textarea
Set type of input as html editor
Set type of input as emailtemplate selector
Set type of input as thirdparty_type selector
Set type of input as Yes
Set type of input as secure key
Set type of input as product
Set type of input as product
Set type of input as a category selector TODO add default value
Set type of input as a simple title. No data to store
Set type of input as a simple title. No data to store
Set type of input as a simple title. No data to store
Set type of input as a simple title. No data to store
Set type of input as a simple title. No data to store
Set type of input as a simple title. No data to store
Set type of input as a password with dolibarr password rules apply.
Set type of input as a generic password without dolibarr password rules (for external passwords for example).
Details
__construct(string $confKey)
Constructor
bool
loadValueFromConf()
load conf value from databases
bool
reloadValueFromConf()
deprecated
deprecated
Reload conf value from databases is an alias of loadValueFromConf
int
saveConfValue()
Save const value based on htdocs/core/actions_setmoduleoptions.inc.php
void
setSaveCallBack(callable $callBack)
Set an override function for saving data
void
setValueFromPostCallBack(callable $callBack)
Set an override function for get data from post
int
setValueFromPost()
Save const value based on htdocs/core/actions_setmoduleoptions.inc.php
int|string
getHelpText()
Get help text or generate it
false|int|string
getNameText()
Get field name text or generate it
bool|string
generateInputField()
generate input field
string
generateInputFieldText()
Generate default input field
string
generateInputFieldPrice()
Generate default input field
string
generateInputFieldEmail()
Generate default input field
string
generateInputFieldUrl()
Generate default input field
string
generateInputFieldTextarea()
generate input field for textarea
string
generateInputFieldHtml()
generate input field for html
string
generateInputFieldCategories()
generate input field for categories
string
generateInputFieldEmailTemplate()
generate input field for email template selector
string
generateInputFieldSecureKey()
generate input field for secure key
string
generateInputFieldPassword(string $type = 'generic', int $defaultmin = 6, int $defaultmax = 50)
generate input field for a password
string
generateInputFieldMultiSelect()
generateInputFieldMultiSelect
string
generateInputFieldSelect()
generateInputFieldSelect
string
generateInputFieldRadio()
generateInputFieldSelect
string
generateInputFieldSelectUser()
No description
string
getType()
get the type : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set or get directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily
bool
setTypeFromTypeString(string $type)
deprecated
deprecated
set the type from string : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily
null
setErrors(string[]|string $errors)
Add error
bool|string
generateOutputField()
generateOutputField
string
generateOutputFieldMultiSelect()
generateOutputFieldMultiSelect
string
generateOutputFieldColor()
generateOutputFieldColor
string
generateInputFieldColor()
generateInputFieldColor
string
generateOutputFieldSelect()
generateOutputFieldSelect
string
generateOutputFieldSelectUser()
generateOutputFieldSelectUser
FormSetupItem
setAsString()
Set type of input as string
FormSetupItem
setAsNumber(int $min = null, int $max = null, int $step = null)
Set type of input as number
FormSetupItem
setAsEmail()
Set type of input as string
FormSetupItem
setAsUrl()
Set type of input as string
FormSetupItem
setAsColor()
Set type of input as color
FormSetupItem
setAsTextarea()
Set type of input as textarea
FormSetupItem
setAsHtml()
Set type of input as html editor
FormSetupItem
setAsEmailTemplate(string $templateType)
Set type of input as emailtemplate selector
FormSetupItem
setAsThirdpartyType()
Set type of input as thirdparty_type selector
FormSetupItem
setAsYesNo()
Set type of input as Yes
FormSetupItem
setAsSecureKey()
Set type of input as secure key
FormSetupItem
setAsProduct()
Set type of input as product
FormSetupItem
setAsPrice()
Set type of input as product
FormSetupItem
setAsCategory(string $catType)
Set type of input as a category selector TODO add default value
FormSetupItem
setAsTitle()
Set type of input as a simple title. No data to store
FormSetupItem
setAsMultiSelect(array<string, string|array{id: string, label: string, color: string, picto: string, labelhtml: string}> $fieldOptions)
Set type of input as a simple title. No data to store
FormSetupItem
setAsSelect(?array<string, string|array{id: string, label: string, color: string, picto: string, labelhtml: string}> $fieldOptions)
Set type of input as a simple title. No data to store
FormSetupItem
setAsRadio(?array<string, string|array{id: string, label: string, picto?: string, labelIsHtml?: bool}> $fieldOptions)
Set type of input as a simple title. No data to store
FormSetupItem
setAsSelectUser()
Set type of input as a simple title. No data to store
FormSetupItem
setAsSelectBankAccount()
Set type of input as a simple title. No data to store
FormSetupItem
setAsPassword()
Set type of input as a password with dolibarr password rules apply.
Hide entry on display.
FormSetupItem
setAsGenericPassword()
Set type of input as a generic password without dolibarr password rules (for external passwords for example).
Hide entry on display.