new:advanced permissions to validate and unvalidate interventions
This commit is contained in:
parent
b31fd917ab
commit
f9162aa444
@ -131,6 +131,22 @@ class modFicheinter extends DolibarrModules
|
||||
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
||||
$this->rights[$r][5] = 'send';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 69;
|
||||
$this->rights[$r][1] = 'Valider les fiches d\'intervention ';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
||||
$this->rights[$r][5] = 'validate';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 70;
|
||||
$this->rights[$r][1] = 'Dévalider les fiches d\'intervention';
|
||||
$this->rights[$r][2] = 'a';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
||||
$this->rights[$r][5] = 'unvalidate';
|
||||
|
||||
//Exports
|
||||
//--------
|
||||
$r=1;
|
||||
|
||||
@ -1660,17 +1660,17 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($user->societe_id == 0)
|
||||
{
|
||||
if ($action != 'editdescription' && ($action != 'presend'))
|
||||
{
|
||||
// Validate
|
||||
if ($object->statut == 0 && $user->rights->ficheinter->creer && (count($object->lines) > 0 || ! empty($conf->global->FICHINTER_DISABLE_DETAILS)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=validate"';
|
||||
print '>'.$langs->trans("Validate").'</a></div>';
|
||||
}
|
||||
if ($action != 'editdescription' && ($action != 'presend')) {
|
||||
// Validate
|
||||
if ($object->statut == 0 && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=validate"';
|
||||
print '>' . $langs->trans("Validate") . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Modify
|
||||
if ($object->statut == 1 && $user->rights->ficheinter->creer)
|
||||
// Modify
|
||||
if ($object->statut == 1 && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->unvalidate)))
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&action=modify">';
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user