mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 03:12:35 +01:00
Fix test to cancel holiday
This commit is contained in:
@@ -1541,7 +1541,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
|
||||
// Button Cancel (because we can't approve)
|
||||
if ($cancreate || $cancreateall) {
|
||||
if (($object->date_debut > dol_now()) || !empty($user->admin)) {
|
||||
if (($object->date_fin > dol_now()) || !empty($user->admin)) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
} else {
|
||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("HolidayStarted").'-'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
@@ -1551,7 +1551,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_APPROVED) { // If validated and approved
|
||||
if ($user->id == $object->fk_validator || $user->id == $object->fk_user_approve || $cancreate || $cancreateall) {
|
||||
if (($object->date_debut > dol_now()) || !empty($user->admin) || $user->id == $object->fk_user_approve) {
|
||||
if (($object->date_fin > dol_now()) || !empty($user->admin) || $user->id == $object->fk_user_approve) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
} else {
|
||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("HolidayStarted").'-'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
|
||||
Reference in New Issue
Block a user