FIX permission to close a proposal when using advanced permissions
This commit is contained in:
parent
51456741d9
commit
5b34ea6c22
@ -2520,9 +2520,14 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Close as accepted/refused
|
||||
if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
if ($object->statut == Propal::STATUS_VALIDATED) {
|
||||
if ($usercanclose) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Clone
|
||||
|
||||
@ -114,7 +114,11 @@ if (!$sortorder) $sortorder = 'DESC';
|
||||
$permissiontoread = $user->rights->propal->lire;
|
||||
$permissiontoadd = $user->rights->propal->write;
|
||||
$permissiontodelete = $user->rights->propal->supprimer;
|
||||
$permissiontoclose = $user->rights->propal->cloturer;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$permissiontoclose = $user->rights->propale->propal_advance->close;
|
||||
} else {
|
||||
$permissiontoclose = $user->rights->propal->creer;
|
||||
}
|
||||
|
||||
// Security check
|
||||
$module = 'propal';
|
||||
|
||||
@ -157,7 +157,8 @@ class modPropale extends DolibarrModules
|
||||
$this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'cloturer';
|
||||
$this->rights[$r][4] = 'propal_advance';
|
||||
$this->rights[$r][5] = 'close';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 27; // id de la permission
|
||||
|
||||
Loading…
Reference in New Issue
Block a user