Better management of hidden option HOLIDAY_HIDE_BALANCE
This commit is contained in:
parent
eb03fb7540
commit
e0164884ee
@ -831,6 +831,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
elseif(! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||||
|
{
|
||||||
|
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
|
||||||
|
}
|
||||||
|
|
||||||
dol_fiche_head();
|
dol_fiche_head();
|
||||||
|
|
||||||
|
|||||||
@ -130,27 +130,34 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
|
|
||||||
if (! empty($conf->holiday->enabled))
|
if (! empty($conf->holiday->enabled))
|
||||||
{
|
{
|
||||||
$user_id = $user->id;
|
if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||||
|
{
|
||||||
|
$user_id = $user->id;
|
||||||
|
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("Holidays").'</th></tr>';
|
||||||
print "<tr ".$bc[0].">";
|
print "<tr ".$bc[0].">";
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
|
||||||
$out='';
|
$out='';
|
||||||
$typeleaves=$holiday->getTypes(1,1);
|
$typeleaves=$holiday->getTypes(1,1);
|
||||||
foreach($typeleaves as $key => $val)
|
foreach($typeleaves as $key => $val)
|
||||||
{
|
{
|
||||||
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
||||||
$nb_holiday += $nb_type;
|
$nb_holiday += $nb_type;
|
||||||
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
|
$out .= ' - '.$val['label'].': <strong>'.($nb_type?price2num($nb_type):0).'</strong><br>';
|
||||||
}
|
}
|
||||||
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
|
print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'<br>';
|
||||||
print $out;
|
print $out;
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</table><br>';
|
print '</table><br>';
|
||||||
|
}
|
||||||
|
elseif (! is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||||
|
{
|
||||||
|
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user