|
dolibarr 23.0.3
|
Class to common field. More...


Public Member Functions | |
| __construct ($db) | |
| Constructor. | |
| clearErrors () | |
| clear errors | |
| errorsToString ($separator=', ') | |
| Method to output saved errors. | |
| isEmptyValue ($fieldInfos, $value, $emptyValues=null) | |
| Check if the value is deemed as empty. | |
| printInputSearchField ($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='') | |
| Return HTML string to put an input search field into a page. | |
| printInputField ($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='') | |
| Return HTML string to put an input field into a page. | |
| printOutputField ($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='') | |
| Return HTML string to show a field into a page. | |
| getInputCss ($fieldInfos, $moreCss='', $defaultCss='minwidth400') | |
| Get input CSS. | |
| verifyFieldValue ($fieldInfos, $key, $value) | |
| Verify if the field value is valid. | |
| verifyPostFieldValue ($fieldInfos, $key, $keyPrefix='', $keySuffix='') | |
| Verify if the field value from GET/POST is valid. | |
| getPostFieldValue ($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='') | |
| Get field value from GET/POST. | |
| getPostSearchFieldValue ($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='') | |
| Get search field value from GET/POST. | |
| sqlFilterSearchField ($fieldInfos, $key, $value) | |
| Get sql filter for search field. | |
Static Public Member Functions | |
| static | setForm (&$form) |
| Set form used for print the field. | |
| static | setValidator (&$validator) |
| Set validator used for check the field value. | |
Class to common field.
Definition at line 31 of file commonfield.class.php.
| CommonField::__construct | ( | $db | ) |
Constructor.
Definition at line 79 of file commonfield.class.php.
References setForm(), setValidator(), and type.
| CommonField::clearErrors | ( | ) |
| CommonField::errorsToString | ( | $separator = ', | |
| ' | ) |
Method to output saved errors.
| string | $separator | Separator between each error |
Definition at line 144 of file commonfield.class.php.
| CommonField::getInputCss | ( | $fieldInfos, | |
| $moreCss = '', | |||
| $defaultCss = 'minwidth400' ) |
Get input CSS.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $moreCss | Value for css to define style/length of field. |
| string | $defaultCss | Default value for css to define style/length of field. |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 236 of file commonfield.class.php.
| CommonField::getPostFieldValue | ( | $fieldInfos, | |
| $key, | |||
| $defaultValue = null, | |||
| $keyPrefix = '', | |||
| $keySuffix = '' ) |
Get field value from GET/POST.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $defaultValue | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 337 of file commonfield.class.php.
| CommonField::getPostSearchFieldValue | ( | $fieldInfos, | |
| $key, | |||
| $defaultValue = null, | |||
| $keyPrefix = '', | |||
| $keySuffix = '' ) |
Get search field value from GET/POST.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $defaultValue | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 353 of file commonfield.class.php.
| CommonField::isEmptyValue | ( | $fieldInfos, | |
| $value, | |||
| $emptyValues = null ) |
Check if the value is deemed as empty.
| FieldInfos | $fieldInfos | Properties of the field |
| mixed | $value | Value to check (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| array<int,mixed> | $emptyValues List of value deemed as empty |
Definition at line 157 of file commonfield.class.php.
Referenced by SelectField\getPostFieldValue(), PricecyField\getPriceAndCurrencyFromValue(), CheckboxField\printInputField(), ChkbxlstField\printInputField(), DateField\printInputField(), DatetimeField\printInputField(), DatetimegmtField\printInputField(), DoubleField\printInputField(), LinkField\printInputField(), PricecyField\printInputField(), PriceField\printInputField(), RadioField\printInputField(), RealField\printInputField(), SelectField\printInputField(), SellistField\printInputField(), TimestampField\printInputField(), ChkbxlstField\printInputSearchField(), RadioField\printInputSearchField(), SelectField\printInputSearchField(), CheckboxField\printOutputField(), ChkbxlstField\printOutputField(), CommonGeoField\printOutputField(), DateField\printOutputField(), DatetimeField\printOutputField(), DatetimegmtField\printOutputField(), DoubleField\printOutputField(), DurationField\printOutputField(), EmailField\printOutputField(), HtmlField\printOutputField(), IconField\printOutputField(), IntField\printOutputField(), IpField\printOutputField(), PasswordField\printOutputField(), PhoneField\printOutputField(), PricecyField\printOutputField(), PriceField\printOutputField(), RealField\printOutputField(), SelectField\printOutputField(), SellistField\printOutputField(), TextField\printOutputField(), TimestampField\printOutputField(), UrlField\printOutputField(), VarcharField\printOutputField(), BooleanField\sqlFilterSearchField(), CheckboxField\sqlFilterSearchField(), DateField\sqlFilterSearchField(), DatetimeField\sqlFilterSearchField(), DatetimegmtField\sqlFilterSearchField(), DoubleField\sqlFilterSearchField(), DurationField\sqlFilterSearchField(), EmailField\sqlFilterSearchField(), HtmlField\sqlFilterSearchField(), IconField\sqlFilterSearchField(), IntField\sqlFilterSearchField(), IpField\sqlFilterSearchField(), LinkField\sqlFilterSearchField(), PasswordField\sqlFilterSearchField(), PhoneField\sqlFilterSearchField(), PriceField\sqlFilterSearchField(), RadioField\sqlFilterSearchField(), RealField\sqlFilterSearchField(), SelectField\sqlFilterSearchField(), StarsField\sqlFilterSearchField(), TextField\sqlFilterSearchField(), TimestampField\sqlFilterSearchField(), UrlField\sqlFilterSearchField(), VarcharField\sqlFilterSearchField(), BooleanField\verifyFieldValue(), CheckboxField\verifyFieldValue(), ChkbxlstField\verifyFieldValue(), verifyFieldValue(), DateField\verifyFieldValue(), DatetimeField\verifyFieldValue(), DatetimegmtField\verifyFieldValue(), DoubleField\verifyFieldValue(), DurationField\verifyFieldValue(), EmailField\verifyFieldValue(), IntField\verifyFieldValue(), IpField\verifyFieldValue(), LinkField\verifyFieldValue(), PasswordField\verifyFieldValue(), PhoneField\verifyFieldValue(), PricecyField\verifyFieldValue(), PriceField\verifyFieldValue(), RadioField\verifyFieldValue(), RealField\verifyFieldValue(), SelectField\verifyFieldValue(), SellistField\verifyFieldValue(), StarsField\verifyFieldValue(), TimestampField\verifyFieldValue(), and UrlField\verifyFieldValue().
| CommonField::printInputField | ( | $fieldInfos, | |
| $key, | |||
| $value, | |||
| $keyPrefix = '', | |||
| $keySuffix = '', | |||
| $moreCss = '', | |||
| $moreAttrib = '' ) |
Return HTML string to put an input field into a page.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $value | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $moreCss | Value for css to define style/length of field. |
| string | $moreAttrib | To add more attributes on html input tag |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 205 of file commonfield.class.php.
| CommonField::printInputSearchField | ( | $fieldInfos, | |
| $key, | |||
| $value, | |||
| $keyPrefix = '', | |||
| $keySuffix = '', | |||
| $moreCss = '', | |||
| $moreAttrib = '' ) |
Return HTML string to put an input search field into a page.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $value | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $moreCss | Value for css to define style/length of field. |
| string | $moreAttrib | To add more attributes on html input tag |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 188 of file commonfield.class.php.
| CommonField::printOutputField | ( | $fieldInfos, | |
| $key, | |||
| $value, | |||
| $keyPrefix = '', | |||
| $keySuffix = '', | |||
| $moreCss = '', | |||
| $moreAttrib = '' ) |
Return HTML string to show a field into a page.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $value | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $moreCss | Value for css to define style/length of field. |
| string | $moreAttrib | To add more attributes on html input tag |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 222 of file commonfield.class.php.
|
static |
Set form used for print the field.
Definition at line 111 of file commonfield.class.php.
Referenced by __construct(), and FieldsManager\__construct().
|
static |
Set validator used for check the field value.
Definition at line 122 of file commonfield.class.php.
Referenced by __construct().
| CommonField::sqlFilterSearchField | ( | $fieldInfos, | |
| $key, | |||
| $value ) |
Get sql filter for search field.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $value | Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 367 of file commonfield.class.php.
| CommonField::verifyFieldValue | ( | $fieldInfos, | |
| $key, | |||
| $value ) |
Verify if the field value is valid.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| mixed | $value | Value to check (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 259 of file commonfield.class.php.
References isEmptyValue().
Referenced by verifyPostFieldValue().
| CommonField::verifyPostFieldValue | ( | $fieldInfos, | |
| $key, | |||
| $keyPrefix = '', | |||
| $keySuffix = '' ) |
Verify if the field value from GET/POST is valid.
| FieldInfos | $fieldInfos | Properties of the field |
| string | $key | Key of field |
| string | $keyPrefix | Prefix string to add into name and id of field (can be used to avoid duplicate names) |
| string | $keySuffix | Suffix string to add into name and id of field (can be used to avoid duplicate names) |
Reimplemented in BooleanField, CheckboxField, ChkbxlstField, CommonGeoField, DateField, DatetimeField, DatetimegmtField, DoubleField, DurationField, EmailField, HtmlField, IconField, IntField, IpField, LinkField, PasswordField, PhoneField, PricecyField, PriceField, RadioField, RealField, SelectField, SellistField, StarsField, TextField, TimestampField, UrlField, and VarcharField.
Definition at line 319 of file commonfield.class.php.
References GETPOST(), and verifyFieldValue().