Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
This commit is contained in:
commit
4200f2f195
@ -773,7 +773,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// If status pending validation and validator = validator or user, or rights to do for others
|
// If status pending validation and validator = validator or user, or rights to do for others
|
||||||
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) &&
|
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) &&
|
||||||
(!empty($user->admin) || $user->id == $object->fk_validator || in_array($object->fk_user, $childids) || $cancreateall)) {
|
(!empty($user->admin) || $user->id == $object->fk_validator || $cancreate || $cancreateall)) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$oldstatus = $object->statut;
|
$oldstatus = $object->statut;
|
||||||
@ -1471,7 +1471,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotTheAssignedApprover").'">'.$langs->trans("ActionRefuseCP").'</a>';
|
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotTheAssignedApprover").'">'.$langs->trans("ActionRefuseCP").'</a>';
|
||||||
|
|
||||||
// Button Cancel (because we can't approve)
|
// Button Cancel (because we can't approve)
|
||||||
if (in_array($object->fk_user, $childids) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->holiday->writeall_advance))) {
|
if ($cancreate || $cancreateall) {
|
||||||
if (($object->date_debut > dol_now()) || !empty($user->admin)) {
|
if (($object->date_debut > dol_now()) || !empty($user->admin)) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||||
} else {
|
} else {
|
||||||
@ -1480,15 +1480,15 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($object->statut == Holiday::STATUS_APPROVED) { // If validated or approved
|
if ($object->statut == Holiday::STATUS_APPROVED) { // If validated and approved
|
||||||
if ($user->id == $object->fk_validator || in_array($object->fk_user, $childids) || $cancreateall) {
|
if ($user->id == $object->fk_validator || $cancreate || $cancreateall) {
|
||||||
if (($object->date_debut > dol_now()) || !empty($user->admin)) {
|
if (($object->date_debut > dol_now()) || !empty($user->admin)) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("HolidayStarted").'-'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("HolidayStarted").'-'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
||||||
}
|
}
|
||||||
} else { // I have no rights on the user of the holiday.
|
} else { // I have no rights on the user of the holiday.
|
||||||
if (!empty($user->admin)) { // If current validator can't cancel an approved leave, we allow admin user
|
if (!empty($user->admin)) { // If current approver can't cancel an approved leave, we allow admin user
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
print '<a href="#" class="butActionRefused classfortooltip" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ActionCancelCP").'</a>';
|
||||||
@ -1496,7 +1496,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cancreate && $object->statut == Holiday::STATUS_CANCELED) {
|
if (($cancreate || $cancreateall) && $object->statut == Holiday::STATUS_CANCELED) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
||||||
}
|
}
|
||||||
if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) { // If draft or canceled or refused
|
if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) { // If draft or canceled or refused
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user