dolibarr 19.0.3
extrafields_list_search_title.tpl.php
1<?php
2
3// Protection to avoid direct call of template
4if (empty($conf) || !is_object($conf)) {
5 print "Error, template page can't be called as URL";
6 exit;
7}
8
9if (empty($extrafieldsobjectkey) && is_object($object)) {
10 $extrafieldsobjectkey = $object->table_element;
11}
12if (!isset($disablesortlink)) {
13 $disablesortlink = 0;
14}
15
16// Loop to show all columns of extrafields for the title line
17if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
18 if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
19 if (empty($extrafieldsobjectprefix)) {
20 $extrafieldsobjectprefix = 'ef.';
21 }
22
23 foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
24 if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) {
25 $cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey);
26 $sortonfield = $extrafieldsobjectprefix.$key;
27 if (!empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) {
28 $sortonfield = '';
29 }
30 if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') {
31 print '<th class="liste_titre thseparator"></th>';
32 } else {
33 if (!empty($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]) && is_object($langs)) {
34 $langs->load($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]);
35 }
36
37 $tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
38
39 print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, 'data-titlekey="'.$key.'"', $sortfield, $sortorder, $cssclass.' ', $disablesortlink, $tooltip)."\n";
40 if (isset($totalarray) && isset($totalarray['nbfield'])) {
41 $totalarray['nbfield']++;
42 }
43 }
44 }
45 }
46 }
47}
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.