28 if (empty($langs) || !is_object($langs)) {
29 print
"Error, template page can't be called as URL";
34 $langs->load(
"modulebuilder");
38 <!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
41 print
'<span class="opacitymedium">'.$langs->trans(
"DefineHereComplementaryAttributes", empty($textobject) ?
'': $textobject).
'</span><br>'.
"\n";
45 $extrafields->fetch_name_optionals_label($elementtype);
47 print
'<div class="div-table-responsive">';
48 print
'<table summary="listofattributes" class="noborder centpercent">';
50 print
'<tr class="liste_titre">';
51 print
'<td class="left">'.$langs->trans(
"Position");
52 print
'<span class="nowrap">';
56 print
'<td>'.$langs->trans(
"LabelOrTranslationKey").
'</td>';
57 print
'<td>'.$langs->trans(
"TranslationString").
'</td>';
58 print
'<td>'.$langs->trans(
"AttributeCode").
'</td>';
59 print
'<td>'.$langs->trans(
"Type").
'</td>';
60 print
'<td class="right">'.$langs->trans(
"Size").
'</td>';
61 print
'<td>'.$langs->trans(
"ComputedFormula").
'</td>';
62 print
'<td class="center">'.$langs->trans(
"Unique").
'</td>';
63 print
'<td class="center">'.$langs->trans(
"Required").
'</td>';
64 print
'<td class="center">'.$langs->trans(
"AlwaysEditable").
'</td>';
65 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Visible"), $langs->trans(
"VisibleDesc")).
'</td>';
66 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"DisplayOnPdf"), $langs->trans(
"DisplayOnPdfDesc")).
'</td>';
67 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Totalizable"), $langs->trans(
"TotalizableDesc")).
'</td>';
68 if (!empty($conf->multicompany->enabled)) {
69 print
'<td class="center">'.$langs->trans(
"Entity").
'</td>';
71 print
'<td width="80"> </td>';
74 if (isset($extrafields->attributes[$elementtype][
'type']) && is_array($extrafields->attributes[$elementtype][
'type']) && count($extrafields->attributes[$elementtype][
'type'])) {
75 foreach ($extrafields->attributes[$elementtype][
'type'] as $key => $value) {
82 if (!empty($extrafields->attributes[$elementtype][
'langfile'][$key])) {
83 $langs->load($extrafields->attributes[$elementtype][
'langfile'][$key]);
86 print
'<tr class="oddeven">';
88 print
"<td>".dol_escape_htmltag($extrafields->attributes[$elementtype][
'pos'][$key]).
"</td>\n";
90 print
"<td>".dol_escape_htmltag($extrafields->attributes[$elementtype][
'label'][$key]).
"</td>\n";
92 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype][
'label'][$key])).
'">'.
dol_escape_htmltag($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype][
'label'][$key])).
"</td>\n";
94 print
"<td>".dol_escape_htmltag($key).
"</td>\n";
96 $typetoshow = $type2label[$extrafields->attributes[$elementtype][
'type'][$key]];
97 print
'<td title="'.dol_escape_htmltag($typetoshow).
'" class="tdoverflowmax150">';
101 print
'<td class="right">'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'size'][$key]).
"</td>\n";
103 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
"</td>\n";
105 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'unique'][$key]).
"</td>\n";
107 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'required'][$key]).
"</td>\n";
109 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'alwayseditable'][$key]).
"</td>\n";
111 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
"</td>\n";
113 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'printable'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'printable'][$key]).
"</td>\n";
115 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'totalizable'][$key]).
"</td>\n";
116 if (!empty($conf->multicompany->enabled)) {
117 print
'<td class="center">';
118 if (empty($extrafields->attributes[$elementtype][
'entityid'][$key])) {
119 print $langs->trans(
"All");
121 global $multicompanylabel_cache;
122 if (!is_array($multicompanylabel_cache)) {
123 $multicompanylabel_cache = array();
125 if (empty($multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]])) {
127 $mc->getInfo($extrafields->attributes[$elementtype][
'entityid'][$key]);
128 $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]] = $mc->label ? $mc->label : $extrafields->attributes[$elementtype][
'entityid'][$key];
130 print $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]];
134 print
'<td class="right nowraponall">';
135 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'&attrname='.urlencode($key).
'#formeditextrafield">'.
img_edit().
'</a>';
136 print
' <a class="paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&attrname='.urlencode($key).
'">'.
img_delete().
'</a>';
142 if (!empty($conf->multicompany->enabled)) {
146 print
'<tr class="oddeven">';
147 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">';
148 print $langs->trans(
"None");
149 print
'</span></td>';
156 <!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->