24require_once DOL_DOCUMENT_ROOT .
'/core/class/fields/commonfield.class.php';
25require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
36 public $emptyValues = array(
'');
51 public function printInputSearchField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
53 $moreCss = $this->
getInputCss($fieldInfos, $moreCss);
54 $htmlName = $keyPrefix . $key . $keySuffix;
56 return self::$form->inputType(
'text', $htmlName, (
string) $value, $htmlName, $moreCss, $moreAttrib);
71 public function printInputField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
73 $moreCss = $this->
getInputCss($fieldInfos, $moreCss);
74 $moreAttrib = trim((
string) $moreAttrib);
75 if (empty($moreAttrib)) $moreAttrib =
' ' . $moreAttrib;
76 $htmlName = $keyPrefix . $key . $keySuffix;
78 return self::$form->inputText($htmlName, (
string) $value, $moreCss, $moreAttrib, $fieldInfos->options);
93 public function printOutputField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
96 if (!empty($fieldInfos->options)) {
97 $value = str_replace(
',',
"\n", (
string) $value);
115 public function getInputCss($fieldInfos, $moreCss =
'', $defaultCss =
'')
117 return parent::getInputCss($fieldInfos, $moreCss, $defaultCss);
131 return parent::verifyFieldValue($fieldInfos, $key, $value);
146 $htmlName = $keyPrefix . $key . $keySuffix;
147 $value =
GETPOST($htmlName,
'restricthtml');
163 public function getPostFieldValue($fieldInfos, $key, $defaultValue =
null, $keyPrefix =
'', $keySuffix =
'')
165 $htmlName = $keyPrefix . $key . $keySuffix;
167 if (GETPOSTISSET($htmlName)) {
168 if (!empty($fieldInfos->getPostCheck)) {
169 $value =
GETPOST($htmlName, $fieldInfos->getPostCheck);
171 $value =
GETPOST($htmlName,
'nohtml');
172 if (!empty($fieldInfos->options) && !empty($fieldInfos->multiInput)) {
173 $tmpArrayMultiSelect =
GETPOST($htmlName .
'_multiselect',
'array');
174 foreach ($tmpArrayMultiSelect as $tmpValue) {
175 $value .= (!empty($value) ?
"," :
"") . $tmpValue;
180 $value = $defaultValue;
199 $htmlName = $keyPrefix . $key . $keySuffix;
201 if (GETPOSTISSET($htmlName)) {
202 $value =
GETPOST($htmlName,
'alpha');
204 $value = $defaultValue;
222 $alias = $fieldInfos->sqlAlias ??
't.';
224 return natural_search($alias . ($fieldInfos->nameInTable ?? $key), $value, 0);
isEmptyValue($fieldInfos, $value, $emptyValues=null)
Check if the value is deemed as empty.
getPostFieldValue($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='')
Get field value from GET/POST.
verifyPostFieldValue($fieldInfos, $key, $keyPrefix='', $keySuffix='')
Verify if the field value from GET/POST is valid.
getPostSearchFieldValue($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='')
Get search field value from GET/POST.
printInputField($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='')
Return HTML string to put an input field into a page.
verifyFieldValue($fieldInfos, $key, $value)
Verify if the field value is valid.
printOutputField($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='')
Return HTML string to show a field into a page.
getInputCss($fieldInfos, $moreCss='', $defaultCss='')
Get input CSS.
printInputSearchField($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='')
Return HTML string to put an input search field into a page.
sqlFilterSearchField($fieldInfos, $key, $value)
Get sql filter for search field.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...