41if (empty($langs) || !is_object($langs)) {
42 print
"Error, template page can't be called as URL";
45global $action, $form, $langs;
47$langs->load(
"modulebuilder");
49if ($action ==
'delete') {
50 $attributekey =
GETPOST(
'attrname',
'aZ09');
51 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?attrname=$attributekey", $langs->trans(
"DeleteExtrafield"), $langs->trans(
"ConfirmDeleteExtrafield", $attributekey),
"confirm_delete",
'', 0, 1);
56<!-- BEGIN PHP TEMPLATE admin_extrafields_view.tpl.php -->
59$title =
'<span class="opacitymedium">'.$langs->trans(
"DefineHereComplementaryAttributes", empty($textobject) ?
'' : $textobject).
'</span><br>'.
"\n";
62$newcardbutton .= dolGetButtonTitle($langs->trans(
'NewAttribute'),
'',
'fa fa-plus-circle', $_SERVER[
"PHP_SELF"].
'?action=create',
'', 1);
67print
'<div class="centpercent tagtable marginbottomonly">';
68print
'<div class="tagtr">';
69print
'<div class="tagtd inline-block valignmiddle hideonsmartphoneimp">'.$title.
'</div>';
70print
'<div class="tagtd right inline-block valignmiddle"">'.$newcardbutton.
'</div>';
75$extrafields->fetch_name_optionals_label($elementtype);
77print
'<div class="div-table-responsive">';
78print
'<table summary="listofattributes" class="noborder centpercent small">';
80print
'<tr class="liste_titre">';
81if (
$conf->main_checkbox_left_column) {
82 print
'<td width="80"> </td>';
84print
'<td class="left">'.$langs->trans(
"Position");
85print
'<span class="nowrap">';
89print
'<td>'.$langs->trans(
"LabelOrTranslationKey").
'</td>';
91print
'<td>'.$langs->trans(
"AttributeCode").
'</td>';
92print
'<td>'.$langs->trans(
"Type").
'</td>';
93print
'<td class="right">'.$langs->trans(
"Size").
'</td>';
94print
'<td>'.$langs->trans(
"ComputedFormula").
'</td>';
95print
'<td class="center">'.$langs->trans(
"Unique").
'</td>';
96print
'<td class="center">'.$langs->trans(
"Mandatory").
'</td>';
97print
'<td class="center">'.$form->textwithpicto($langs->trans(
"AlwaysEditable"), $langs->trans(
"EditableWhenDraftOnly")).
'</td>';
98print
'<td class="center">'.$form->textwithpicto($langs->trans(
"IsPersonalData"), $langs->trans(
"IsPersonalDataDesc")).
'</td>';
99print
'<td class="center">'.$form->textwithpicto($langs->trans(
"EmptyOnClone"), $langs->trans(
"EmptyOnCloneDesc")).
'</td>';
100print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Visibility"), $langs->trans(
"VisibleDesc").
'<br><br>'.$langs->trans(
"ItCanBeAnExpression")).
'</td>';
101print
'<td class="center">'.$form->textwithpicto($langs->trans(
"DisplayOnPdf"), $langs->trans(
"DisplayOnPdfDesc")).
'</td>';
102print
'<td class="center">'.$form->textwithpicto($langs->trans(
"Totalizable"), $langs->trans(
"TotalizableDesc")).
'</td>';
103print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnEdit"), $langs->trans(
"HelpCssOnEditDesc")).
'</td>';
104print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnView"), $langs->trans(
"HelpCssOnViewDesc")).
'</td>';
105print
'<td class="center">'.$form->textwithpicto($langs->trans(
"CssOnList"), $langs->trans(
"HelpCssOnListDesc")).
'</td>';
107 print
'<td class="center">'.$langs->trans(
"Entity").
'</td>';
110if (!
$conf->main_checkbox_left_column) {
111 print
'<td width="80"> </td>';
115if (isset($extrafields->attributes[$elementtype][
'type']) && is_array($extrafields->attributes[$elementtype][
'type']) && count($extrafields->attributes[$elementtype][
'type'])) {
116 foreach ($extrafields->attributes[$elementtype][
'type'] as $key => $value) {
123 if (!empty($extrafields->attributes[$elementtype][
'langfile'][$key])) {
124 $langs->load($extrafields->attributes[$elementtype][
'langfile'][$key]);
127 print
'<tr class="oddeven">';
129 if (
$conf->main_checkbox_left_column) {
130 print
'<td class="center nowraponall">';
131 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&attrname='.urlencode($key).
'#formeditextrafield">'.
img_edit().
'</a>';
132 print
' <a class="paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&attrname='.urlencode($key).
'">'.
img_delete().
'</a>';
133 if ($extrafields->attributes[$elementtype][
'type'][$key] ==
'password' && !empty($extrafields->attributes[$elementtype][
'param'][$key][
'options']) && array_key_exists(
'dolcrypt', $extrafields->attributes[$elementtype][
'param'][$key][
'options'])) {
134 print
' <a class="aaa" href="'.$_SERVER[
"PHP_SELF"].
'?action=encrypt&token='.newToken().
'&attrname='.urlencode($key).
'" title="'.
dol_escape_htmltag($langs->trans(
"ReEncryptDesc")).
'">'.
img_picto(
'',
'refresh').
'</a>';
139 print
"<td>".dol_escape_htmltag((
string) $extrafields->attributes[$elementtype][
'pos'][$key]).
"</td>\n";
141 print
'<td title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'label'][$key]).
'" class="tdoverflowmax150 subtitle">';
143 if ($langs->transnoentitiesnoconv($extrafields->attributes[$elementtype][
'label'][$key]) != $extrafields->attributes[$elementtype][
'label'][$key]) {
144 print
'<br><span class="subtitle small opacitymedium inline-block" title="'.dolPrintHTMLForAttribute($langs->trans(
"LabelTranslatedInCurrentLanguage")).
'">';
145 print $langs->transnoentitiesnoconv($extrafields->attributes[$elementtype][
'label'][$key]);
152 print
'<td title="'.dol_escape_htmltag($key).
'" class="tdoverflowmax100">'.
dol_escape_htmltag($key).
"</td>\n";
154 $typetoshow = $type2label[$extrafields->attributes[$elementtype][
'type'][$key]];
155 print
'<td title="'.dol_escape_htmltag($typetoshow).
'" class="tdoverflowmax100">';
156 print
getPictoForType($extrafields->attributes[$elementtype][
'type'][$key]);
160 print
'<td class="right">'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'size'][$key]).
"</td>\n";
162 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'computed'][$key]).
"</td>\n";
164 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'unique'][$key]).
"</td>\n";
166 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'required'][$key]).
"</td>\n";
168 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'alwayseditable'][$key]).
"</td>\n";
170 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'personal_data'][$key]).
"</td>\n";
172 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'emptyonclone'][$key]).
"</td>\n";
174 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'list'][$key]).
"</td>\n";
176 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag((
string) $extrafields->attributes[$elementtype][
'printable'][$key]).
'">'.
dol_escape_htmltag((
string) $extrafields->attributes[$elementtype][
'printable'][$key]).
"</td>\n";
178 print
'<td class="center">'.yn($extrafields->attributes[$elementtype][
'totalizable'][$key]).
"</td>\n";
180 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'css'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'css'][$key]).
"</td>\n";
182 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'cssview'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'cssview'][$key]).
"</td>\n";
184 print
'<td class="center tdoverflowmax100" title="'.dol_escape_htmltag($extrafields->attributes[$elementtype][
'csslist'][$key]).
'">'.
dol_escape_htmltag($extrafields->attributes[$elementtype][
'csslist'][$key]).
"</td>\n";
187 print
'<td class="center tdoverflowmax100">';
188 if (empty($extrafields->attributes[$elementtype][
'entityid'][$key])) {
189 print $langs->trans(
"All");
191 global $multicompanylabel_cache;
192 if (!is_array($multicompanylabel_cache)) {
193 $multicompanylabel_cache = array();
195 if (empty($multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]])) {
197 if (is_object($mc) && method_exists($mc,
'getInfo')) {
198 $mc->getInfo($extrafields->attributes[$elementtype][
'entityid'][$key]);
199 $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]] = $mc->label ? $mc->label : $extrafields->attributes[$elementtype][
'entityid'][$key];
202 print $multicompanylabel_cache[$extrafields->attributes[$elementtype][
'entityid'][$key]];
207 if (!
$conf->main_checkbox_left_column) {
208 print
'<td class="right nowraponall">';
209 print
'<a class="editfielda" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'&attrname='.urlencode($key).
'#formeditextrafield">'.
img_edit().
'</a>';
210 print
' <a class="paddingleft" href="'.$_SERVER[
"PHP_SELF"].
'?action=delete&token='.newToken().
'&attrname='.urlencode($key).
'">'.
img_delete().
'</a>';
211 if ($extrafields->attributes[$elementtype][
'type'][$key] ==
'password' && !empty($extrafields->attributes[$elementtype][
'param'][$key][
'options']) && array_key_exists(
'dolcrypt', $extrafields->attributes[$elementtype][
'param'][$key][
'options'])) {
212 print
' <a class="aaa" href="'.$_SERVER[
"PHP_SELF"].
'?action=encrypt&token='.newToken().
'&attrname='.urlencode($key).
'" title="'.
dol_escape_htmltag($langs->trans(
"ReEncryptDesc")).
'">'.
img_picto(
'',
'refresh').
'</a>';
224 print
'<tr class="">';
225 print
'<td colspan="'.$colspan.
'"><span class="opacitymedium">';
226 print $langs->trans(
"None");
227 print
'</span></td>';
234<!-- END PHP TEMPLATE admin_extrafields_view.tpl.php -->
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
getPictoForType($key, $morecss='')
Return the picto for a data type.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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...