40 global $langs, $extrafields, $db;
46 return $arrayofmesures;
49 if (empty($tablepath)) {
50 $tablepath =
$object->table_element.
'='.$tablealias;
52 $tablepath .=
','.$object->table_element.
'='.$tablealias;
57 $arrayofmesures[$tablealias.
'.count'] = array(
58 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans(
"Number"),
59 'labelnohtml' => $labelofobject.
': '.$langs->trans(
"Number"),
61 'table' =>
$object->table_element,
62 'tablefromt' => $tablepath
69 foreach (
$object->fields as $key => $val) {
70 if (!empty($val[
'isameasure']) && (!isset($val[
'enabled']) || (int)
dol_eval($val[
'enabled'], 1, 1,
'1'))) {
71 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
72 $arrayofmesures[$tablealias.
'.'.$key.
'-sum'] = array(
73 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Sum").
')</span>',
74 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
75 'position' => ($position + ($count * 100000)).
'.1',
76 'table' =>
$object->table_element,
77 'tablefromt' => $tablepath
79 $arrayofmesures[$tablealias.
'.'.$key.
'-average'] = array(
80 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Average").
')</span>',
81 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
82 'position' => ($position + ($count * 100000)).
'.2',
83 'table' =>
$object->table_element,
84 'tablefromt' => $tablepath
86 $arrayofmesures[$tablealias.
'.'.$key.
'-min'] = array(
87 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Minimum").
')</span>',
88 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
89 'position' => ($position + ($count * 100000)).
'.3',
90 'table' =>
$object->table_element,
91 'tablefromt' => $tablepath
93 $arrayofmesures[$tablealias.
'.'.$key.
'-max'] = array(
94 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Maximum").
')</span>',
95 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
96 'position' => ($position + ($count * 100000)).
'.4',
97 'table' =>
$object->table_element,
98 'tablefromt' => $tablepath
100 $arrayofmesures[$tablealias.
'.'.$key.
'-stddevpop'] = array(
101 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"StandardDeviationPop").
')</span>',
102 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
103 'position' => ($position + ($count * 100000)).
'.5',
104 'table' =>
$object->table_element,
105 'tablefromt' => $tablepath
110 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
111 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
112 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key]) && (!isset($extrafields->attributes[
$object->table_element][
'enabled'][$key]) || (int)
dol_eval((
string) $extrafields->attributes[
$object->table_element][
'enabled'][$key], 1, 1,
'1'))) {
114 $position = (!empty($val[
'position']) ? $val[
'position'] : 0);
115 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-sum'] = array(
116 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($extrafields->attributes[
$object->table_element][
'label'][$key]).
' <span class="opacitymedium">('.$langs->trans(
"Sum").
')</span>',
117 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
118 'position' => ($position + ($count * 100000)).
'.1',
119 'table' =>
$object->table_element,
120 'tablefromt' => $tablepath
122 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-average'] = array(
123 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($extrafields->attributes[
$object->table_element][
'label'][$key]).
' <span class="opacitymedium">('.$langs->trans(
"Average").
')</span>',
124 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
125 'position' => ($position + ($count * 100000)).
'.2',
126 'table' =>
$object->table_element,
127 'tablefromt' => $tablepath
129 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-min'] = array(
130 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($extrafields->attributes[
$object->table_element][
'label'][$key]).
' <span class="opacitymedium">('.$langs->trans(
"Minimum").
')</span>',
131 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
132 'position' => ($position + ($count * 100000)).
'.3',
133 'table' =>
$object->table_element,
134 'tablefromt' => $tablepath
136 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-max'] = array(
137 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($extrafields->attributes[
$object->table_element][
'label'][$key]).
' <span class="opacitymedium">('.$langs->trans(
"Maximum").
')</span>',
138 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
139 'position' => ($position + ($count * 100000)).
'.4',
140 'table' =>
$object->table_element,
141 'tablefromt' => $tablepath
143 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-stddevpop'] = array(
144 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($extrafields->attributes[
$object->table_element][
'label'][$key]).
' <span class="opacitymedium">('.$langs->trans(
"StandardDeviationPop").
')</span>',
145 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
146 'position' => ($position + ($count * 100000)).
'.5',
147 'table' =>
$object->table_element,
148 'tablefromt' => $tablepath
154 foreach (
$object->fields as $key => $val) {
155 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
156 $tmptype = explode(
':', $val[
'type'], 4);
157 if ($tmptype[0] ==
'integer' && !empty($tmptype[1]) && !empty($tmptype[2])) {
158 $newobject = $tmptype[1];
160 if (class_exists($newobject)) {
161 $tmpobject =
new $newobject($db);
164 $arrayofmesures =
fillArrayOfMeasures($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofmesures, $level + 1, $count, $tablepath);
166 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
172 return $arrayofmesures;
190 global $langs, $extrafields, $db;
196 return $arrayofxaxis;
199 if (empty($tablepath)) {
200 $tablepath =
$object->table_element.
'='.$tablealias;
202 $tablepath .=
','.$object->table_element.
'='.$tablealias;
205 $YYYY = substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1);
206 $MM = substr($langs->trans(
"Month"), 0, 1).substr($langs->trans(
"Month"), 0, 1);
207 $DD = substr($langs->trans(
"Day"), 0, 1).substr($langs->trans(
"Day"), 0, 1);
208 $HH = substr($langs->trans(
"Hour"), 0, 1).substr($langs->trans(
"Hour"), 0, 1);
209 $MI = substr($langs->trans(
"Minute"), 0, 1).substr($langs->trans(
"Minute"), 0, 1);
210 $SS = substr($langs->trans(
"Second"), 0, 1).substr($langs->trans(
"Second"), 0, 1);
219 foreach (
$object->fields as $key => $val) {
220 if (empty($val[
'measure'])) {
221 if (in_array($key, array(
222 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
223 'parent',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
226 if (isset($val[
'enabled']) && ! (
int)
dol_eval($val[
'enabled'], 1, 1,
'1')) {
229 if (isset($val[
'visible']) && ! (
int)
dol_eval($val[
'visible'], 1, 1,
'1')) {
232 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
235 if (preg_match(
'/^pass/', $key)) {
238 if (in_array($val[
'type'], array(
'html',
'text'))) {
241 if (in_array($val[
'type'], array(
'timestamp',
'date',
'datetime'))) {
242 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
243 $arrayofxaxis[$tablealias.
'.'.$key.
'-year'] = array(
244 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
')</span>',
245 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
246 'position' => ($position + ($count * 100000)).
'.1',
247 'table' =>
$object->table_element,
248 'tablefromt' => $tablepath
250 $arrayofxaxis[$tablealias.
'.'.$key.
'-month'] = array(
251 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
252 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
253 'position' => ($position + ($count * 100000)).
'.2',
254 'table' =>
$object->table_element,
255 'tablefromt' => $tablepath
257 $arrayofxaxis[$tablealias.
'.'.$key.
'-day'] = array(
258 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
259 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
260 'position' => ($position + ($count * 100000)).
'.3',
261 'table' =>
$object->table_element,
262 'tablefromt' => $tablepath
265 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
266 $arrayofxaxis[$tablealias.
'.'.$key] = array(
267 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
268 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
269 'position' => ($position + ($count * 100000)),
270 'table' =>
$object->table_element,
271 'tablefromt' => $tablepath
278 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
279 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
280 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
283 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
287 if (in_array($extrafields->attributes[
$object->table_element][
'type'][$key], array(
'timestamp',
'date',
'datetime'))) {
288 $position = (empty($extrafields->attributes[
$object->table_element][
'pos'][$key]) ? 0 : intval($extrafields->attributes[
$object->table_element][
'pos'][$key]));
289 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-year'] = array(
290 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
')</span>',
291 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
292 'position' => ($position + ($count * 100000)).
'.1',
293 'table' =>
$object->table_element,
294 'tablefromt' => $tablepath
296 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-month'] = array(
297 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
298 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
299 'position' => ($position + ($count * 100000)).
'.2',
300 'table' =>
$object->table_element,
301 'tablefromt' => $tablepath
303 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-day'] = array(
304 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
305 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
306 'position' => ($position + ($count * 100000)).
'.3',
307 'table' =>
$object->table_element,
308 'tablefromt' => $tablepath
311 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
312 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
313 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
314 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
315 'table' =>
$object->table_element,
316 'tablefromt' => $tablepath
323 foreach (
$object->fields as $key => $val) {
324 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
325 $tmptype = explode(
':', $val[
'type'], 4);
326 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
327 $newobject = $tmptype[1];
329 if (class_exists($newobject)) {
330 $tmpobject =
new $newobject($db);
333 $arrayofxaxis =
fillArrayOfXAxis($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofxaxis, $level + 1, $count, $tablepath);
335 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
341 return $arrayofxaxis;
359 global $langs, $extrafields, $db;
365 return $arrayofgroupby;
368 if (empty($tablepath)) {
369 $tablepath =
$object->table_element.
'='.$tablealias;
371 $tablepath .=
','.$object->table_element.
'='.$tablealias;
374 $YYYY = substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1).substr($langs->trans(
"Year"), 0, 1);
375 $MM = substr($langs->trans(
"Month"), 0, 1).substr($langs->trans(
"Month"), 0, 1);
376 $DD = substr($langs->trans(
"Day"), 0, 1).substr($langs->trans(
"Day"), 0, 1);
377 $HH = substr($langs->trans(
"Hour"), 0, 1).substr($langs->trans(
"Hour"), 0, 1);
378 $MI = substr($langs->trans(
"Minute"), 0, 1).substr($langs->trans(
"Minute"), 0, 1);
379 $SS = substr($langs->trans(
"Second"), 0, 1).substr($langs->trans(
"Second"), 0, 1);
384 foreach (
$object->fields as $key => $val) {
385 if (empty($val[
'isameasure'])) {
386 if (in_array($key, array(
387 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
388 'parent',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
391 if (isset($val[
'enabled']) && ! (
int)
dol_eval($val[
'enabled'], 1, 1,
'1')) {
394 if (isset($val[
'visible']) && ! (
int)
dol_eval($val[
'visible'], 1, 1,
'1')) {
397 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
400 if (preg_match(
'/^pass/', $key)) {
403 if (in_array($val[
'type'], array(
'html',
'text'))) {
406 if (in_array($val[
'type'], array(
'timestamp',
'date',
'datetime'))) {
407 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
408 $arrayofgroupby[$tablealias.
'.'.$key.
'-year'] = array(
409 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
')</span>',
410 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
411 'position' => ($position + ($count * 100000)).
'.1',
412 'table' =>
$object->table_element,
413 'tablefromt' => $tablepath
415 $arrayofgroupby[$tablealias.
'.'.$key.
'-month'] = array(
416 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
417 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
418 'position' => ($position + ($count * 100000)).
'.2',
419 'table' =>
$object->table_element,
420 'tablefromt' => $tablepath
422 $arrayofgroupby[$tablealias.
'.'.$key.
'-day'] = array(
423 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
424 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
425 'position' => ($position + ($count * 100000)).
'.3',
426 'table' =>
$object->table_element,
427 'tablefromt' => $tablepath
430 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
431 $arrayofgroupby[$tablealias.
'.'.$key] = array(
432 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
433 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
434 'position' => ($position + ($count * 100000)),
435 'table' =>
$object->table_element,
436 'tablefromt' => $tablepath
443 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
444 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
445 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
448 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
452 if (in_array($extrafields->attributes[
$object->table_element][
'type'][$key], array(
'timestamp',
'date',
'datetime'))) {
453 $position = (empty($extrafields->attributes[
$object->table_element][
'pos'][$key]) ? 0 : intval($extrafields->attributes[
$object->table_element][
'pos'][$key]));
454 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-year'] = array(
455 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
')</span>',
456 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
457 'position' => ($position + ($count * 100000)).
'.1',
458 'table' =>
$object->table_element,
459 'tablefromt' => $tablepath
461 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-month'] = array(
462 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
463 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
464 'position' => ($position + ($count * 100000)).
'.2',
465 'table' =>
$object->table_element,
466 'tablefromt' => $tablepath
468 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-day'] = array(
469 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
470 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
471 'position' => ($position + ($count * 100000)).
'.3',
472 'table' =>
$object->table_element,
473 'tablefromt' => $tablepath
476 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
477 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
478 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
479 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
480 'table' =>
$object->table_element,
481 'tablefromt' => $tablepath
488 foreach (
$object->fields as $key => $val) {
489 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
490 $tmptype = explode(
':', $val[
'type'], 4);
491 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
492 $newobject = $tmptype[1];
494 if (class_exists($newobject)) {
495 $tmpobject =
new $newobject($db);
498 $arrayofgroupby =
fillArrayOfGroupBy($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofgroupby, $level + 1, $count, $tablepath);
500 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
506 return $arrayofgroupby;
524 global $langs, $extrafields, $db;
530 return $arrayoffields;
533 if (empty($tablepath)) {
534 $tablepath =
$object->table_element.
'='.$tablealias;
536 $tablepath .=
','.$object->table_element.
'='.$tablealias;
542 foreach (
$object->fields as $key => $val) {
543 if (empty($val[
'measure'])) {
545 if (in_array($key, array(
546 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
547 'parent',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
550 if (isset($val[
'enabled']) && ! (
int)
dol_eval($val[
'enabled'], 1, 1,
'1')) {
553 if (isset($val[
'visible']) && ! (
int)
dol_eval($val[
'visible'], 1, 1,
'1')) {
556 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
559 if (preg_match(
'/^pass/', $key)) {
562 if (in_array($val[
'type'], array(
'html',
'text'))) {
566 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
567 $arrayoffields[$tablealias.
'.'.$key] = array(
568 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
569 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
570 'position' => ($position + ($count * 100000)),
571 'table' =>
$object->table_element,
572 'tablefromt' => $tablepath,
573 'type' => $val[
'type']
579 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
580 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
581 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
584 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
588 $arrayoffields[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
589 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
590 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
591 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
592 'table' =>
$object->table_element,
593 'tablefromt' => $tablepath,
594 'type' => $extrafields->attributes[
$object->table_element][
'type'][$key],
600 foreach (
$object->fields as $key => $val) {
601 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
602 $tmptype = explode(
':', $val[
'type'], 4);
603 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
604 $newobject = $tmptype[1];
606 if (class_exists($newobject)) {
607 $tmpobject =
new $newobject($db);
609 $arrayoffields =
fillArrayOfFilterFields($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayoffields, $level + 1, $count, $tablepath);
611 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
617 return $arrayoffields;
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)