diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index fd0fb2eb91e..ac38a130bfa 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -467,22 +467,24 @@ if (empty($reshook)) { $message .= $langs->transnoentities("HolidaysToValidateBody")."\n"; - $delayForRequest = $object->getConfCP('delayForRequest'); - //$delayForRequest = $delayForRequest * (60*60*24); - - $nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd'); // option to warn the validator in case of too short delay - if ($object->getConfCP('AlertValidatorDelay')) { - if ($object->date_debut < $nextMonth) { - $message .= "\n"; - $message .= $langs->transnoentities("HolidaysToValidateDelay", $object->getConfCP('delayForRequest'))."\n"; + if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_TOO_LOW_DELAY)) { + $delayForRequest = 0; // TODO Set delay depending of holiday leave type + if ($delayForRequest) { + $nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd'); + + if ($object->date_debut < $nowplusdelay) { + $message .= "\n"; + $message .= $langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."\n"; + } } } // option to notify the validator if the balance is less than the request - if ($object->getConfCP('AlertValidatorSolde')) { + if (empty($conf->global->HOLIDAY_HIDE_APPROVER_ABOUT_NEGATIVE_BALANCE)) { $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); + if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) { $message .= "\n"; $message .= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n"; @@ -925,12 +927,6 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { } - $delayForRequest = $object->getConfCP('delayForRequest', 1); - //$delayForRequest = $delayForRequest * (60*60*24); - - $nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd'); - - print '