| ';
+ $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
+ print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'';
+ print ' | ';
+
+ if ($val['type'] == 'textarea') {
+ print '\n";
+ } elseif ($val['type']== 'html') {
+ require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
+ $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
+ $doleditor->Create();
+ } elseif ($val['type'] == 'yesno') {
+ print $form->selectyesno($constname, $conf->global->{$constname}, 1);
+ } elseif (preg_match('/emailtemplate:/', $val['type'])) {
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
+ $formmail = new FormMail($db);
+
+ $tmp = explode(':', $val['type']);
+ $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang
+ //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
+ $arrayofmessagename = array();
+ if (is_array($formmail->lines_model)) {
+ foreach ($formmail->lines_model as $modelmail) {
+ //var_dump($modelmail);
+ $moreonlabel = '';
+ if (!empty($arrayofmessagename[$modelmail->label])) {
+ $moreonlabel = ' (' . $langs->trans("SeveralLangugeVariatFound") . ')';
+ }
+ // The 'label' is the key that is unique if we exclude the language
+ $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
+ }
+ }
+ print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
+ } elseif (preg_match('/category:/', $val['type'])) {
+ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+ $formother = new FormOther($db);
+
+ $tmp = explode(':', $val['type']);
+ print img_picto('', 'category', 'class="pictofixedwidth"');
+ print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
+ } else {
+ print '';
+ }
+ print ' |
';
+ }
}
print '