dolibarr 20.0.0
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(1);
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 if ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] == 'separate') {
26 continue;
27 }
28
29 $cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey);
30 $sortonfield = $extrafieldsobjectprefix.$key;
31 if (!empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) {
32 $sortonfield = '';
33 }
34
35 if (!empty($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]) && is_object($langs)) {
36 $langs->load($extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key]);
37 }
38
39 $tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
40
41 // Show cell
42 print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, 'data-titlekey="'.$key.'"', $sortfield, $sortorder, $cssclass.' ', $disablesortlink, $tooltip)."\n";
43 if (isset($totalarray) && isset($totalarray['nbfield'])) {
44 $totalarray['nbfield']++;
45 }
46 }
47 }
48 }
49}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.