Merge pull request #4699 from bafbes/abb-11
new:advanced permissions to validate and unvalidate interventions
This commit is contained in:
commit
f96511e187
@ -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][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
|
||||||
$this->rights[$r][5] = 'send';
|
$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
|
//Exports
|
||||||
//--------
|
//--------
|
||||||
$r=1;
|
$r=1;
|
||||||
|
|||||||
@ -1660,17 +1660,17 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
if ($user->societe_id == 0)
|
if ($user->societe_id == 0)
|
||||||
{
|
{
|
||||||
if ($action != 'editdescription' && ($action != 'presend'))
|
if ($action != 'editdescription' && ($action != 'presend')) {
|
||||||
{
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && $user->rights->ficheinter->creer && (count($object->lines) > 0 || ! empty($conf->global->FICHINTER_DISABLE_DETAILS)))
|
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 '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=validate"';
|
||||||
print '>'.$langs->trans("Validate").'</a></div>';
|
print '>' . $langs->trans("Validate") . '</a></div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if ($object->statut == 1 && $user->rights->ficheinter->creer)
|
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">';
|
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");
|
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) print $langs->trans("Modify");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user