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
|
// Close as accepted/refused
|
||||||
if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) {
|
if ($object->statut == Propal::STATUS_VALIDATED) {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
if ($usercanclose) {
|
||||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
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
|
// Clone
|
||||||
|
|||||||
@ -114,7 +114,11 @@ if (!$sortorder) $sortorder = 'DESC';
|
|||||||
$permissiontoread = $user->rights->propal->lire;
|
$permissiontoread = $user->rights->propal->lire;
|
||||||
$permissiontoadd = $user->rights->propal->write;
|
$permissiontoadd = $user->rights->propal->write;
|
||||||
$permissiontodelete = $user->rights->propal->supprimer;
|
$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
|
// Security check
|
||||||
$module = 'propal';
|
$module = 'propal';
|
||||||
|
|||||||
@ -157,7 +157,8 @@ class modPropale extends DolibarrModules
|
|||||||
$this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission
|
$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][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][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++;
|
$r++;
|
||||||
$this->rights[$r][0] = 27; // id de la permission
|
$this->rights[$r][0] = 27; // id de la permission
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user