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 $title =
'<span class="opacitymedium">'.$langs->trans(
"DefineHereComplementaryAttributes", empty($textobject) ?
'': $textobject).
'</span><br>'.
"\n";
43 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewAttribute'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=create',
'', (($action !=
'create' && $action !=
'edit') ? 1 : 1));
48 print
'<div class="centpercent tagtable marginbottomonly">';
49 print
'<div class="tagtr">';
50 print
'<div class="tagtd inline-block valignmiddle hideonsmartphoneimp">'.$title.
'</div>';
51 print
'<div class="tagtd right inline-block valignmiddle"">'.$newcardbutton.
'</div>';
56 $extrafields->fetch_name_optionals_label($elementtype);
58 print
'<div class="div-table-responsive">';
59 print
'<table summary="listofattributes" class="noborder centpercent small">';
61 print
'<tr class="liste_titre">';
62 print
'<td class="left">'.$langs->trans(
"Position");
63 print
'<span class="nowrap">';
67 print
'<td>'.$langs->trans(
"LabelOrTranslationKey").
'</td>';
68 print
'<td>'.$langs->trans(
"TranslationString").
'</td>';
69 print
'<td>'.$langs->trans(
"AttributeCode").
'</td>';
70 print
'<td>'.$langs->trans(
"Type").
'</td>';
71 print
'<td class="right">'.$langs->trans(
"Size").
'</td>';
72 print
'<td>'.$langs->trans(
"ComputedFormula").
'</td>';
73 print
'<td class="center">'.$langs->trans(
"Unique").
'</td>';
74 print
'<td class="center">'.$langs->trans(
"Mandatory").
'</td>';
75 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"AlwaysEditable"), $langs->trans(
"EditableWhenDraftOnly")).
'</td>';
76 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Visibility"), $langs->trans(
"VisibleDesc")).
'</td>';
77 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"DisplayOnPdf"), $langs->trans(
"DisplayOnPdfDesc")).
'</td>';
78 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Totalizable"), $langs->trans(
"TotalizableDesc")).
'</td>';
79 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnEdit"), $langs->trans(
"HelpCssOnEditDesc")).
'</td>';
80 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnView"), $langs->trans(
"HelpCssOnViewDesc")).
'</td>';
81 print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnList"), $langs->trans(
"HelpCssOnListDesc")).
'</td>';
83 print
'<td class="center">'.$langs->trans(
"Entity").
'</td>';
85 print
'<td width="80"> </td>';
88 if (isset($extrafields->attributes[$elementtype][
'type']) && is_array($extrafields->attributes[$elementtype][
'type']) && count($extrafields->attributes[$elementtype][
'type'])) {
89 foreach ($extrafields->attributes[$elementtype][
'type'] as $key => $value) {
96 if (!empty($extrafields->attributes[$elementtype][
'langfile'][$key])) {
97 $langs->load($extrafields->attributes[$elementtype][
'langfile'][$key]);
100 print
'<tr class="oddeven">';
102 print
"<td>".dol_escape_htmltag($extrafields->attributes[$elementtype][
'pos'][$key]).
"</td>\n";
104 print
'<td title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'label'][$key]).
'" class="tdoverflowmax150">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'label'][$key]).
"</td>\n";
106 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";
108 print
'<td title="'.dol_escape_htmltag($key).
'" class="tdoverflowmax100">'.
dol_escape_htmltag($key).
"</td>\n";
110 $typetoshow = $type2label[$extrafields->attributes[$elementtype][
'type'][$key]];
111 print
'<td title="'.dol_escape_htmltag($typetoshow).
'" class="tdoverflowmax100">';
115 print
'<td class="right">'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'size'][$key]).
"</td>\n";
117 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
"</td>\n";
119 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'unique'][$key]).
"</td>\n";
121 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'required'][$key]).
"</td>\n";
123 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'alwayseditable'][$key]).
"</td>\n";
125 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
"</td>\n";
127 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'printable'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'printable'][$key]).
"</td>\n";
129 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'totalizable'][$key]).
"</td>\n";
131 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'css'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'css'][$key]).
"</td>\n";
133 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'cssview'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'cssview'][$key]).
"</td>\n";
135 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'csslist'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'csslist'][$key]).
"</td>\n";
138 print
'<td class="center">';
139 if (empty($extrafields->attributes[$elementtype][
'entityid'][$key])) {
140 print $langs->trans(
"All");
142 global $multicompanylabel_cache;
143 if (!is_array($multicompanylabel_cache)) {
144 $multicompanylabel_cache = array();
146 if (empty($multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]])) {
148 $mc->getInfo($extrafields->attributes[$elementtype][
'entityid'][$key]);
149 $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]] = $mc->label ? $mc->label : $extrafields->attributes[$elementtype][
'entityid'][$key];
151 print $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]];
156 print
'<td class="right nowraponall">';
157 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'&attrname='.urlencode($key).
'#formeditextrafield">'.
img_edit().
'</a>';
158 print
' <a class="paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.
newToken().
'&attrname='.urlencode($key).
'">'.
img_delete().
'</a>';
168 print
'<tr class="oddeven">';
169 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">';
170 print $langs->trans(
"None");
171 print
'</span></td>';
178 <!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.