33 public $items = array();
38 public $setupNotEmpty = 0;
47 protected $maxItemRank;
53 public $htmlBeforeOutputForm =
'';
59 public $htmlAfterOutputForm =
'';
65 public $htmlOutputMoreButton =
'';
72 public $formAttributes = array(
81 public $formHiddenInputs = array();
86 public $errors = array();
101 $this->form =
new Form($this->db);
102 $this->formAttributes[
'action'] = $_SERVER[
"PHP_SELF"];
104 $this->formHiddenInputs[
'token'] =
newToken();
105 $this->formHiddenInputs[
'action'] =
'update';
107 $this->entity = (is_null($this->entity) ? $conf->entity : $this->entity);
110 $this->langs = $outputLangs;
112 $this->langs = $langs;
125 if (is_array($attributes)) {
126 foreach ($attributes as $attribute => $value) {
127 if (is_array($value) || is_object($value)) {
134 return !empty($Aattr) ? implode(
' ', $Aattr) :
'';
147 global $hookmanager, $action;
149 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
152 'editMode' => $editMode
154 $reshook = $hookmanager->executeHooks(
'formSetupBeforeGenerateOutput', $parameters, $this, $action);
160 return $hookmanager->resPrint;
162 $out =
'<!-- Start generateOutput from FormSetup class -->';
163 $out .= $this->htmlBeforeOutputForm;
169 if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) {
170 foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) {
171 $out .=
'<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).
'" value="' .
dol_escape_htmltag($hiddenValue) .
'">';
180 $reshook = $hookmanager->executeHooks(
'formSetupBeforeGenerateOutputButton', $parameters, $this, $action);
186 return $hookmanager->resPrint;
187 } elseif ($editMode) {
188 $out .=
'<div class="form-setup-button-container center">';
189 $out .= $this->htmlOutputMoreButton;
190 $out .=
'<input class="button button-save" type="submit" value="' . $this->langs->trans(
"Save") .
'">';
201 $out .= $this->htmlAfterOutputForm;
216 global $hookmanager, $action;
217 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
220 'editMode' => $editMode
222 $reshook = $hookmanager->executeHooks(
'formSetupBeforeGenerateTableOutput', $parameters, $this, $action);
228 return $hookmanager->resPrint;
230 $out =
'<table class="noborder centpercent">';
231 if (empty($hideTitle)) {
233 $out .=
'<tr class="liste_titre">';
234 $out .=
' <td>' . $this->langs->trans(
"Parameter") .
'</td>';
235 $out .=
' <td>' . $this->langs->trans(
"Value") .
'</td>';
244 foreach ($this->items as $item) {
262 global $hookmanager, $conf;
264 $parameters = array();
265 $reshook = $hookmanager->executeHooks(
'formSetupBeforeSaveConfFromPost', $parameters, $this);
267 $this->errors = $hookmanager->errors;
275 if (empty($this->items)) {
281 foreach ($this->items as $item) {
282 if ($item->getType() ==
'yesno' && !empty($conf->use_javascript_ajax)) {
286 $res = $item->setValueFromPost();
288 $item->saveConfValue();
289 } elseif ($res < 0) {
297 if (empty($noMessageInUpdate)) {
302 $this->db->rollback();
303 if (empty($noMessageInUpdate)) {
320 if ($item->enabled == 1) {
321 $trClass =
'oddeven';
322 if ($item->getType() ==
'title') {
323 $trClass =
'liste_titre';
326 $this->setupNotEmpty++;
327 $out .=
'<tr class="'.$trClass.
'">';
329 $out .=
'<td class="col-setup-title">';
330 $out .=
'<span id="helplink'.$item->confKey.
'" class="spanforparamtooltip">';
331 $out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1,
'info',
'', 0, 3,
'tootips'.$item->confKey);
338 $out .= $item->generateInputField();
340 $out .= $item->generateOutputField();
343 if (!empty($item->errors)) {
364 if (!is_array($params) || empty($params)) {
367 foreach ($params as $confKey => $param) {
384 if (empty($confKey) || empty($params[
'type'])) {
403 $item->setTypeFromTypeString($params['type']);
405 if (!empty($params[
'enabled'])) {
406 $item->enabled = $params[
'enabled'];
409 if (!empty($params[
'css'])) {
410 $item->cssClass = $params[
'css'];
413 $this->items[$item->confKey] = $item;
426 $arrayofparameters = array();
427 foreach ($this->items as $item) {
428 $arrayofparameters[$item->confKey] = array(
429 'type' => $item->getType(),
430 'enabled' => $item->enabled
434 return $arrayofparameters;
445 if (!array($this->items)) {
448 foreach ($this->items as $item) {
449 $item->loadValueFromConf();
465 public function newItem($confKey, $targetItemKey =
'', $insertAfterTarget =
false)
469 $item->entity = $this->entity;
472 if (empty($item->rank)) {
478 if (!empty($targetItemKey)) {
479 if (isset($this->items[$targetItemKey])) {
480 $targetItem = $this->items[$targetItemKey];
481 $item->rank = $targetItem->rank;
482 if ($targetItem->rank >= 0 && $insertAfterTarget) {
488 foreach ($this->items as $fItem) {
489 if ($item->rank <= $fItem->rank) {
490 $fItem->rank = $fItem->rank + 1;
496 $this->items[$item->confKey] = $item;
497 return $this->items[$item->confKey];
508 return uasort($this->items, array($this,
'itemSort'));
519 if (empty($this->items)) {
523 if ($cache && $this->maxItemRank > 0) {
524 return $this->maxItemRank;
527 $this->maxItemRank = 0;
528 foreach ($this->items as $item) {
529 $this->maxItemRank = max($this->maxItemRank, $item->rank);
532 return $this->maxItemRank;
544 $this->maxItemRank = max($this->maxItemRank, $rank);
556 if (!isset($this->items[$itemKey]->rank)) {
559 return $this->items[$itemKey]->rank;
572 if (empty($a->rank)) {
575 if (empty($b->rank)) {
578 if ($a->rank == $b->rank) {
581 return ($a->rank < $b->rank) ? -1 : 1;
610 public $nameText =
false;
613 public $helpText =
'';
622 public $defaultFieldValue =
null;
625 public $fieldAttr = array();
628 public $fieldOverride =
false;
631 public $fieldInputOverride =
false;
634 public $fieldOutputOverride =
false;
640 public $fieldOptions = array();
643 public $fieldParams = array();
654 public $errors = array();
662 protected $type =
'string';
669 public $cssClass =
'';
678 global $langs, $db, $conf, $form;
681 if (!empty($form) && is_object($form) && get_class($form) ==
'Form') {
684 $this->form =
new Form($this->db);
687 $this->langs = $langs;
688 $this->entity = (is_null($this->entity) ? $conf->entity : ((int) $this->entity));
690 $this->confKey = $confKey;
702 if (isset($conf->global->{$this->confKey})) {
706 $this->fieldValue =
'';
719 return $this->loadValueFromConf();
732 $parameters = array();
733 $reshook = $hookmanager->executeHooks(
'formSetupBeforeSaveConfValue', $parameters, $this);
735 $this->setErrors($hookmanager->errors);
744 if (!empty($this->saveCallBack) && is_callable($this->saveCallBack)) {
745 return call_user_func($this->saveCallBack, $this);
749 if ($this->
type !=
'title') {
750 $result =
dolibarr_set_const($this->db, $this->confKey, $this->fieldValue,
'chaine', 0,
'', $this->entity);
769 $this->saveCallBack = $callBack;
780 $this->setValueFromPostCallBack = $callBack;
790 if (!empty($this->setValueFromPostCallBack) && is_callable($this->setValueFromPostCallBack)) {
791 return call_user_func($this->setValueFromPostCallBack);
795 if ($this->
type !=
'title') {
796 if (preg_match(
'/category:/', $this->
type)) {
802 } elseif ($this->
type ==
'multiselect') {
803 $val =
GETPOST($this->confKey,
'array');
804 if ($val && is_array($val)) {
805 $val_const = implode(
',', $val);
809 } elseif ($this->
type ==
'html') {
810 $val_const =
GETPOST($this->confKey,
'restricthtml');
812 $val_const =
GETPOST($this->confKey,
'alpha');
816 $this->fieldValue = $val_const;
831 if (!empty($this->helpText)) {
832 return $this->helpText;
834 return (($this->langs->trans($this->confKey .
'Tooltip') != $this->confKey .
'Tooltip') ? $this->langs->trans($this->confKey .
'Tooltip') :
'');
844 if (!empty($this->nameText)) {
845 return $this->nameText;
847 $out = (($this->langs->trans($this->confKey) != $this->confKey) ? $this->langs->trans($this->confKey) : $this->langs->trans(
'MissingTranslationForConfKey', $this->confKey));
850 if (isModEnabled(
'multicompany') && $this->entity == 0) {
851 $out =
img_picto($this->langs->trans(
'AllEntities'),
'fa-globe-americas em088 opacityhigh') .
' ' . $out;
866 if (!empty($this->fieldOverride)) {
867 return $this->fieldOverride;
870 if (!empty($this->fieldInputOverride)) {
871 return $this->fieldInputOverride;
875 if (is_null($this->fieldValue)) {
876 $this->fieldValue = $this->defaultFieldValue;
880 $this->fieldAttr[
'name'] = $this->confKey;
881 $this->fieldAttr[
'id'] =
'setup-'.$this->confKey;
882 $this->fieldAttr[
'value'] = $this->fieldValue;
886 if ($this->
type ==
'title') {
887 $out .= $this->generateOutputField();
888 } elseif ($this->
type ==
'multiselect') {
889 $out .= $this->generateInputFieldMultiSelect();
890 } elseif ($this->
type ==
'select') {
891 $out .= $this->generateInputFieldSelect();
892 } elseif ($this->
type ==
'selectUser') {
893 $out .= $this->generateInputFieldSelectUser();
894 } elseif ($this->
type ==
'textarea') {
895 $out .= $this->generateInputFieldTextarea();
896 } elseif ($this->
type ==
'html') {
897 $out .= $this->generateInputFieldHtml();
898 } elseif ($this->
type ==
'color') {
899 $out .= $this->generateInputFieldColor();
900 } elseif ($this->
type ==
'yesno') {
901 if (!empty($conf->use_javascript_ajax)) {
902 $out .= ajax_constantonoff($this->confKey);
904 $out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1);
906 } elseif (preg_match(
'/emailtemplate:/', $this->
type)) {
907 $out .= $this->generateInputFieldEmailTemplate();
908 } elseif (preg_match(
'/category:/', $this->
type)) {
909 $out .= $this->generateInputFieldCategories();
910 } elseif (preg_match(
'/thirdparty_type/', $this->
type)) {
911 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
913 $out .= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey);
914 } elseif ($this->
type ==
'securekey') {
915 $out .= $this->generateInputFieldSecureKey();
916 } elseif ($this->
type ==
'product') {
917 if (isModEnabled(
"product") || isModEnabled(
"service")) {
918 $selected = (empty($this->fieldValue) ?
'' : $this->fieldValue);
919 $out .= $this->form->select_produits($selected, $this->confKey,
'', 0, 0, 1, 2,
'', 0, array(), 0,
'1', 0, $this->cssClass, 0,
'',
null, 1);
921 } elseif ($this->
type ==
'selectBankAccount') {
922 if (isModEnabled(
"bank")) {
923 $selected = (empty($this->fieldValue) ?
'' : $this->fieldValue);
924 $out .= $this->form->select_comptes($selected, $this->confKey, 0,
'', 0,
'', 0,
'', 1);
926 } elseif ($this->
type ==
'password') {
927 $out .= $this->generateInputFieldPassword(
'dolibarr');
928 } elseif ($this->
type ==
'genericpassword') {
929 $out .= $this->generateInputFieldPassword(
'generic');
931 $out .= $this->generateInputFieldText();
944 if (empty($this->fieldAttr) || empty($this->fieldAttr[
'class'])) {
945 $this->fieldAttr[
'class'] =
'flat '.(empty($this->cssClass) ?
'minwidth200' : $this->cssClass);
947 return '<input '.FormSetup::generateAttributesStringFromArray($this->fieldAttr).
' />';
957 $out =
'<textarea class="flat" name="'.$this->confKey.
'" id="'.$this->confKey.
'" cols="50" rows="5" wrap="soft">' .
"\n";
959 $out .=
"</textarea>\n";
971 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
972 $doleditor =
new DolEditor($this->confKey, $this->fieldValue,
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
973 return $doleditor->Create(1);
983 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
984 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
987 $tmp = explode(
':', $this->
type);
988 $out =
img_picto(
'',
'category',
'class="pictofixedwidth"');
990 $label =
'Categories';
991 if ($this->
type ==
'customer') {
992 $label =
'CustomersProspectsCategoriesShort';
994 $out .= $formother->select_categories($tmp[1], $this->fieldValue, $this->confKey, 0, $this->langs->trans($label));
1008 if (preg_match(
'/emailtemplate:/', $this->
type)) {
1009 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
1010 $formmail =
new FormMail($this->db);
1012 $tmp = explode(
':', $this->
type);
1013 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
1014 $arrayOfMessageName = array();
1015 if (is_array($formmail->lines_model)) {
1016 foreach ($formmail->lines_model as $modelMail) {
1018 if (!empty($arrayOfMessageName[$modelMail->label])) {
1019 $moreonlabel =
' <span class="opacitymedium">(' . $this->langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
1022 $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace(
'/\(|\)/',
'', $modelMail->label)) . $moreonlabel;
1025 $out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue,
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
1040 $out =
'<input type="text" class="flat minwidth150'.($this->cssClass ?
' '.$this->cssClass :
'').
'" id="'.$this->confKey.
'" name="'.$this->confKey.
'" value="'.(
GETPOST($this->confKey,
'alpha') ?
GETPOST($this->confKey,
'alpha') : $this->fieldValue).
'">';
1042 if (!empty($conf->use_javascript_ajax) && empty($this->fieldParams[
'hideGenerateButton'])) {
1043 $out .=
' '.img_picto($this->langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$this->confKey.
'" class="linkobject"');
1046 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1063 global $conf, $langs, $user;
1067 if ($type ==
'dolibarr') {
1069 if ($gen ==
'none') {
1072 $nomclass =
"modGeneratePass".ucfirst($gen);
1073 $nomfichier = $nomclass.
".class.php";
1074 require_once DOL_DOCUMENT_ROOT.
"/core/modules/security/generate/".$nomfichier;
1075 $genhandler =
new $nomclass($this->db, $conf, $langs, $user);
1076 $min = $genhandler->length;
1077 $max = $genhandler->length2;
1079 $out =
'<input required="required" type="password" class="flat" id="'.$this->confKey.
'" name="'.$this->confKey.
'" value="'.(
GETPOST($this->confKey,
'alpha') ?
GETPOST($this->confKey,
'alpha') : $this->fieldValue).
'"';
1081 $out .=
' minlength="' . $min .
'"';
1084 $out .=
' maxlength="' . $max .
'"';
1099 $TSelected = array();
1100 if ($this->fieldValue) {
1101 $TSelected = explode(
',', $this->fieldValue);
1104 return $this->form->multiselectarray($this->confKey, $this->fieldOptions, $TSelected, 0, 0,
'', 0, 0,
'style="min-width:100px"');
1117 $s .=
img_picto(
'', $this->picto,
'class="pictofixedwidth"');
1119 $s .= $this->form->selectarray($this->confKey, $this->fieldOptions, $this->fieldValue, 0, 0, 0,
'', 0, 0, 0,
'', $this->cssClass);
1129 return $this->form->select_dolusers($this->fieldValue, $this->confKey);
1155 $this->
type = $type;
1168 if (is_array($errors)) {
1169 if (!empty($errors)) {
1170 foreach ($errors as $error) {
1171 $this->setErrors($error);
1174 } elseif (!empty($errors)) {
1175 $this->errors[] = $errors;
1187 global $conf, $user, $langs;
1189 if (!empty($this->fieldOverride)) {
1190 return $this->fieldOverride;
1193 if (!empty($this->fieldOutputOverride)) {
1194 return $this->fieldOutputOverride;
1199 if ($this->
type ==
'title') {
1201 } elseif ($this->
type ==
'textarea') {
1203 } elseif ($this->
type ==
'multiselect') {
1204 $out .= $this->generateOutputFieldMultiSelect();
1205 } elseif ($this->
type ==
'select') {
1206 $out .= $this->generateOutputFieldSelect();
1207 } elseif ($this->
type ==
'selectUser') {
1208 $out .= $this->generateOutputFieldSelectUser();
1209 } elseif ($this->
type ==
'html') {
1210 $out .= $this->fieldValue;
1211 } elseif ($this->
type ==
'color') {
1212 $out .= $this->generateOutputFieldColor();
1213 } elseif ($this->
type ==
'yesno') {
1214 if (!empty($conf->use_javascript_ajax)) {
1215 $out .= ajax_constantonoff($this->confKey, array(), $this->entity);
1217 if ($this->fieldValue == 1) {
1218 $out .= $langs->trans(
'yes');
1220 $out .= $langs->trans(
'no');
1223 } elseif (preg_match(
'/emailtemplate:/', $this->
type)) {
1224 if ($this->fieldValue > 0) {
1225 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
1226 $formmail =
new FormMail($this->db);
1228 $tmp = explode(
':', $this->
type);
1230 $template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
1231 if (is_numeric($template) && $template < 0) {
1232 $this->setErrors($formmail->errors);
1234 $out .= $this->langs->trans($template->label);
1236 } elseif (preg_match(
'/category:/', $this->
type)) {
1237 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1239 $result = $c->fetch($this->fieldValue);
1241 $this->setErrors($c->errors);
1243 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
1245 foreach ($ways as $way) {
1246 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
1248 $out .=
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
1249 } elseif (preg_match(
'/thirdparty_type/', $this->
type)) {
1250 if ($this->fieldValue == 2) {
1251 $out .= $this->langs->trans(
"Prospect");
1252 } elseif ($this->fieldValue == 3) {
1253 $out .= $this->langs->trans(
"ProspectCustomer");
1254 } elseif ($this->fieldValue == 1) {
1255 $out .= $this->langs->trans(
"Customer");
1256 } elseif ($this->fieldValue == 0) {
1257 $out .= $this->langs->trans(
"NorProspectNorCustomer");
1259 } elseif ($this->
type ==
'product') {
1260 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
1262 $product =
new Product($this->db);
1263 $resprod = $product->fetch($this->fieldValue);
1265 $out .= $product->ref;
1266 } elseif ($resprod < 0) {
1267 $this->setErrors($product->errors);
1269 } elseif ($this->
type ==
'selectBankAccount') {
1270 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1272 $bankaccount =
new Account($this->db);
1273 $resbank = $bankaccount->fetch($this->fieldValue);
1275 $out .= $bankaccount->label;
1276 } elseif ($resbank < 0) {
1277 $this->setErrors($bankaccount->errors);
1279 } elseif ($this->
type ==
'password' || $this->
type ==
'genericpassword') {
1280 $out .= str_repeat(
'*', strlen($this->fieldValue));
1282 $out .= $this->fieldValue;
1297 $TSelected = array();
1298 if (!empty($this->fieldValue)) {
1299 $TSelected = explode(
',', $this->fieldValue);
1302 if (!empty($TSelected)) {
1303 foreach ($TSelected as $selected) {
1304 if (!empty($this->fieldOptions[$selected])) {
1305 $outPut .= dolGetBadge(
'', $this->fieldOptions[$selected],
'info').
' ';
1320 $this->fieldAttr[
'disabled'] =
null;
1323 return '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.
'" value="'.$color.
'">';
1325 return $langs->trans(
"Default");
1334 $this->fieldAttr[
'type'] =
'color';
1335 $default = $this->defaultFieldValue;
1336 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
1338 return $formother->selectColor(
colorArrayToHex(
colorStringToArray($this->fieldAttr[
'value'], array()),
''), $this->fieldAttr[
'name'],
'', 1, array(),
'',
'', $default).
' ';
1349 if (!empty($this->fieldOptions[$this->fieldValue])) {
1350 $outPut = $this->fieldOptions[$this->fieldValue];
1364 $user =
new User($this->db);
1365 $user->fetch($this->fieldValue);
1366 $outPut = $user->firstname .
" " . $user->lastname;
1381 $this->
type =
'string';
1392 $this->
type =
'color';
1403 $this->
type =
'textarea';
1414 $this->
type =
'html';
1426 $this->
type =
'emailtemplate:'.$templateType;
1437 $this->
type =
'thirdparty_type';
1448 $this->
type =
'yesno';
1459 $this->
type =
'securekey';
1470 $this->
type =
'product';
1483 $this->
type =
'category:'.$catType;
1494 $this->
type =
'title';
1507 if (is_array($fieldOptions)) {
1508 $this->fieldOptions = $fieldOptions;
1511 $this->
type =
'multiselect';
1523 if (is_array($fieldOptions)) {
1524 $this->fieldOptions = $fieldOptions;
1527 $this->
type =
'select';
1538 $this->
type =
'selectUser';
1549 $this->
type =
'selectBankAccount';
1561 $this->
type =
'password';
1573 $this->
type =
'genericpassword';
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Class to manage bank accounts.
Class to manage categories.
Class to manage a WYSIWYG editor.
Class to manage products or services.
Class to manage Dolibarr users.
colorArrayToHex($arraycolor, $colorifnotfound='888888')
Convert an array with RGB value into hex RGB value.
colorStringToArray($stringcolor, $colorifnotfound=array(88, 88, 88))
Convert a string RGB value ('FFFFFF', '255,255,255') into an array RGB array(255,255,...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Output javascript to autoset a generated password using default module into a HTML element.