FIX User approver not visible on holiday
This commit is contained in:
parent
0f9dd0b04a
commit
9048c99478
@ -1150,7 +1150,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
$approverexpected = new User($db);
|
$approverexpected = new User($db);
|
||||||
$approverexpected->fetch($object->fk_validator);
|
$approverexpected->fetch($object->fk_validator); // Use that should be the approver
|
||||||
|
|
||||||
$userRequest = new User($db);
|
$userRequest = new User($db);
|
||||||
$userRequest->fetch($object->fk_user);
|
$userRequest->fetch($object->fk_user);
|
||||||
@ -1364,21 +1364,23 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||||
$approverdone = new User($db);
|
if ($object->fk_user_approve > 0) {
|
||||||
$approverdone->fetch($object->fk_user_valid);
|
$approverdone = new User($db);
|
||||||
print $approverdone->getNomUrl(-1);
|
$approverdone->fetch($object->fk_user_approve);
|
||||||
|
print $approverdone->getNomUrl(-1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print $approverexpected->getNomUrl(-1);
|
print $approverexpected->getNomUrl(-1);
|
||||||
}
|
}
|
||||||
$include_users = $object->fetch_users_approver_holiday();
|
$include_users = $object->fetch_users_approver_holiday();
|
||||||
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) {
|
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) {
|
||||||
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator&token='.newToken().'">'.img_edit($langs->trans("Edit")).'</a>';
|
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
|
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>'; // Will be approved by
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$include_users = $object->fetch_users_approver_holiday();
|
$include_users = $object->fetch_users_approver_holiday();
|
||||||
if (!in_array($object->fk_validator, $include_users)) { // Add the current validator to the list to not lose it when editing.
|
if (!in_array($object->fk_validator, $include_users)) { // Add the current validator to the list to not lose it when editing.
|
||||||
|
|||||||
@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
|
|||||||
$sensitiveget = false;
|
$sensitiveget = false;
|
||||||
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) {
|
||||||
// All GET actions and mass actions are processed as sensitive.
|
// All GET actions and mass actions are processed as sensitive.
|
||||||
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate
|
if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage'))) { // We exclude the case action='create' and action='file_manager' that are legitimate
|
||||||
$sensitiveget = true;
|
$sensitiveget = true;
|
||||||
}
|
}
|
||||||
} elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) {
|
} elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user