FIX: holiday list: only mass delete if leave request is not in draft, canceled or refused, like in card
This commit is contained in:
parent
efb9d184e4
commit
1361abffe5
@ -1280,6 +1280,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
|
||||||
|
$nbignored++;
|
||||||
|
setEventMessage($langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
|
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
|
||||||
|
|||||||
@ -132,3 +132,4 @@ FreeLegalTextOnHolidays=Free text on PDF
|
|||||||
WatermarkOnDraftHolidayCards=Watermarks on draft leave requests
|
WatermarkOnDraftHolidayCards=Watermarks on draft leave requests
|
||||||
HolidaysToApprove=Holidays to approve
|
HolidaysToApprove=Holidays to approve
|
||||||
NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays
|
NobodyHasPermissionToValidateHolidays=Nobody has permission to validate holidays
|
||||||
|
ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=Leave request %s must be draft, canceled or refused to be deleted
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user