Qual: Move unvalidate permission as an advanced permission to keep list of permission for a default usage uniform between modules.

This commit is contained in:
Laurent Destailleur 2011-05-12 21:50:53 +00:00
parent fc409cf315
commit 73afd45d1a
2 changed files with 4 additions and 3 deletions

View File

@ -340,7 +340,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v
}
// Repasse la facture en mode brouillon (unvalidate)
if ($action == 'modif' && $user->rights->facture->unvalidate)
if ($action == 'modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
{
$object->fetch($id);
$object->fetch_thirdparty();
@ -2580,7 +2580,7 @@ else
{
if (! $objectidnext)
{
if ($user->rights->facture->unvalidate)
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=modif">'.$langs->trans('Modify').'</a>';
}

View File

@ -131,7 +131,8 @@ class modFacture extends DolibarrModules
$this->rights[$r][1] = 'Dévalider les factures';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'unvalidate';
$this->rights[$r][4] = 'invoice_advance';
$this->rights[$r][5] = 'unvalidate';
$r++;
$this->rights[$r][0] = 14;