mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Add std deviation in custom report
This commit is contained in:
parent
982c356493
commit
40aca2803f
|
|
@ -788,6 +788,9 @@ if (!empty($search_measures) && !empty($search_xaxis)) {
|
|||
} elseif (preg_match('/\-max$/', $val)) {
|
||||
$tmpval = preg_replace('/\-max$/', '', $val);
|
||||
$sql .= "MAX(".$db->ifsql($tmpval.' IS NULL', '0', $tmpval).") as y_".$key.", ";
|
||||
} elseif (preg_match('/\-stddevpop$/', $val)) {
|
||||
$tmpval = preg_replace('/\-stddevpop$/', '', $val);
|
||||
$sql .= "STDDEV_POP(".$db->ifsql($tmpval.' IS NULL', '0', $tmpval).") as y_".$key.", ";
|
||||
}
|
||||
}
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
|
|
|||
|
|
@ -97,15 +97,13 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
|
|||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$arrayofmesures[$tablealias.'.'.$key.'-stddevpop'] = array(
|
||||
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
|
||||
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
|
||||
'position' => ($position + ($count * 100000)).'.5',
|
||||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
}
|
||||
$arrayofmesures[$tablealias.'.'.$key.'-stddevpop'] = array(
|
||||
'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("StandardDeviationPop").')</span>',
|
||||
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
|
||||
'position' => ($position + ($count * 100000)).'.5',
|
||||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
}
|
||||
}
|
||||
// Add extrafields to Measures
|
||||
|
|
@ -142,15 +140,13 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
|
|||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-stddevpop'] = array(
|
||||
'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>',
|
||||
'labelnohtml' => $labelofobject.': '.$langs->trans($val),
|
||||
'position' => ($position + ($count * 100000)).'.5',
|
||||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
}
|
||||
$arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-stddevpop'] = array(
|
||||
'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>',
|
||||
'labelnohtml' => $labelofobject.': '.$langs->trans($val),
|
||||
'position' => ($position + ($count * 100000)).'.5',
|
||||
'table' => $object->table_element,
|
||||
'tablefromt' => $tablepath
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user