* Copyright (C) 2012 Regis Houssin * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * The following vars must be defined: * $type2label * $form * $conf, $lang, * The following vars may also be defined: * $elementtype */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit; } $langs->load("modulebuilder"); $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php
Product:product/class/product.class.php
Project:projet/class/project.class.php
...'; ?>
?attrname=" id="formeditextrafield" method="post"> attributes[$elementtype]['label'][$attrname]; $type = $extrafields->attributes[$elementtype]['type'][$attrname]; $size = $extrafields->attributes[$elementtype]['size'][$attrname]; $computed = $extrafields->attributes[$elementtype]['computed'][$attrname]; $default = $extrafields->attributes[$elementtype]['default'][$attrname]; $unique = $extrafields->attributes[$elementtype]['unique'][$attrname]; $required = $extrafields->attributes[$elementtype]['required'][$attrname]; $pos = $extrafields->attributes[$elementtype]['pos'][$attrname]; $alwayseditable = $extrafields->attributes[$elementtype]['alwayseditable'][$attrname]; $param = $extrafields->attributes[$elementtype]['param'][$attrname]; $perms = $extrafields->attributes[$elementtype]['perms'][$attrname]; $langfile = $extrafields->attributes[$elementtype]['langfile'][$attrname]; $list = $extrafields->attributes[$elementtype]['list'][$attrname]; $totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname]; $help = $extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname]; $printable = $extrafields->attributes[$elementtype]['printable'][$attrname]; $enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname]; $css = $extrafields->attributes[$elementtype]['css'][$attrname]; $cssview = $extrafields->attributes[$elementtype]['cssview'][$attrname]; $csslist = $extrafields->attributes[$elementtype]['csslist'][$attrname]; if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) { $param_chain = ''; foreach ($param['options'] as $key => $value) { if (strlen($key)) { $param_chain .= $key.','.$value."\n"; } } } elseif (($type == 'sellist') || ($type == 'chkbxlst') || ($type == 'link') || ($type == 'password') || ($type == 'separate')) { $paramlist = array_keys($param['options']); $param_chain = $paramlist[0]; } ?> global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?>
trans("LabelOrTranslationKey"); ?>
trans("AttributeCode"); ?>
trans("Type"); ?> array('varchar', 'phone', 'mail', 'url', 'ip', 'select', 'password', 'text', 'html'), 'double'=>array('double', 'price'), 'price'=>array('double', 'price'), 'text'=>array('text', 'html'), 'html'=>array('text', 'html'), 'password'=>array('password', 'varchar'), 'mail'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'url'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'phone'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'ip'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'select'=>array('varchar', 'phone', 'mail', 'url', 'ip', 'select'), 'date'=>array('date', 'datetime') ); /* Disabled because text is text on several lines, when varchar is text on 1 line, we should not be able to convert if ($size <= 255 && in_array($type, array('text', 'html'))) { $typewecanchangeinto['text'][] = 'varchar'; }*/ if (in_array($type, array_keys($typewecanchangeinto))) { $newarray = array(); print ''; print ajax_combobox('type'); } else { print $type2label[$type]; print ''; } ?>
trans("Size"); ?>
trans("Value"); ?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?> textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?> textwithpicto('', $langs->trans("ExtrafieldParamHelpchkbxlst"), 1, 0, '', 0, 2, 'helpvalue3')?> textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'

'.$langs->trans("Examples").':
'.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?> textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?>
trans("Position"); ?>
trans("LanguageFile"); ?>
textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?>
trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>
trans("Unique"); ?>>
trans("Mandatory"); ?>>
textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")); ?>>
textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")); ?>
textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")); ?>
textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")); ?>>
textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")); ?>
textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")); ?>
textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")); ?>
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
trans("AllEntities"); ?>>
trans("EnabledCondition"); ?>
">      ">