24require_once DOL_DOCUMENT_ROOT .
'/core/class/fields/commonfield.class.php';
37 public $emptyValues = array(
'');
52 public function printInputSearchField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
54 $moreCss = $this->
getInputCss($fieldInfos, $moreCss);
55 $htmlName = $keyPrefix . $key . $keySuffix;
57 return self::$form->inputType(
'text', $htmlName, $value, $htmlName, $moreCss, $moreAttrib);
72 public function printInputField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
74 $moreCss = $this->
getInputCss($fieldInfos, $moreCss);
75 $moreAttrib = trim((
string) $moreAttrib);
76 if (empty($moreAttrib)) $moreAttrib =
' ' . $moreAttrib;
77 $htmlName = $keyPrefix . $key . $keySuffix;
79 return self::$form->inputHtml($htmlName, $value, $moreCss, $moreAttrib);
94 public function printOutputField($fieldInfos, $key, $value, $keyPrefix =
'', $keySuffix =
'', $moreCss =
'', $moreAttrib =
'')
97 if (!empty($fieldInfos->options)) {
98 $value = str_replace(
',',
"\n", (
string) $value);
116 public function getInputCss($fieldInfos, $moreCss =
'', $defaultCss =
'')
118 return parent::getInputCss($fieldInfos, $moreCss, $defaultCss);
132 return parent::verifyFieldValue($fieldInfos, $key, $value);
147 return parent::verifyPostFieldValue($fieldInfos, $key, $keyPrefix, $keySuffix);
161 public function getPostFieldValue($fieldInfos, $key, $defaultValue =
null, $keyPrefix =
'', $keySuffix =
'')
163 $htmlName = $keyPrefix . $key . $keySuffix;
165 if (GETPOSTISSET($htmlName)) {
166 $value =
GETPOST($htmlName, empty($fieldInfos->getPostCheck) ?
'restricthtml' : $fieldInfos->getPostCheck);
168 $value = $defaultValue;
187 $htmlName = $keyPrefix . $key . $keySuffix;
189 if (GETPOSTISSET($htmlName)) {
190 $value =
GETPOST($htmlName,
'alpha');
192 $value = $defaultValue;
210 $alias = $fieldInfos->sqlAlias ??
't.';
212 return natural_search($alias . ($fieldInfos->nameInTable ?? $key), $value, 0);
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.
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.
sqlFilterSearchField($fieldInfos, $key, $value)
Get sql filter for search field.
getInputCss($fieldInfos, $moreCss='', $defaultCss='')
Get input CSS.
printInputField($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='')
Return HTML string to put an input field into a page.
getPostSearchFieldValue($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='')
Get search field value from GET/POST.
printOutputField($fieldInfos, $key, $value, $keyPrefix='', $keySuffix='', $moreCss='', $moreAttrib='')
Return HTML string to show a field into a page.
getPostFieldValue($fieldInfos, $key, $defaultValue=null, $keyPrefix='', $keySuffix='')
Get field value from GET/POST.
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...