dolibarr 25.0.0-alpha
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-2026 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
44'
45@phan-var-force string $attrname
46@phan-var-force string $action
47@phan-var-force string $elementtype
48@phan-var-force ?string $pagekey
49@phan-var-force string $textobject
50@phan-var-force string[] $type2label
51';
52
53// Protection to avoid direct call of template
54if (empty($conf) || !is_object($conf)) {
55 print "Error, template page can't be called as URL";
56 exit(1);
57}
58
59// Prefer $pagekey (the whitelisted request key) for self-referencing links; fall back to
60// $elementtype for older-style callers of this shared template that don't define $pagekey.
61$pagekeyforurl = isset($pagekey) ? $pagekey : $elementtype;
62
63$langs->load("modulebuilder");
64$langs->load("admin");
65
66$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>...';
67
68?>
69
70<!-- BEGIN PHP TEMPLATE admin_extrafields_edit.tpl.php -->
71<script>
72 jQuery(document).ready(function() {
73 function init_typeoffields(type)
74 {
75 console.log("admin_extrafields_edit select a new type (edit) = "+type);
76 var size = jQuery("#size");
77 var computed_value = jQuery("#computed_value");
78 var langfile = jQuery("#langfile");
79 var default_value = jQuery("#default_value");
80 var unique = jQuery("#unique");
81 var required = jQuery("#required");
82 var alwayseditable = jQuery("#alwayseditable");
83 var emptyonclone = jQuery("#emptyonclone");
84 var list = jQuery("#list");
85 var totalizable = jQuery("#totalizable");
86 <?php
87 if ((GETPOST('type', 'alpha') != "select") && (GETPOST('type', 'alpha') != "sellist")) {
88 print 'jQuery("#value_choice").hide();';
89 }
90
91 if (in_array(GETPOST('type', 'alpha'), ["separate", 'point', 'linestrg', 'polygon'])) {
92 print "jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);";
93 print 'jQuery("#value_choice").hide();';
94 }
95 ?>
96
97 // Case of computed field
98 if (type == 'varchar' || type == 'int' || type == 'double' || type == 'price') {
99 jQuery("tr.extra_computed_value").show();
100 } else {
101 computed_value.val(''); jQuery("tr.extra_computed_value").hide();
102 }
103 if (computed_value.val())
104 {
105 console.log("We enter a computed formula");
106 jQuery("#default_value").val('');
107 /* jQuery("#unique, #required, #alwayseditable, #list").removeAttr('checked'); */
108 jQuery("#default_value, #unique, #required, #alwayseditable, #emptyonclone, #list").attr('disabled', true);
109 jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_emptyonclone, tr.extra_list").hide();
110 }
111 else
112 {
113 console.log("No computed formula");
114 jQuery("#default_value, #unique, #required, #alwayseditable, #emptyonclone, #list").attr('disabled', false);
115 jQuery("tr.extra_default_value, tr.extra_unique, tr.extra_required, tr.extra_alwayseditable, tr.extra_emptyonclone, tr.extra_list").show();
116 }
117
118 // Case of ai prompt
119 if (type == 'text' || type == 'varchar' || type == 'int' || type == 'double' || type == 'price' || type == 'html') {
120 jQuery("tr.extra_ai_prompt").show();
121 } else {
122 jQuery(ai_prompt).val(''); jQuery("tr.extra_ai_prompt").hide();
123 }
124
125 if (type == 'date') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
126 else if (type == 'datetime') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
127 else if (type == 'double') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
128 else if (type == 'int') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
129 else if (type == 'text') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
130 else if (type == 'html') { size.removeAttr('disabled'); unique.prop('disabled', true).removeAttr('checked'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
131 else if (type == 'varchar') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide();jQuery("#helpchkbxlst").hide(); }
132 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();}
133 else if (type == 'boolean') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
134 else if (type == 'price') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
135 else if (type == 'pricecy') { size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
136 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();}
137 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();}
138 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();}
139 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();}
140 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();}
141 else if (type == 'link') { size.val('').prop('disabled', true); unique.removeAttr('disabled'); jQuery("#value_choice").show(); jQuery(".spanforparamtooltip").hide(); jQuery("#helplink").show();}
142 else if (type == 'stars') { size.removeAttr('disabled'); unique.removeAttr('disabled'); jQuery("#value_choice").hide(); jQuery("#helpchkbxlst").hide();}
143 else if (type == 'separate') {
144 size.val('').prop('disabled', true); unique.removeAttr('checked').prop('disabled', true); required.val('').prop('disabled', true); default_value.val('').prop('disabled', true);
145 jQuery("#value_choice").show();
146 jQuery(".spanforparamtooltip").hide(); jQuery("#helpseparate").show();
147 }
148 else { // type = string
149 size.val('').prop('disabled', true);
150 unique.removeAttr('disabled');
151 }
152
153 if (type == 'separate' || type == 'point' || type == 'linestrg' || type == 'polygon')
154 {
155 required.removeAttr('checked').prop('disabled', true); alwayseditable.removeAttr('checked').prop('disabled', true); emptyonclone.removeAttr('checked').prop('disabled', true); list.removeAttr('checked').prop('disabled', true);
156 jQuery('#size, #default_value, #langfile').val('').prop('disabled', true);
157 jQuery('#list').val(3); // visible on create/update/view form only
158 }
159 else
160 {
161 default_value.removeAttr('disabled');
162 required.removeAttr('disabled'); alwayseditable.removeAttr('disabled'); emptyonclone.removeAttr('disabled'); list.removeAttr('disabled');
163 }
164 }
165 init_typeoffields(jQuery("#type").val());
166 jQuery("#type").change(function() {
167 init_typeoffields($(this).val());
168 });
169
170 // If we enter a formula, we disable other fields
171 jQuery("#computed_value").keyup(function() {
172 init_typeoffields(jQuery('#type').val());
173 });
174 });
175</script>
176
177<!-- Form to edit an extra field -->
178<form action="<?php echo $_SERVER["PHP_SELF"]; ?>?attrname=<?php echo $attrname; ?>&elementtype=<?php echo urlencode($pagekeyforurl); ?>" id="formeditextrafield" method="post">
179<input type="hidden" name="token" value="<?php echo newToken(); ?>">
180<input type="hidden" name="attrname" value="<?php echo dol_escape_htmltag($attrname); ?>">
181<input type="hidden" name="action" value="update">
182<input type="hidden" name="elementtype" value="<?php echo dol_escape_htmltag($pagekeyforurl); ?>">
183<input type="hidden" name="rowid" value="<?php echo(empty($rowid) ? '' : $rowid) ?>">
184<input type="hidden" name="enabled" value="<?php echo dol_escape_htmltag((string) $extrafields->attributes[$elementtype]['enabled'][$attrname]); ?>">
185
186<?php print dol_get_fiche_head(); ?>
187
188<table summary="listofattributes" class="border centpercent">
189
190<?php
191$label = $extrafields->attributes[$elementtype]['label'][$attrname];
192$type = $extrafields->attributes[$elementtype]['type'][$attrname];
193$size = $extrafields->attributes[$elementtype]['size'][$attrname];
194$computed = $extrafields->attributes[$elementtype]['computed'][$attrname];
195$aiprompt = $extrafields->attributes[$elementtype]['aiprompt'][$attrname];
196$default = $extrafields->attributes[$elementtype]['default'][$attrname];
197$unique = $extrafields->attributes[$elementtype]['unique'][$attrname];
198$required = $extrafields->attributes[$elementtype]['required'][$attrname];
199$pos = $extrafields->attributes[$elementtype]['pos'][$attrname];
200$alwayseditable = $extrafields->attributes[$elementtype]['alwayseditable'][$attrname];
201$emptyonclone = $extrafields->attributes[$elementtype]['emptyonclone'][$attrname];
202$param = $extrafields->attributes[$elementtype]['param'][$attrname];
203$perms = $extrafields->attributes[$elementtype]['perms'][$attrname];
204$langfile = $extrafields->attributes[$elementtype]['langfile'][$attrname];
205$list = $extrafields->attributes[$elementtype]['list'][$attrname];
206$totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname];
207$help = $extrafields->attributes[$elementtype]['help'][$attrname];
208$entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname];
209$printable = $extrafields->attributes[$elementtype]['printable'][$attrname];
210$showITooltip = $extrafields->attributes[$elementtype]['showintooltip'][$attrname];
211$enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname];
212$css = $extrafields->attributes[$elementtype]['css'][$attrname];
213$cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname];
214$csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname];
215$personal_data = $extrafields->attributes[$elementtype]['personal_data'][$attrname];
216
217$param_chain = '';
218if (is_array($param)) {
219 if (($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) {
220 foreach ($param['options'] as $key => $value) {
221 if (strlen($key)) {
222 $param_chain .= $key.','.$value."\n";
223 }
224 }
225 } elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password') || ($type == 'separate')) {
226 $paramlist = array_keys($param['options']);
227 $param_chain = $paramlist[0];
228 }
229}
230?>
231<!-- Label -->
232<tr><td class="titlefieldcreate fieldrequired"><?php echo $langs->trans("LabelOrTranslationKey"); ?></td><td class="valeur"><input type="text" name="label" size="40" value="<?php echo dol_escape_htmltag($label); ?>"></td></tr>
233
234<!-- Code -->
235<tr><td class="fieldrequired"><?php echo $form->textwithpicto($langs->trans("AttributeCode"), $langs->trans("AttributeCodeHelp")); ?></td><td class="valeur"><?php echo $attrname; ?></td></tr>
236
237<!-- Type -->
238<tr><td class="fieldrequired"><?php echo $langs->trans("Type"); ?></td><td class="valeur">
239<?php
240// Define list of possible type transition
241$typewecanchangeinto = array(
242 'varchar' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'),
243 'double' => array('double', 'price'),
244 'price' => array('double', 'price'),
245 'text' => array('text', 'html'),
246 'html' => array('text', 'html'),
247 'password' => array('password', 'varchar'),
248 'mail' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
249 'url' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
250 'phone' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
251 'ip' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
252 'select' => array('varchar', 'phone', 'mail', 'url', 'ip', 'select'),
253 'date' => array('date', 'datetime')
254);
255/* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert
256if ($size <= 255 && in_array($type, array('text', 'html'))) {
257 $typewecanchangeinto['text'][] = 'varchar';
258}*/
259
260if (in_array($type, array_keys($typewecanchangeinto))) {
261 // Combo with list of fields
262 if (empty($formadmin)) {
263 include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
264 $formadmin = new FormAdmin($db);
265 }
266 print $formadmin->selectTypeOfFields('type', GETPOST('type', 'alpha') ? GETPOST('type', 'alpha') : $type, $typewecanchangeinto);
267} else {
268 print getPictoForType($type);
269 print $type2label[$type];
270 print '<input type="hidden" name="type" id="type" value="'.$type.'">';
271}
272?>
273</td></tr>
274
275<!-- Size -->
276<tr class="extra_size"><td><?php echo $langs->trans("Size"); ?></td><td><input id="size" type="text" name="size" class="width50" value="<?php echo dol_escape_htmltag($size); ?>"></td></tr>
277
278<!-- Value (for some fields like password, select list, radio, ...) -->
279<tr id="value_choice">
280<td>
281 <?php echo $langs->trans("Value"); ?>
282</td>
283<td>
284 <table class="nobordernopadding">
285 <tr><td>
286 <textarea name="param" id="param" cols="80" rows="<?php echo ROWS_4 ?>" spellcheck="false"><?php echo dol_htmlcleanlastbr($param_chain); ?></textarea>
287 </td><td>
288 <span id="helpselect" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 'info', '', 0, 2, 'helpvalue1')?></span>
289 <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>
290 <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>
291 <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>
292 <span id="helppassword" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 'info', '', 0, 2, 'helpvalue5')?></span>
293 <span id="helpseparate" class="spanforparamtooltip"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 'info', '', 0, 2, 'helpvalue6')?></span>
294 </td></tr>
295 </table>
296</td>
297</tr>
298
299<!-- Position -->
300<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>
301
302<!-- Language file -->
303<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>
304
305<!-- Computed value -->
306<tr class="extra_computed_value">
307<?php
308global $dolibarr_main_restrict_eval_methods;
309if (!isset($dolibarr_main_restrict_eval_methods)) {
310 $showfunctions = 'getDolGlobalString, getDolGlobalInt, getDolCurrency, getDolEntity, getDolDBType, fetchNoCompute, hasRight, isAdmin, isExternalUser, isModEnabled, isStringVarMatching, abs, min, max, round, dol_now, preg_match';
311} else {
312 $showfunctions = $dolibarr_main_restrict_eval_methods ? $dolibarr_main_restrict_eval_methods : $langs->transnoentitiesnoconv("None");
313}
314if (!getDolGlobalString('MAIN_STORE_COMPUTED_EXTRAFIELDS')) {
315 ?>
316 <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>
317<?php } else {
318 ?>
319 <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>
320<?php } ?>
321<td class="valeur"><textarea name="computed_value" id="computed_value" class="quatrevingtpercent" rows="<?php echo ROWS_4 ?>"><?php echo dol_htmlcleanlastbr($computed); ?></textarea></td>
322</tr>
323
324<!-- AI Prompt -->
325<tr class="extra_ai_prompt">
326 <td><?php
327 if ($elementtype == "projet") {
328 $elementtype = "project";
329 }
330 $elementprop = getElementProperties($elementtype);
331 $object = fetchObjectByElement(0, $elementtype);
332 if ($elementprop["module"] == "adherent") {
333 $elementprop["module"] = "member";
334 }
335 if ($elementprop["module"] == "projet") {
336 $elementprop["module"] = "project";
337 }
338 if ($elementprop["module"] == "contrat") {
339 $elementprop["module"] = "contract";
340 $object->element = "contract";
341 }
342 if ($elementprop["module"] == "ficheinter") {
343 $elementprop["module"] = "intervention";
344 }
345 $substitutionarray = getCommonSubstitutionArray($langs, 1, null, $object, array("object", $elementprop["module"]));
346 $texthelp = $langs->trans("AIPromptExtrafieldDesc").'<br><br>';
347 $texthelp .= $langs->trans("FollowingConstantsWillBeSubstituted").'<br><small>';
348 foreach ($substitutionarray as $key => $val) {
349 $texthelp .= $key.' -> '.$val.'<br>';
350 }
351 $texthelp .= '</small>';
352 echo $form->textwithpicto($langs->trans("AIPromptExtrafield"), $texthelp, 1, 'help', 'valignmiddle', 0, 3, 'abc');?></td>
353<td class="valeur"><textarea name="ai_prompt" id="ai_prompt" class="quatrevingtpercent" rows="<?php echo ROWS_4 ?>"><?php echo($aiprompt); ?></textarea></td></tr>
354
355<!-- Default Value (at sql setup level) -->
356<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>
357
358<!-- Unique -->
359<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>
360
361<!-- Required -->
362<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>
363
364<!-- Always editable -->
365<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>
366
367<!-- Personal Data (RGPD/nLPD/LGPD) -->
368<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>
369
370<!-- Empty on clone -->
371<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>
372
373<!-- Permission to edit -->
374<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 dol_escape_htmltag($perms); ?>"></td></tr>
375
376<!-- Visibility -->
377<tr><td class="extra_list"><?php echo $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'<br><br>'.$langs->trans("ItCanBeAnExpression")); ?>
378</td><td class="valeur"><input id="list" class="minwidth200" type="text" name="list" value="<?php echo dol_escape_htmltag($list != '' ? $list : '1'); ?>"></td></tr>
379
380<!-- Visibility for PDF-->
381<tr><td class="extra_pdf"><?php echo $form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
382</td><td class="valeur"><input id="printable" class="width50" type="text" name="printable" value="<?php echo dol_escape_htmltag((string) $printable); ?>"></td></tr>
383
384<!-- Visibility for getNomUrl -->
385<tr><td class="extra_showintooltip"><?php echo $form->textwithpicto($langs->trans("DisplayExtraOnTooltip"), $langs->trans("DisplayExtraOnTooltipDesc")); ?>
386</td><td class="valeur"><input id="showintooltip" type="checkbox" name="showintooltip" value="1" <?php echo($showITooltip ? ' checked' : ''); ?> ></td></tr>
387
388<!-- Can be summed -->
389<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>
390
391<!-- Help tooltip -->
392<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>
393
394<!-- Css edit -->
395<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 dol_escape_htmltag($css); ?>"></td></tr>
396
397<!-- Css view -->
398<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 dol_escape_htmltag($cssview); ?>"></td></tr>
399
400<!-- Css list -->
401<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 dol_escape_htmltag($csslist); ?>"></td></tr>
402
403<?php if (isModEnabled('multicompany')) { ?>
404 <!-- Multicompany entity -->
405 <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>
406<?php } ?>
407
408<!-- Show Enabled property when value is not a common value -->
409<?php if ($enabled != '1') { ?>
410 <tr class="help"><td><?php echo $form->textwithpicto($langs->trans("EnabledCondition"), $langs->trans("EnabledConditionHelp")); ?></td><td class="valeur">
411 <?php echo dol_escape_htmltag((string) $enabled); ?>
412<?php } ?>
413</td></tr>
414
415</table>
416
417<?php print dol_get_fiche_end(); ?>
418
419<div class="center"><input type="submit" name="button" class="button button-save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
420<input type="submit" name="button" class="button button-cancel" value="<?php echo $langs->trans("Cancel"); ?>"></div>
421
422</form>
423
424<!-- 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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getElementProperties($elementType)
Get an array with properties of an element.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
treeview li table
No Email.
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.
Definition html.lib.php:519
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition html.lib.php:717
getPictoForType($key, $morecss='')
Return the picto for a data type.
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...
Definition html.lib.php:172
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