pheras
March 18, 2022, 9:46am
1
Good Morning for Everyone,
I’m having problems with the hours value because workers can see each others salary per hour. I have limited people seeing others cards but on projects when people take task and insert their hours people can see others salary per hour.
Any idea on how the problem could be solved will be grateful.
Thx for the help
Hi
You can change the code of /projet/tasks/time.php from
// Value spent
if (!empty($arrayfields['value']['checked'])) {
$langs->load("salaries");
print '<td class="nowraponall right">';
$value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1);
print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
print price($value, 1, $langs, 1, -1, -1, $conf->currency);
print '</span>';
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'value';
}
$totalarray['val']['value'] += $value;
if (!$i) {
$totalarray['totalvaluefield'] = $totalarray['nbfield'];
}
$totalarray['totalvalue'] += $value;
}
to
// Value spent
if (!empty($arrayfields['value']['checked'])) {
$langs->load("salaries");
print '<td class="nowraponall right">';
$value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1);
if (!empty($user->rights->salaries->readall)) {
print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">';
print price($value, 1, $langs, 1, -1, -1, $conf->currency);
print '</span>';
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = 'value';
}
$totalarray['val']['value'] += $value;
if (!$i) {
$totalarray['totalvaluefield'] = $totalarray['nbfield'];
}
$totalarray['totalvalue'] += $value;}
}
And people can see the salary per hour if they have the permission to see salaries of all people .
2 Likes