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;
274 if (empty($this->items)) {
280 foreach ($this->items as $item) {
281 if ($item->getType() ==
'yesno' && !empty(
$conf->use_javascript_ajax)) {
285 $res = $item->setValueFromPost();
287 $item->saveConfValue();
288 } elseif ($res < 0) {
296 if (empty($noMessageInUpdate)) {
301 $this->db->rollback();
302 if (empty($noMessageInUpdate)) {
319 if ($item->enabled == 1) {
320 $trClass =
'oddeven';
321 if ($item->getType() ==
'title') {
322 $trClass =
'liste_titre';
324 if (!empty($item->fieldParams[
'trClass'])) {
325 $trClass .=
' '.$item->fieldParams[
'trClass'];
328 $this->setupNotEmpty++;
329 $out .=
'<tr class="'.$trClass.
'">';
331 $out .=
'<td class="col-setup-title">';
332 $out .=
'<span id="helplink'.$item->confKey.
'" class="spanforparamtooltip">';
333 $out .= $this->form->textwithpicto($item->getNameText(), $item->getHelpText(), 1,
'info',
'', 0, 3,
'tootips'.$item->confKey);
340 $out .= $item->generateInputField();
342 $out .= $item->generateOutputField();
345 if (!empty($item->errors)) {
366 if (!is_array($params) || empty($params)) {
369 foreach ($params as $confKey => $param) {
386 if (empty($confKey) || empty($params[
'type'])) {
405 $item->setTypeFromTypeString($params['type']);
407 if (!empty($params[
'enabled']) && is_numeric($params[
'enabled'])) {
408 $item->enabled = (int) $params[
'enabled'];
411 if (!empty($params[
'css'])) {
412 $item->cssClass = (string) $params[
'css'];
415 $this->items[$item->confKey] = $item;
428 $arrayofparameters = array();
429 foreach ($this->items as $item) {
430 $arrayofparameters[$item->confKey] = array(
431 'type' => $item->getType(),
432 'enabled' => $item->enabled
436 return $arrayofparameters;
447 if (!array($this->items)) {
450 foreach ($this->items as $item) {
451 $item->loadValueFromConf();
467 public function newItem($confKey, $targetItemKey =
'', $insertAfterTarget =
false)
471 $item->entity = $this->entity;
474 if (empty($item->rank)) {
480 if (!empty($targetItemKey)) {
481 if (isset($this->items[$targetItemKey])) {
482 $targetItem = $this->items[$targetItemKey];
483 $item->rank = $targetItem->rank;
484 if ($targetItem->rank >= 0 && $insertAfterTarget) {
490 foreach ($this->items as $fItem) {
491 if ($item->rank <= $fItem->rank) {
498 $this->items[$item->confKey] = $item;
499 return $this->items[$item->confKey];
510 return uasort($this->items, array($this,
'itemSort'));
521 if (empty($this->items)) {
525 if ($cache && $this->maxItemRank > 0) {
526 return $this->maxItemRank;
529 $this->maxItemRank = 0;
530 foreach ($this->items as $item) {
531 $this->maxItemRank = max($this->maxItemRank, $item->rank);
534 return $this->maxItemRank;
546 $this->maxItemRank = max($this->maxItemRank, $rank);
558 if (!isset($this->items[$itemKey]->rank)) {
561 return $this->items[$itemKey]->rank;
574 if (empty($a->rank)) {
577 if (empty($b->rank)) {
580 if ($a->rank == $b->rank) {
583 return ($a->rank < $b->rank) ? -1 : 1;
612 public $nameText =
false;
615 public $helpText =
'';
624 public $defaultFieldValue =
null;
627 public $fieldAttr = array();
630 public $fieldOverride =
false;
633 public $fieldInputOverride =
false;
636 public $fieldOutputOverride =
false;
642 public $fieldOptions = array();
645 public $fieldParams = array();
656 public $errors = array();
664 protected $type =
'string';
673 public $cssClass =
'';
683 global $langs, $db,
$conf, $form;
686 if (!empty($form) && is_object($form) && get_class($form) ==
'Form') {
689 $this->form =
new Form($this->db);
692 $this->langs = $langs;
693 $this->entity = (is_null($this->entity) ?
$conf->entity : ((int) $this->entity));
695 $this->confKey = $confKey;
707 if (isset(
$conf->global->{$this->confKey})) {
711 $this->fieldValue =
null;
724 return $this->loadValueFromConf();
737 $parameters = array();
738 $reshook = $hookmanager->executeHooks(
'formSetupBeforeSaveConfValue', $parameters, $this);
740 $this->setErrors($hookmanager->errors);
749 if (!empty($this->saveCallBack) && is_callable($this->saveCallBack)) {
750 return call_user_func($this->saveCallBack, $this);
754 if ($this->
type !=
'title') {
755 $result =
dolibarr_set_const($this->db, $this->confKey, $this->fieldValue,
'chaine', 0,
'', $this->entity);
774 $this->saveCallBack = $callBack;
785 $this->setValueFromPostCallBack = $callBack;
795 if (!empty($this->setValueFromPostCallBack) && is_callable($this->setValueFromPostCallBack)) {
796 return call_user_func($this->setValueFromPostCallBack);
800 if ($this->
type !=
'title') {
801 if (preg_match(
'/category:/', $this->
type)) {
807 } elseif ($this->
type ==
'multiselect') {
808 $val =
GETPOST($this->confKey,
'array');
809 if ($val && is_array($val)) {
810 $val_const = implode(
',', $val);
814 } elseif ($this->
type ==
'html') {
815 $val_const =
GETPOST($this->confKey,
'restricthtml');
817 $val_const =
GETPOST($this->confKey,
'alpha');
821 $this->fieldValue = $val_const;
836 if (!empty($this->helpText)) {
837 return $this->helpText;
839 return (($this->langs->trans($this->confKey .
'Tooltip') != $this->confKey .
'Tooltip') ? $this->langs->trans($this->confKey .
'Tooltip') :
'');
849 if (!empty($this->nameText)) {
850 return $this->nameText;
852 $out = (($this->langs->trans($this->confKey) != $this->confKey) ? $this->langs->trans($this->confKey) : $this->langs->trans(
'MissingTranslationForConfKey', $this->confKey));
855 if (isModEnabled(
'multicompany') && $this->entity == 0) {
856 $out =
img_picto($this->langs->trans(
'AllEntities'),
'fa-globe-americas em088 opacityhigh') .
' ' . $out;
871 if (!empty($this->fieldOverride)) {
872 return $this->fieldOverride;
875 if (!empty($this->fieldInputOverride)) {
876 return $this->fieldInputOverride;
880 if (is_null($this->fieldValue)) {
881 $this->fieldValue = $this->defaultFieldValue;
885 $this->fieldAttr[
'name'] = $this->confKey;
886 $this->fieldAttr[
'id'] =
'setup-'.$this->confKey;
887 $this->fieldAttr[
'value'] = $this->fieldValue;
891 if ($this->
type ==
'title') {
892 $out .= $this->generateOutputField();
893 } elseif ($this->
type ==
'multiselect') {
894 $out .= $this->generateInputFieldMultiSelect();
895 } elseif ($this->
type ==
'select') {
896 $out .= $this->generateInputFieldSelect();
897 } elseif ($this->
type ==
'selectUser') {
898 $out .= $this->generateInputFieldSelectUser();
899 } elseif ($this->
type ==
'textarea') {
900 $out .= $this->generateInputFieldTextarea();
901 } elseif ($this->
type ==
'html') {
902 $out .= $this->generateInputFieldHtml();
903 } elseif ($this->
type ==
'color') {
904 $out .= $this->generateInputFieldColor();
905 } elseif ($this->
type ==
'yesno') {
906 if (!empty(
$conf->use_javascript_ajax)) {
907 $input = $this->fieldParams[
'input'] ?? array();
908 $revertonoff = !empty($this->fieldParams[
'revertonoff']) ? 1 : 0;
909 $forcereload = !empty($this->fieldParams[
'forcereload']) ? 1 : 0;
911 $out .= ajax_constantonoff($this->confKey, $input, $this->entity, $revertonoff, 0, $forcereload, 2, 0, 0,
'',
'', $this->cssClass);
913 $out .= $this->form->selectyesno($this->confKey, $this->fieldValue, 1,
false, 0, 0, $this->cssClass);
915 } elseif (preg_match(
'/emailtemplate:/', $this->
type)) {
916 $out .= $this->generateInputFieldEmailTemplate();
917 } elseif (preg_match(
'/category:/', $this->
type)) {
918 $out .= $this->generateInputFieldCategories();
919 } elseif (preg_match(
'/thirdparty_type/', $this->
type)) {
920 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
922 $out .= $formcompany->selectProspectCustomerType($this->fieldValue, $this->confKey);
923 } elseif ($this->
type ==
'securekey') {
924 $out .= $this->generateInputFieldSecureKey();
925 } elseif ($this->
type ==
'product') {
926 if (isModEnabled(
"product") || isModEnabled(
"service")) {
927 $selected = (empty($this->fieldValue) ?
'' : $this->fieldValue);
928 $out .= $this->form->select_produits($selected, $this->confKey,
'', 0, 0, 1, 2,
'', 0, array(), 0,
'1', 0, $this->cssClass, 0,
'',
null, 1);
930 } elseif ($this->
type ==
'selectBankAccount') {
931 if (isModEnabled(
"bank")) {
932 $selected = (empty($this->fieldValue) ?
'' : $this->fieldValue);
933 $out .= $this->form->select_comptes($selected, $this->confKey, 0,
'', 0,
'', 0,
'', 1);
935 } elseif ($this->
type ==
'password') {
936 $out .= $this->generateInputFieldPassword(
'dolibarr');
937 } elseif ($this->
type ==
'genericpassword') {
938 $out .= $this->generateInputFieldPassword(
'generic');
940 $out .= $this->generateInputFieldText();
953 if (empty($this->fieldAttr) || empty($this->fieldAttr[
'class'])) {
954 $this->fieldAttr[
'class'] =
'flat '.(empty($this->cssClass) ?
'minwidth200' : $this->cssClass);
956 return '<input '.FormSetup::generateAttributesStringFromArray($this->fieldAttr).
' />';
966 $out =
'<textarea class="flat" name="'.$this->confKey.
'" id="'.$this->confKey.
'" cols="50" rows="5" wrap="soft">' .
"\n";
968 $out .=
"</textarea>\n";
980 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
981 $doleditor =
new DolEditor($this->confKey, $this->fieldValue,
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
982 return $doleditor->Create(1);
992 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
993 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
996 $tmp = explode(
':', $this->
type);
997 $out =
img_picto(
'',
'category',
'class="pictofixedwidth"');
999 $label =
'Categories';
1000 if ($this->
type ==
'customer') {
1001 $label =
'CustomersProspectsCategoriesShort';
1003 $out .= $formother->select_categories($tmp[1], $this->fieldValue, $this->confKey, 0, $this->langs->trans($label));
1017 if (preg_match(
'/emailtemplate:/', $this->
type)) {
1018 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
1019 $formmail =
new FormMail($this->db);
1021 $tmp = explode(
':', $this->
type);
1022 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
1023 $arrayOfMessageName = array();
1024 if (is_array($formmail->lines_model)) {
1025 foreach ($formmail->lines_model as $modelMail) {
1027 if (!empty($arrayOfMessageName[$modelMail->label])) {
1028 $moreonlabel =
' <span class="opacitymedium">(' . $this->langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
1031 $arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace(
'/\(|\)/',
'', $modelMail->label)) . $moreonlabel;
1034 $out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue,
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
1049 $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).
'">';
1051 if (!empty(
$conf->use_javascript_ajax) && empty($this->fieldParams[
'hideGenerateButton'])) {
1052 $out .=
' '.img_picto($this->langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$this->confKey.
'" class="linkobject"');
1055 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
1072 global
$conf, $langs, $user;
1076 if ($type ==
'dolibarr') {
1078 if ($gen ==
'none') {
1081 $nomclass =
"modGeneratePass".ucfirst($gen);
1082 $nomfichier = $nomclass.
".class.php";
1083 require_once DOL_DOCUMENT_ROOT.
"/core/modules/security/generate/".$nomfichier;
1084 $genhandler =
new $nomclass($this->db,
$conf, $langs, $user);
1085 $min = $genhandler->length;
1086 $max = $genhandler->length2;
1088 $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).
'"';
1090 $out .=
' minlength="' . $min .
'"';
1093 $out .=
' maxlength="' . $max .
'"';
1108 $TSelected = array();
1109 if ($this->fieldValue) {
1110 $TSelected = explode(
',', $this->fieldValue);
1113 return $this->form->multiselectarray($this->confKey, $this->fieldOptions, $TSelected, 0, 0,
'', 0, 0,
'style="min-width:100px"');
1126 $s .=
img_picto(
'', $this->picto,
'class="pictofixedwidth"');
1129 $s .= $this->form->selectarray($this->confKey, $this->fieldOptions, $this->fieldValue, 0, 0, 0,
'', 0, 0, 0,
'', $this->cssClass);
1139 return $this->form->select_dolusers($this->fieldValue, $this->confKey);
1165 $this->
type = $type;
1178 if (is_array($errors)) {
1179 if (!empty($errors)) {
1180 foreach ($errors as $error) {
1181 $this->setErrors($error);
1184 } elseif (!empty($errors)) {
1185 $this->errors[] = $errors;
1197 global
$conf, $user, $langs;
1199 if (!empty($this->fieldOverride)) {
1200 return $this->fieldOverride;
1203 if (!empty($this->fieldOutputOverride)) {
1204 return $this->fieldOutputOverride;
1209 if ($this->
type ==
'title') {
1211 } elseif ($this->
type ==
'textarea') {
1213 } elseif ($this->
type ==
'multiselect') {
1214 $out .= $this->generateOutputFieldMultiSelect();
1215 } elseif ($this->
type ==
'select') {
1216 $out .= $this->generateOutputFieldSelect();
1217 } elseif ($this->
type ==
'selectUser') {
1218 $out .= $this->generateOutputFieldSelectUser();
1219 } elseif ($this->
type ==
'html') {
1220 $out .= $this->fieldValue;
1221 } elseif ($this->
type ==
'color') {
1222 $out .= $this->generateOutputFieldColor();
1223 } elseif ($this->
type ==
'yesno') {
1224 if (!empty(
$conf->use_javascript_ajax)) {
1225 $revertonoff = empty($this->fieldParams[
'revertonoff']) ? 0 : 1;
1226 $forcereload = empty($this->fieldParams[
'forcereload']) ? 0 : 1;
1228 $out .= ajax_constantonoff($this->confKey, array(), $this->entity, $revertonoff, 0, $forcereload, 2, 0, 0,
'',
'', $this->cssClass);
1230 if ($this->fieldValue == 1) {
1231 $out .= $langs->trans(
'yes');
1233 $out .= $langs->trans(
'no');
1236 } elseif (preg_match(
'/emailtemplate:/', $this->
type)) {
1237 if ($this->fieldValue > 0) {
1238 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
1239 $formmail =
new FormMail($this->db);
1241 $tmp = explode(
':', $this->
type);
1243 $template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
1244 if (is_numeric($template) && $template < 0) {
1245 $this->setErrors($formmail->errors);
1247 $out .= $this->langs->trans($template->label);
1249 } elseif (preg_match(
'/category:/', $this->
type)) {
1250 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1252 $result =
$c->fetch($this->fieldValue);
1254 $this->setErrors(
$c->errors);
1256 $ways =
$c->print_all_ways(
' >> ',
'none', 0, 1);
1258 foreach ($ways as $way) {
1259 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . (
$c->color ?
' style="background: #' .
$c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
1261 $out .=
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
1262 } elseif (preg_match(
'/thirdparty_type/', $this->
type)) {
1263 if ($this->fieldValue == 2) {
1264 $out .= $this->langs->trans(
"Prospect");
1265 } elseif ($this->fieldValue == 3) {
1266 $out .= $this->langs->trans(
"ProspectCustomer");
1267 } elseif ($this->fieldValue == 1) {
1268 $out .= $this->langs->trans(
"Customer");
1269 } elseif ($this->fieldValue == 0) {
1270 $out .= $this->langs->trans(
"NorProspectNorCustomer");
1272 } elseif ($this->
type ==
'product') {
1273 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
1275 $product =
new Product($this->db);
1276 $resprod = $product->fetch($this->fieldValue);
1278 $out .= $product->ref;
1279 } elseif ($resprod < 0) {
1280 $this->setErrors($product->errors);
1282 } elseif ($this->
type ==
'selectBankAccount') {
1283 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
1285 $bankaccount =
new Account($this->db);
1286 $resbank = $bankaccount->fetch($this->fieldValue);
1288 $out .= $bankaccount->label;
1289 } elseif ($resbank < 0) {
1290 $this->setErrors($bankaccount->errors);
1292 } elseif ($this->
type ==
'password' || $this->
type ==
'genericpassword') {
1293 $out .= str_repeat(
'*', strlen($this->fieldValue));
1295 $out .= $this->fieldValue;
1310 $TSelected = array();
1311 if (!empty($this->fieldValue)) {
1312 $TSelected = explode(
',', $this->fieldValue);
1315 if (!empty($TSelected)) {
1316 foreach ($TSelected as $selected) {
1317 if (!empty($this->fieldOptions[$selected])) {
1318 $outPut .=
dolGetBadge(
'', $this->fieldOptions[$selected],
'info').
' ';
1334 $this->fieldAttr[
'disabled'] =
null;
1336 $useDefaultColor =
false;
1337 if (!$color && !empty($this->defaultFieldValue)) {
1338 $color = $this->defaultFieldValue;
1339 $useDefaultColor =
true;
1342 $out.=
'<input type="color" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; " value="#'.$color.
'">';
1345 if ($useDefaultColor) {
1346 $out.=
' '.$langs->trans(
"Default");
1360 $this->fieldAttr[
'type'] =
'color';
1361 $default = $this->defaultFieldValue;
1362 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
1364 return $formother->selectColor(
colorArrayToHex(
colorStringToArray($this->fieldAttr[
'value'], array()),
''), $this->fieldAttr[
'name'],
'', 1, array(),
'',
'', $default).
' ';
1375 if (!empty($this->fieldOptions[$this->fieldValue])) {
1376 $outPut = $this->fieldOptions[$this->fieldValue];
1390 $user =
new User($this->db);
1391 $user->fetch($this->fieldValue);
1392 $outPut = $user->firstname .
" " . $user->lastname;
1407 $this->
type =
'string';
1418 $this->
type =
'color';
1429 $this->
type =
'textarea';
1440 $this->
type =
'html';
1452 $this->
type =
'emailtemplate:'.$templateType;
1463 $this->
type =
'thirdparty_type';
1474 $this->
type =
'yesno';
1485 $this->
type =
'securekey';
1496 $this->
type =
'product';
1509 $this->
type =
'category:'.$catType;
1520 $this->
type =
'title';
1533 if (is_array($fieldOptions)) {
1534 $this->fieldOptions = $fieldOptions;
1537 $this->
type =
'multiselect';
1549 if (is_array($fieldOptions)) {
1550 $this->fieldOptions = $fieldOptions;
1553 $this->
type =
'select';
1564 $this->
type =
'selectUser';
1575 $this->
type =
'selectBankAccount';
1587 $this->
type =
'password';
1599 $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,...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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.
dolGetBadge($label, $html='', $type='primary', $mode='', $url='', $params=array())
Function dolGetBadge.
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.
getDolGlobalString($key, $default='')
Return a 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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.