* Copyright (C) 2012-2021 Regis Houssin * Copyright (C) 2018-2019 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 . */ /* To call this template, you must define * $textobject * $langs * $extrafield * $elementtype */ // Protection to avoid direct call of template if (empty($langs) || !is_object($langs)) { print "Error, template page can't be called as URL"; exit; } $langs->load("modulebuilder"); ?> '.$langs->trans("DefineHereComplementaryAttributes", empty($textobject) ? '': $textobject).'
'."\n"; //if ($action != 'create' && $action != 'edit') { $newcardbutton = dolGetButtonTitle($langs->trans('NewAttribute'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=create', '', (($action != 'create' && $action != 'edit') ? 1 : 1)); /*} else { $newcardbutton = ''; }*/ print '
'; print '
'; print '
'.$title.'
'; print '
'.$newcardbutton.'
'; print '
'; print '
'; // Load $extrafields->attributes $extrafields->fetch_name_optionals_label($elementtype); print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; if (isModEnabled('multicompany')) { print ''; } print ''; print "\n"; if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) { foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) { /*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) { // TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled" // continue; }*/ // Load language if required if (!empty($extrafields->attributes[$elementtype]['langfile'][$key])) { $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); } print ''; // Position print "\n"; // Label print '\n"; // We don't translate here, we want admin to know what is the key not translated value // Label translated print '\n"; // Key print '\n"; // Type $typetoshow = $type2label[$extrafields->attributes[$elementtype]['type'][$key]]; print '\n"; // Size print '\n"; // Computed field print '\n"; // Is unique ? print '\n"; // Is mandatory ? print '\n"; // Can always be editable ? print '\n"; // Visible print '\n"; // Print on PDF print '\n"; // Summable print '\n"; // CSS print '\n"; // CSS view print '\n"; // CSS list print '\n"; // Multicompany if (isModEnabled('multicompany')) { print ''; } // Actions print ''."\n"; print ""; } } else { $colspan = 17; if (isModEnabled('multicompany')) { $colspan++; } print ''; print ''; print ''; } print "
'.$langs->trans("Position"); print ''; print img_picto('A-Z', '1downarrow.png'); print ''; print ''.$langs->trans("LabelOrTranslationKey").''.$langs->trans("TranslationString").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("ComputedFormula").''.$langs->trans("Unique").''.$langs->trans("Mandatory").''.$form->textwithpicto($langs->trans("AlwaysEditable"), $langs->trans("EditableWhenDraftOnly")).''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$form->textwithpicto($langs->trans("CssOnEdit"), $langs->trans("HelpCssOnEditDesc")).''.$form->textwithpicto($langs->trans("CssOnView"), $langs->trans("HelpCssOnViewDesc")).''.$form->textwithpicto($langs->trans("CssOnList"), $langs->trans("HelpCssOnListDesc")).''.$langs->trans("Entity").' 
".dol_escape_htmltag($extrafields->attributes[$elementtype]['pos'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['label'][$key])."'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype]['label'][$key]))."'.dol_escape_htmltag($key)."'; print dol_escape_htmltag($typetoshow); print "'.dol_escape_htmltag($extrafields->attributes[$elementtype]['size'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['computed'][$key])."'.yn($extrafields->attributes[$elementtype]['unique'][$key])."'.yn($extrafields->attributes[$elementtype]['required'][$key])."'.yn($extrafields->attributes[$elementtype]['alwayseditable'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['list'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['css'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['cssview'][$key])."'.dol_escape_htmltag($extrafields->attributes[$elementtype]['csslist'][$key])."'; if (empty($extrafields->attributes[$elementtype]['entityid'][$key])) { print $langs->trans("All"); } else { global $multicompanylabel_cache; if (!is_array($multicompanylabel_cache)) { $multicompanylabel_cache = array(); } if (empty($multicompanylabel_cache[$extrafields->attributes[$elementtype]['entityid'][$key]])) { global $mc; $mc->getInfo($extrafields->attributes[$elementtype]['entityid'][$key]); $multicompanylabel_cache[$extrafields->attributes[$elementtype]['entityid'][$key]] = $mc->label ? $mc->label : $extrafields->attributes[$elementtype]['entityid'][$key]; } print $multicompanylabel_cache[$extrafields->attributes[$elementtype]['entityid'][$key]]; } print ''; print ''.img_edit().''; print '  '.img_delete().''; print '
'; print $langs->trans("None"); print '
"; print '
'; ?>