41 global $langs, $extrafields, $db;
47 return $arrayofmesures;
50 if (empty($tablepath)) {
51 $tablepath =
$object->table_element.
'='.$tablealias;
53 $tablepath .=
','.$object->table_element.
'='.$tablealias;
58 $arrayofmesures[$tablealias.
'.count'] = array(
59 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans(
"Number"),
60 'labelnohtml' => $labelofobject.
': '.$langs->trans(
"Number"),
62 'table' =>
$object->table_element,
63 'tablefromt' => $tablepath
70 foreach (
$object->fields as $key => $val) {
71 if (!empty($val[
'isameasure']) && (!isset($val[
'enabled']) || (int)
dol_eval((
string) $val[
'enabled'], 1, 1,
'1'))) {
72 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
73 $arrayofmesures[$tablealias.
'.'.$key.
'-sum'] = array(
74 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Sum").
')</span>',
75 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
76 'position' => ($position + ($count * 100000)).
'.1',
77 'table' =>
$object->table_element,
78 'tablefromt' => $tablepath
80 $arrayofmesures[$tablealias.
'.'.$key.
'-average'] = array(
81 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Average").
')</span>',
82 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
83 'position' => ($position + ($count * 100000)).
'.2',
84 'table' =>
$object->table_element,
85 'tablefromt' => $tablepath
87 $arrayofmesures[$tablealias.
'.'.$key.
'-min'] = array(
88 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Minimum").
')</span>',
89 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
90 'position' => ($position + ($count * 100000)).
'.3',
91 'table' =>
$object->table_element,
92 'tablefromt' => $tablepath
94 $arrayofmesures[$tablealias.
'.'.$key.
'-max'] = array(
95 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"Maximum").
')</span>',
96 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
97 'position' => ($position + ($count * 100000)).
'.4',
98 'table' =>
$object->table_element,
99 'tablefromt' => $tablepath
101 $arrayofmesures[$tablealias.
'.'.$key.
'-stddevpop'] = array(
102 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$langs->trans(
"StandardDeviationPop").
')</span>',
103 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
104 'position' => ($position + ($count * 100000)).
'.5',
105 'table' =>
$object->table_element,
106 'tablefromt' => $tablepath
111 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
112 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
113 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 if (isset($extrafields->attributes[
$object->table_element][
'pos'][$key])) {
115 $position = $extrafields->attributes[
$object->table_element][
'pos'][$key];
119 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-sum'] = array(
120 '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>',
121 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
122 'position' => ($position + ($count * 100000)).
'.1',
123 'table' =>
$object->table_element,
124 'tablefromt' => $tablepath
126 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-average'] = array(
127 '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>',
128 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
129 'position' => ($position + ($count * 100000)).
'.2',
130 'table' =>
$object->table_element,
131 'tablefromt' => $tablepath
133 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-min'] = array(
134 '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>',
135 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
136 'position' => ($position + ($count * 100000)).
'.3',
137 'table' =>
$object->table_element,
138 'tablefromt' => $tablepath
140 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-max'] = array(
141 '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>',
142 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
143 'position' => ($position + ($count * 100000)).
'.4',
144 'table' =>
$object->table_element,
145 'tablefromt' => $tablepath
147 $arrayofmesures[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-stddevpop'] = array(
148 '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>',
149 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
150 'position' => ($position + ($count * 100000)).
'.5',
151 'table' =>
$object->table_element,
152 'tablefromt' => $tablepath
158 foreach (
$object->fields as $key => $val) {
159 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
160 $tmptype = explode(
':', $val[
'type'], 4);
161 if ($tmptype[0] ==
'integer' && !empty($tmptype[1]) && !empty($tmptype[2])) {
162 $newobject = $tmptype[1];
164 if (class_exists($newobject)) {
165 $tmpobject =
new $newobject($db);
168 $arrayofmesures =
fillArrayOfMeasures($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofmesures, $level + 1, $count, $tablepath);
170 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
176 return $arrayofmesures;
194 global $langs, $extrafields, $db;
200 return $arrayofxaxis;
203 if (empty($tablepath)) {
204 $tablepath =
$object->table_element.
'='.$tablealias;
206 $tablepath .=
','.$object->table_element.
'='.$tablealias;
209 $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);
210 $MM = substr($langs->trans(
"Month"), 0, 1).substr($langs->trans(
"Month"), 0, 1);
211 $DD = substr($langs->trans(
"Day"), 0, 1).substr($langs->trans(
"Day"), 0, 1);
212 $HH = substr($langs->trans(
"Hour"), 0, 1).substr($langs->trans(
"Hour"), 0, 1);
213 $MI = substr($langs->trans(
"Minute"), 0, 1).substr($langs->trans(
"Minute"), 0, 1);
214 $SS = substr($langs->trans(
"Second"), 0, 1).substr($langs->trans(
"Second"), 0, 1);
223 foreach (
$object->fields as $key => $val) {
224 if (empty($val[
'measure'])) {
225 if (in_array($key, array(
226 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
227 'parent',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
230 if (isset($val[
'enabled']) && ! (
int)
dol_eval((
string) $val[
'enabled'], 1, 1,
'1')) {
233 if (isset($val[
'visible']) && ! (
int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1')) {
236 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
239 if (preg_match(
'/^pass/', $key)) {
242 if (in_array($val[
'type'], array(
'html',
'text'))) {
245 if (in_array($val[
'type'], array(
'timestamp',
'date',
'datetime'))) {
246 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
247 $arrayofxaxis[$tablealias.
'.'.$key.
'-year'] = array(
248 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
')</span>',
249 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
250 'position' => ($position + ($count * 100000)).
'.1',
251 'table' =>
$object->table_element,
252 'tablefromt' => $tablepath
254 $arrayofxaxis[$tablealias.
'.'.$key.
'-month'] = array(
255 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
256 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
257 'position' => ($position + ($count * 100000)).
'.2',
258 'table' =>
$object->table_element,
259 'tablefromt' => $tablepath
261 $arrayofxaxis[$tablealias.
'.'.$key.
'-day'] = array(
262 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
263 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
264 'position' => ($position + ($count * 100000)).
'.3',
265 'table' =>
$object->table_element,
266 'tablefromt' => $tablepath
269 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
270 $arrayofxaxis[$tablealias.
'.'.$key] = array(
271 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
272 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
273 'position' => ($position + ($count * 100000)),
274 'table' =>
$object->table_element,
275 'tablefromt' => $tablepath
282 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
283 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
284 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
287 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
291 if (in_array($extrafields->attributes[
$object->table_element][
'type'][$key], array(
'timestamp',
'date',
'datetime'))) {
292 $position = (empty($extrafields->attributes[
$object->table_element][
'pos'][$key]) ? 0 : intval($extrafields->attributes[
$object->table_element][
'pos'][$key]));
293 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-year'] = array(
294 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
')</span>',
295 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
296 'position' => ($position + ($count * 100000)).
'.1',
297 'table' =>
$object->table_element,
298 'tablefromt' => $tablepath
300 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-month'] = array(
301 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
302 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
303 'position' => ($position + ($count * 100000)).
'.2',
304 'table' =>
$object->table_element,
305 'tablefromt' => $tablepath
307 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-day'] = array(
308 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
309 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
310 'position' => ($position + ($count * 100000)).
'.3',
311 'table' =>
$object->table_element,
312 'tablefromt' => $tablepath
315 $arrayofxaxis[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
316 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
317 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
318 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
319 'table' =>
$object->table_element,
320 'tablefromt' => $tablepath
327 foreach (
$object->fields as $key => $val) {
328 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
329 $tmptype = explode(
':', $val[
'type'], 4);
330 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
331 $newobject = $tmptype[1];
333 if (class_exists($newobject)) {
334 $tmpobject =
new $newobject($db);
337 $arrayofxaxis =
fillArrayOfXAxis($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofxaxis, $level + 1, $count, $tablepath);
339 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
345 return $arrayofxaxis;
363 global $langs, $extrafields, $db;
369 return $arrayofgroupby;
372 if (empty($tablepath)) {
373 $tablepath =
$object->table_element.
'='.$tablealias;
375 $tablepath .=
','.$object->table_element.
'='.$tablealias;
378 $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);
379 $MM = substr($langs->trans(
"Month"), 0, 1).substr($langs->trans(
"Month"), 0, 1);
380 $DD = substr($langs->trans(
"Day"), 0, 1).substr($langs->trans(
"Day"), 0, 1);
381 $HH = substr($langs->trans(
"Hour"), 0, 1).substr($langs->trans(
"Hour"), 0, 1);
382 $MI = substr($langs->trans(
"Minute"), 0, 1).substr($langs->trans(
"Minute"), 0, 1);
383 $SS = substr($langs->trans(
"Second"), 0, 1).substr($langs->trans(
"Second"), 0, 1);
388 foreach (
$object->fields as $key => $val) {
389 if (empty($val[
'isameasure'])) {
390 if (in_array($key, array(
391 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
392 'parent',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
395 if (isset($val[
'enabled']) && ! (
int)
dol_eval((
string) $val[
'enabled'], 1, 1,
'1')) {
398 if (isset($val[
'visible']) && ! (
int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1')) {
401 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
404 if (preg_match(
'/^pass/', $key)) {
407 if (in_array($val[
'type'], array(
'html',
'text'))) {
410 if (in_array($val[
'type'], array(
'timestamp',
'date',
'datetime'))) {
411 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
412 $arrayofgroupby[$tablealias.
'.'.$key.
'-year'] = array(
413 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
')</span>',
414 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
415 'position' => ($position + ($count * 100000)).
'.1',
416 'table' =>
$object->table_element,
417 'tablefromt' => $tablepath
419 $arrayofgroupby[$tablealias.
'.'.$key.
'-month'] = array(
420 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
421 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
422 'position' => ($position + ($count * 100000)).
'.2',
423 'table' =>
$object->table_element,
424 'tablefromt' => $tablepath
426 $arrayofgroupby[$tablealias.
'.'.$key.
'-day'] = array(
427 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
428 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
429 'position' => ($position + ($count * 100000)).
'.3',
430 'table' =>
$object->table_element,
431 'tablefromt' => $tablepath
434 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
435 $arrayofgroupby[$tablealias.
'.'.$key] = array(
436 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
437 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
438 'position' => ($position + ($count * 100000)),
439 'table' =>
$object->table_element,
440 'tablefromt' => $tablepath
447 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
448 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
449 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
452 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
456 if (in_array($extrafields->attributes[
$object->table_element][
'type'][$key], array(
'timestamp',
'date',
'datetime'))) {
457 $position = (empty($extrafields->attributes[
$object->table_element][
'pos'][$key]) ? 0 : intval($extrafields->attributes[
$object->table_element][
'pos'][$key]));
458 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-year'] = array(
459 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
')</span>',
460 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
461 'position' => ($position + ($count * 100000)).
'.1',
462 'table' =>
$object->table_element,
463 'tablefromt' => $tablepath
465 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-month'] = array(
466 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
')</span>',
467 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
468 'position' => ($position + ($count * 100000)).
'.2',
469 'table' =>
$object->table_element,
470 'tablefromt' => $tablepath
472 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key.
'-day'] = array(
473 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val).
' <span class="opacitymedium">('.$YYYY.
'-'.$MM.
'-'.$DD.
')</span>',
474 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
475 'position' => ($position + ($count * 100000)).
'.3',
476 'table' =>
$object->table_element,
477 'tablefromt' => $tablepath
480 $arrayofgroupby[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
481 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
482 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
483 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
484 'table' =>
$object->table_element,
485 'tablefromt' => $tablepath
492 foreach (
$object->fields as $key => $val) {
493 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
494 $tmptype = explode(
':', $val[
'type'], 4);
495 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
496 $newobject = $tmptype[1];
498 if (class_exists($newobject)) {
499 $tmpobject =
new $newobject($db);
502 $arrayofgroupby =
fillArrayOfGroupBy($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayofgroupby, $level + 1, $count, $tablepath);
504 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
510 return $arrayofgroupby;
528 global $langs, $extrafields, $db;
535 if ($level > $MAXLEVEL) {
536 return $arrayoffields;
539 if (empty($tablepath)) {
540 $tablepath =
$object->table_element.
'='.$tablealias;
542 $tablepath .=
','.$object->table_element.
'='.$tablealias;
548 foreach (
$object->fields as $key => $val) {
549 if (empty($val[
'measure'])) {
551 if (in_array($key, array(
552 'id',
'ref_ext',
'rowid',
'entity',
'last_main_doc',
'logo',
'logo_squarred',
'extraparams',
553 'parent',
'pass',
'pass_crypted',
'pass_temp',
'photo',
'socialnetworks',
'webservices_url',
'webservices_key'))) {
556 if (isset($val[
'enabled']) && ! (
int)
dol_eval((
string) $val[
'enabled'], 1, 1,
'1')) {
559 if (isset($val[
'visible']) && ! (
int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1')) {
562 if (preg_match(
'/^fk_/', $key) && !preg_match(
'/^fk_statu/', $key)) {
565 if (preg_match(
'/^pass/', $key)) {
568 if (in_array($val[
'type'], array(
'html',
'text'))) {
572 $position = (empty($val[
'position']) ? 0 : intval($val[
'position']));
573 $arrayoffields[$tablealias.
'.'.$key] = array(
574 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val[
'label']),
575 'labelnohtml' => $labelofobject.
': '.$langs->trans($val[
'label']),
576 'position' => ($position + ($count * 100000)),
577 'table' =>
$object->table_element,
578 'tablefromt' => $tablepath,
579 'type' => $val[
'type']
581 if (!empty($val[
'arrayofkeyval'])) {
582 $arrayoffields[$tablealias.
'.'.$key][
'arrayofkeyval'] = $val[
'arrayofkeyval'];
584 if ((!isset($val[
'isamesaure']) || $val[
'isamesaure'] != 1) && (!isset($val[
'notnull']) || $val[
'notnull'] !=
'1')) {
585 $arrayoffields[$tablealias.
'.'.$key][
'maybenull'] = 1;
591 if (!empty(
$object->isextrafieldmanaged) && isset($extrafields->attributes[
$object->table_element][
'label'])) {
592 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
593 if ($extrafields->attributes[
$object->table_element][
'type'][$key] ==
'separate') {
596 if (!empty($extrafields->attributes[
$object->table_element][
'totalizable'][$key])) {
600 $arrayoffields[preg_replace(
'/^t/',
'te', $tablealias).
'.'.$key] = array(
601 'label' =>
img_picto(
'', (empty(
$object->picto) ?
'generic' :
$object->picto),
'class="pictofixedwidth"').
' '.$labelofobject.
': '.$langs->trans($val),
602 'labelnohtml' => $labelofobject.
': '.$langs->trans($val),
603 'position' => 1000 + (int) $extrafields->attributes[
$object->table_element][
'pos'][$key] + ($count * 100000),
604 'table' =>
$object->table_element,
605 'tablefromt' => $tablepath,
606 'type' => $extrafields->attributes[
$object->table_element][
'type'][$key],
612 foreach (
$object->fields as $key => $val) {
613 if (preg_match(
'/^[^:]+:[^:]+:/', $val[
'type'])) {
614 $tmptype = explode(
':', $val[
'type'], 4);
615 if ($tmptype[0] ==
'integer' && $tmptype[1] && $tmptype[2]) {
616 $newobject = $tmptype[1];
618 if (class_exists($newobject)) {
619 $tmpobject =
new $newobject($db);
621 if (!empty($val[
'nodepth'])) {
622 $arrayoffields =
fillArrayOfFilterFields($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayoffields, $MAXLEVEL, $count, $tablepath);
624 $arrayoffields =
fillArrayOfFilterFields($tmpobject, $tablealias.
'__'.$key, $langs->trans($val[
'label']), $arrayoffields, $level + 1, $count, $tablepath);
627 print
'For property '.$object->element.
'->'.$key.
', type="'.$val[
'type'].
'": Failed to find class '.$newobject.
" in file ".$tmptype[2].
"<br>\n";
633 return $arrayoffields;
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)