|
@@ -1559,7 +1559,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>';
|
|
@@ -1569,7 +1569,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>';
|