dolibarr 24.0.0-beta
admin_extrafields_edit.tpl.php
1<?php
2/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
43'@phan-var-force string $attrname';
44'@phan-var-force string $action';
45'@phan-var-force string $elementtype';
46'@phan-var-force string $textobject';
47'@phan-var-force string[] $type2label';
48
49// Protection to avoid direct call of template
50if (empty($conf) || !is_object($conf)) {
51 print "Error, template page can't be called as URL";
52 exit(1);
53}
54
55
56$langs->load("modulebuilder");
57$langs->load("admin");
58
59$listofexamplesforlink = 'Societe:societe/class/societe.class.php<br>Contact:contact/class/contact.class.php<br>Product:product/class/product.class.php<br>Project:projet/class/project.class.php<br>...';
60
61?>
62
63<!-- BEGIN PHP TEMPLATE admin_extrafields_edit.tpl.php -->
64<script>
65 jQuery(document).ready(function() {
66 function init_typeoffields(type)
67 {
68 console.log("admin_extrafields_edit select a new type (edit) = "+type);
69 var size = jQuery("#size");
70 var computed_value = jQuery("#computed_value");
71 var langfile = jQuery("#langfile");
72 var default_value = jQuery("#default_value");
73 var unique = jQuery("#unique");
74 var required = jQuery("#required");
75 var alwayseditable = jQuery("#alwayseditable");
76 var emptyonclone = jQuery("#emptyonclone");
77 var list = jQuery("#list");
78 var totalizable = jQuery("#totalizable");
79 <?php
80 if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) {
81 print 'jQuery("#value_choice").hide();';
82 }
83
84 if (in_array(GETPOST('type', 'alpha'), ["separate", 'point', 'linestrg', 'polygon'])) {
85 print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);";
86 print 'jQuery("#value_choice").hide();';
87 }
88 ?>
89
90 // Case of computed field
91 if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') {
92 jQuery("tr.extra_computed_value").show();
93 } else {
94 computed_value.val(''); jQuery("tr.extra_computed_value").hide();
95 }
96 if (computed_value.val())
97 {
98 console.log("We enter a computed formula");
99 jQuery("#default_value").val('');
100 /* jQuery("#unique, #required, #alwayseditable, #list").removeAttr('checked'); */
101 jQuery("#default_value, #unique, #required, #alwayseditable, #emptyonclone, #list").attr('disabled', true);
102 jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_emptyonclone, tr.extra_list").hide();
103 }
104 else
105 {
106 console.log("No computed formula");
107 jQuery("#default_value, #unique, #required, #alwayseditable, #emptyonclone, #list").attr('disabled', false);
108 jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_emptyonclone, tr.extra_list").show();
109 }
110
111 // Case of ai prompt
112 if (type == 'text' || type == 'varchar' || type == 'int' || type == 'double' || type == 'price' || type == 'html') {
113 jQuery("tr.extra_ai_prompt").show();
114 } else {
115 jQuery(ai_prompt).val(''); jQuery("tr.extra_ai_prompt").hide();
116 }
117
118 if (type == 'date') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
119 else if (type == 'datetime') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
120 else if (type == 'double') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
121 else if (type == 'int') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
122 else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
123 else if (type == 'html') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
124 else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
125 else if (type == 'password') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helppassword").show();}
126 else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
127 else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
128 else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
129 else if (type == 'select') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();}
130 else if (type == 'sellist') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpsellist").show();}
131 else if (type == 'radio') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();}
132 else if (type == 'checkbox') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpselect").show();}
133 else if (type == 'chkbxlst') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helpchkbxlst").show();}
134 else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();}
135 else if (type == 'stars') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
136 else if (type == 'separate') {
137 size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true);
138 jQuery("#value_choice").show();
139 jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show();
140 }
141 else { // type = string
142 size.val('').prop('disabled', true);
143 unique.removeAttr('disabled');
144 }
145
146 if (type == 'separate' || type == 'point' || type == 'linestrg' || type == 'polygon')
147 {
148 required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); emptyonclone.removeAttr('checked').prop('disabled', true); list.removeAttr('checked').prop('disabled', true);
149 jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);
150 jQuery('#list').val(3); // visible on create/update/view form only
151 }
152 else
153 {
154 default_value.removeAttr('disabled');
155 required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); emptyonclone.removeAttr('disabled'); list.removeAttr('disabled');
156 }
157 }
158 init_typeoffields(jQuery("#type").val());
159 jQuery("#type").change(function() {
160 init_typeoffields($(this).val());
161 });
162
163 // If we enter a formula, we disable other fields
164 jQuery("#computed_value").keyup(function() {
165 init_typeoffields(jQuery('#type').val());
166 });
167 });
168</script>
169
170<!-- Form to edit an extra field -->
171<form action="<?php echo $_SERVER["PHP_SELF"]; ?>?attrname=<?php echo $attrname; ?>" id="formeditextrafield" method="post">
172<input type="hidden" name="token" value="<?php echo newToken(); ?>">
173<input type="hidden" name="attrname" value="<?php echo $attrname; ?>">
174<input type="hidden" name="action" value="update">
175<input type="hidden" name="rowid" value="<?php echo(empty($rowid) ? '' : $rowid) ?>">
176<input type="hidden" name="enabled" value="<?php echo dol_escape_htmltag((string) $extrafields->attributes[$elementtype]['enabled'][$attrname]); ?>">
177
178<?php print dol_get_fiche_head(); ?>
179
180<table summary="listofattributes" class="border centpercent">
181
182<?php
183$label = $extrafields->attributes[$elementtype]['label'][$attrname];
184$type = $extrafields->attributes[$elementtype]['type'][$attrname];
185$size = $extrafields->attributes[$elementtype]['size'][$attrname];
186$computed = $extrafields->attributes[$elementtype]['computed'][$attrname];
187$aiprompt = $extrafields->attributes[$elementtype]['aiprompt'][$attrname];
188$default = $extrafields->attributes[$elementtype]['default'][$attrname];
189$unique = $extrafields->attributes[$elementtype]['unique'][$attrname];
190$required = $extrafields->attributes[$elementtype]['required'][$attrname];
191$pos = $extrafields->attributes[$elementtype]['pos'][$attrname];
192$alwayseditable = $extrafields->attributes[$elementtype]['alwayseditable'][$attrname];
193$emptyonclone = $extrafields->attributes[$elementtype]['emptyonclone'][$attrname];
194$param = $extrafields->attributes[$elementtype]['param'][$attrname];
195$perms = $extrafields->attributes[$elementtype]['perms'][$attrname];
196$langfile = $extrafields->attributes[$elementtype]['langfile'][$attrname];
197$list = $extrafields->attributes[$elementtype]['list'][$attrname];
198$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
199$help = $extrafields->attributes[$elementtype]['help'][$attrname];
200$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname];
201$printable = $extrafields->attributes[$elementtype]['printable'][$attrname];
202$showITooltip = $extrafields->attributes[$elementtype]['showintooltip'][$attrname];
203$enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname];
204$css = $extrafields->attributes[$elementtype]['css'][$attrname];
205$cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname];
206$csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname];
207$personal_data = $extrafields->attributes[$elementtype]['personal_data'][$attrname];
208
209$param_chain = '';
210if (is_array($param)) {
211 if (($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) {
212 foreach ($param['options'] as $key => $value) {
213 if (strlen($key)) {
214 $param_chain .= $key.','.$value."\n";
215 }
216 }
217 } elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password') || ($type == 'separate')) {
218 $paramlist = array_keys($param['options']);
219 $param_chain = $paramlist[0];
220 }
221}
222?>
223<!-- Label -->
224<tr><td class="titlefieldcreate fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo $label; ?>"></td></tr>
225
226<!-- Code -->
227<tr><td class="fieldrequired"><?php echo $form->textwithpicto($langs->trans("AttributeCode"), $langs->trans("AttributeCodeHelp")); ?></td><td class="valeur"><?php echo $attrname; ?></td></tr>
228
229<!-- Type -->
230<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
231<?php
232// Define list of possible type transition
233$typewecanchangeinto = array(
234 'varchar' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'),
235 'double' => array('double', 'price'),
236 'price' => array('double', 'price'),
237 'text' => array('text', 'html'),
238 'html' => array('text', 'html'),
239 'password' => array('password', 'varchar'),
240 'mail' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
241 'url' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
242 'phone' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
243 'ip' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
244 'select' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
245 'date' => array('date', 'datetime')
246);
247/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert
248if ($size <= 255 && in_array($type, array('text', 'html'))) {
249 $typewecanchangeinto['text'][] = 'varchar';
250}*/
251
252if (in_array($type, array_keys($typewecanchangeinto))) {
253 // Combo with list of fields
254 if (empty($formadmin)) {
255 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
256 $formadmin = new FormAdmin($db);
257 }
258 print $formadmin->selectTypeOfFields('type', GETPOST('type', 'alpha') ? GETPOST('type', 'alpha') : $type, $typewecanchangeinto);
259} else {
260 print getPictoForType($type);
261 print $type2label[$type];
262 print '<input type="hidden" name="type" id="type" value="'.$type.'">';
263}
264?>
265</td></tr>
266
267<!-- Size -->
268<tr class="extra_size"><td><?php echo $langs->trans("Size"); ?></td><td><input id="size" type="text" name="size" class="width50" value="<?php echo $size; ?>"></td></tr>
269
270<!-- Value (for some fields like password, select list, radio, ...) -->
271<tr id="value_choice">
272<td>
273 <?php echo $langs->trans("Value"); ?>
274</td>
275<td>
276 <table class="nobordernopadding">
277 <tr><td>
278 <textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>" spellcheck="false"><?php echo dol_htmlcleanlastbr($param_chain); ?></textarea>
279 </td><td>
280 <span id="helpselect" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 'info', '', 0, 2, 'helpvalue1')?></span>
281 <span id="helpsellist" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").'<br>'.$langs->trans("ExtrafieldParamHelpsellistb").'<br>'.$langs->trans("ExtrafieldParamHelpsellistc").'<br>'.$langs->trans("ExtrafieldParamHelpsellistd").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '<br>'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue2')?></span>
282 <span id="helpchkbxlst" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").'<br>'.$langs->trans("ExtrafieldParamHelpsellistb").'<br>'.$langs->trans("ExtrafieldParamHelpsellistc").'<br>'.$langs->trans("ExtrafieldParamHelpsellistd").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? '<br>'.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 'info', '', 0, 2, 'helpvalue3')?></span>
283 <span id="helplink" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'<br><br>'.$langs->trans("Examples").':<br>'.$listofexamplesforlink, 1, 'info', '', 0, 2, 'helpvalue4')?></span>
284 <span id="helppassword" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 'info', '', 0, 2, 'helpvalue5')?></span>
285 <span id="helpseparate" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 'info', '', 0, 2, 'helpvalue6')?></span>
286 </td></tr>
287 </table>
288</td>
289</tr>
290
291<!-- Position -->
292<tr><td class="titlefield"><?php echo $langs->trans("Position"); ?></td><td class="valeur"><input type="text" name="pos" class="width50" value="<?php echo dol_escape_htmltag((string) $pos); ?>"></td></tr>
293
294<!-- Language file -->
295<tr><td class="titlefield"><?php echo $langs->trans("LanguageFile"); ?></td><td class="valeur"><input type="text" name="langfile" class="minwidth200" value="<?php echo dol_escape_htmltag($langfile); ?>"></td></tr>
296
297<!-- Computed value -->
298<tr class="extra_computed_value">
299<?php
300global $dolibarr_main_restrict_eval_methods;
301if (!isset($dolibarr_main_restrict_eval_methods)) {
302 $showfunctions = 'getDolGlobalString, getDolGlobalInt, getDolCurrency, getDolEntity, getDolDBType, fetchNoCompute, hasRight, isAdmin, isExternalUser, isModEnabled, isStringVarMatching, abs, min, max, round, dol_now, preg_match';
303} else {
304 $showfunctions = $dolibarr_main_restrict_eval_methods ? $dolibarr_main_restrict_eval_methods : $langs->transnoentitiesnoconv("None");
305}
306if (!getDolGlobalString('MAIN_STORE_COMPUTED_EXTRAFIELDS')) {
307 ?>
308 <td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc", '$objectoffield', $showfunctions).'<br>'.$langs->trans("ComputedFormulaDesc2").'<br><br>'.$langs->trans("ComputedFormulaDesc3"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?></td>
309<?php } else {
310 ?>
311 <td><?php echo $form->textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc", '$objectoffield', $showfunctions).'<br>'.$langs->trans("ComputedFormulaDesc2").'<br><br>'.$langs->trans("ComputedFormulaDesc3")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?></td>
312<?php } ?>
313<td class="valeur"><textarea name="computed_value" id="computed_value" class="quatrevingtpercent" rows="<?php echo ROWS_4 ?>"><?php echo dol_htmlcleanlastbr($computed); ?></textarea></td>
314</tr>
315
316<!-- AI Prompt -->
317<tr class="extra_ai_prompt">
318 <td><?php
319 if ($elementtype == "projet") {
320 $elementtype = "project";
321 }
322 $elementprop = getElementProperties($elementtype);
323 $object = fetchObjectByElement(0, $elementtype);
324 if ($elementprop["module"] == "adherent") {
325 $elementprop["module"] = "member";
326 }
327 if ($elementprop["module"] == "projet") {
328 $elementprop["module"] = "project";
329 }
330 if ($elementprop["module"] == "contrat") {
331 $elementprop["module"] = "contract";
332 $object->element = "contract";
333 }
334 if ($elementprop["module"] == "ficheinter") {
335 $elementprop["module"] = "intervention";
336 }
337 $substitutionarray = getCommonSubstitutionArray($langs, 1, null, $object, array("object", $elementprop["module"]));
338 $texthelp = $langs->trans("AIPromptExtrafieldDesc").'<br><br>';
339 $texthelp .= $langs->trans("FollowingConstantsWillBeSubstituted").'<br><small>';
340 foreach ($substitutionarray as $key => $val) {
341 $texthelp .= $key.' -> '.$val.'<br>';
342 }
343 $texthelp .= '</small>';
344 echo $form->textwithpicto($langs->trans("AIPromptExtrafield"), $texthelp, 1, 'help', 'valignmiddle', 0, 3, 'abc');?></td>
345<td class="valeur"><textarea name="ai_prompt" id="ai_prompt" class="quatrevingtpercent" rows="<?php echo ROWS_4 ?>"><?php echo($aiprompt); ?></textarea></td></tr>
346
347<!-- Default Value (at sql setup level) -->
348<tr class="extra_default_value"><td><?php echo $langs->trans("DefaultValue").' <span class="opacitymedium small">('.$langs->trans("Database").')</span>'; ?></td><td class="valeur"><input id="default_value" type="text" name="default_value" class="minwidth200" value="<?php echo dol_escape_htmltag($default); ?>" spellcheck="false"></td></tr>
349
350<!-- Unique -->
351<tr class="extra_unique"><td><?php echo $langs->trans("Unique").' <span class="opacitymedium small">('.$langs->trans("Database").')</span>'; ?></td><td class="valeur"><input id="unique" type="checkbox" name="unique"<?php echo($unique ? ' checked' : ''); ?>></td></tr>
352
353<!-- Required -->
354<tr class="extra_required"><td><?php echo $langs->trans("Mandatory").' <span class="opacitymedium small">('.$langs->trans("Database").')</span>'; ?></td><td class="valeur"><input id="required" type="checkbox" name="required"<?php echo($required ? ' checked' : ''); ?>></td></tr>
355
356<!-- Always editable -->
357<tr class="extra_alwayseditable"><td><?php echo $form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?></td><td class="valeur"><input id="alwayseditable" type="checkbox" name="alwayseditable"<?php echo($alwayseditable ? ' checked' : ''); ?>></td></tr>
358
359<!-- Personal Data (RGPD/nLPD/LGPD) -->
360<tr class="extra_personal_data"><td><?php echo $form->textwithpicto($langs->trans("IsPersonalData"), $langs->trans("IsPersonalDataDesc")); ?></td><td class="valeur"><input id="personal_data" type="checkbox" name="personal_data" value="1"<?php echo($personal_data ? ' checked' : ''); ?>></td></tr>
361
362<!-- Empty on clone -->
363<tr class="extra_emptyonclone"><td><?php echo $form->textwithpicto($langs->trans("EmptyOnClone"), $langs->trans("EmptyOnCloneDesc")); ?></td><td class="valeur"><input id="emptyonclone" type="checkbox" name="emptyonclone"<?php echo($emptyonclone ? ' checked' : ''); ?>></td></tr>
364
365<!-- Permission to edit -->
366<tr class="extra_perms"><td><?php echo $form->textwithpicto($langs->trans("PermissionOnField"), $langs->trans("PermissionToEditField")); ?></td><td class="valeur"><input id="perms" class="minwidth200" type="text" name="perms" value="<?php echo $perms; ?>"></td></tr>
367
368<!-- Visibility -->
369<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
370</td><td class="valeur"><input id="list" class="minwidth200" type="text" name="list" value="<?php echo($list != '' ? $list : '1'); ?>"></td></tr>
371
372<!-- Visibility for PDF-->
373<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
374</td><td class="valeur"><input id="printable" class="width50" type="text" name="printable" value="<?php echo dol_escape_htmltag((string) $printable); ?>"></td></tr>
375
376<!-- Visibility for getNomUrl -->
377<tr><td class="extra_showintooltip"><?php echo $form->textwithpicto($langs->trans("DisplayExtraOnTooltip"), $langs->trans("DisplayExtraOnTooltipDesc")); ?>
378</td><td class="valeur"><input id="showintooltip" type="checkbox" name="showintooltip" value="1" <?php echo($showITooltip ? ' checked' : ''); ?> ></td></tr>
379
380<!-- Can be summed -->
381<tr class="extra_totalizable"><td><?php echo $form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?></td><td class="valeur"><input id="totalizable" type="checkbox" name="totalizable"<?php echo($totalizable ? ' checked' : ''); ?>></td></tr>
382
383<!-- Help tooltip -->
384<tr class="help"><td><?php echo $form->textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?></td><td class="valeur"><input id="help" class="quatrevingtpercent" type="text" name="help" value="<?php echo dol_escape_htmltag($help); ?>"></td></tr>
385
386<!-- Css edit -->
387<tr class="extra_css"><td><?php echo $form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?></td><td class="valeur"><input id="css" type="text" class="minwidth200" name="css" value="<?php echo $css ?>"></td></tr>
388
389<!-- Css view -->
390<tr class="extra_cssview"><td><?php echo $form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?></td><td class="valeur"><input id="cssview" class="minwidth200" type="text" name="cssview" value="<?php echo $cssview; ?>"></td></tr>
391
392<!-- Css list -->
393<tr class="extra_csslist"><td><?php echo $form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?></td><td class="valeur"><input id="csslist" class="minwidth200" type="text" name="csslist" value="<?php echo $csslist; ?>"></td></tr>
394
395<?php if (isModEnabled('multicompany')) { ?>
396 <!-- Multicompany entity -->
397 <tr><td><?php echo $langs->trans("AllEntities"); ?></td><td class="valeur"><input id="entitycurrentorall" type="checkbox" name="entitycurrentorall"<?php echo(empty($entitycurrentorall) ? ' checked' : ''); ?>></td></tr>
398<?php } ?>
399
400<!-- Show Enabled property when value is not a common value -->
401<?php if ($enabled != '1') { ?>
402 <tr class="help"><td><?php echo $form->textwithpicto($langs->trans("EnabledCondition"), $langs->trans("EnabledConditionHelp")); ?></td><td class="valeur">
403 <?php echo dol_escape_htmltag((string) $enabled); ?>
404<?php } ?>
405</td></tr>
406
407</table>
408
409<?php print dol_get_fiche_end(); ?>
410
411<div class="center"><input type="submit" name="button" class="button button-save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
412<input type="submit" name="button" class="button button-cancel" value="<?php echo $langs->trans("Cancel"); ?>"></div>
413
414</form>
415
416<!-- END PHP TEMPLATE admin_extrafields_edit.tpl.php -->
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
Class to generate html code for admin pages.
Class to manage generation of HTML components Only common components must be here.
Class for Position.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getPictoForType($key, $morecss='')
Return the picto for a data type.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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...
treeview li table
No Email.
if(preg_match('/(crypted|dolcrypt):/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition repair.php:130
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133