Fix: Permission edition
This commit is contained in:
parent
d5ab0d536d
commit
adac87c322
@ -98,7 +98,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
|||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
if ($objMod->rights_class) {
|
if ($objMod->rights_class) {
|
||||||
|
|
||||||
$ret=$objMod->insert_permissions();
|
$ret=$objMod->insert_permissions(0);
|
||||||
|
|
||||||
$modules[$objMod->rights_class]=$objMod;
|
$modules[$objMod->rights_class]=$objMod;
|
||||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||||
|
|||||||
@ -790,9 +790,14 @@ else
|
|||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&id='.$mil->id.'">'.$langs->trans("TestMailing").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&id='.$mil->id.'">'.$langs->trans("TestMailing").'</a>';
|
||||||
|
|
||||||
if ($mil->statut == 0 && $user->rights->mailing->valider)
|
if ($mil->statut == 0)
|
||||||
{
|
{
|
||||||
if ($mil->nbemail > 0)
|
print $user->rights->mailing->valider;
|
||||||
|
if (empty($user->rights->mailing->valider))
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoPermission")).'">'.$langs->trans("ValidMailing").'</a>';
|
||||||
|
}
|
||||||
|
else if ($mil->nbemail > 0)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=valide&id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=valide&id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,8 +99,8 @@ class DolibarrModules
|
|||||||
// Insere les boites dans llx_boxes_def
|
// Insere les boites dans llx_boxes_def
|
||||||
if (! $err && $options != 'noboxes') $err+=$this->insert_boxes();
|
if (! $err && $options != 'noboxes') $err+=$this->insert_boxes();
|
||||||
|
|
||||||
// Insere les permissions associees au module actif dans llx_rights_def
|
// Insert permission definitions of module into llx_rights_def. If user is admin, grant this permission to user.
|
||||||
if (! $err) $err+=$this->insert_permissions();
|
if (! $err) $err+=$this->insert_permissions(1);
|
||||||
|
|
||||||
// Insere les constantes associees au module dans llx_const
|
// Insere les constantes associees au module dans llx_const
|
||||||
if (! $err) $err+=$this->insert_menus();
|
if (! $err) $err+=$this->insert_menus();
|
||||||
|
|||||||
@ -443,10 +443,11 @@ class User extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Vide la tableau des droits de l'utilisateur
|
* \brief Clear all permissions array of user
|
||||||
*/
|
*/
|
||||||
function clearrights()
|
function clearrights()
|
||||||
{
|
{
|
||||||
|
dol_syslog("User::clearrights reset user->rights");
|
||||||
$this->rights='';
|
$this->rights='';
|
||||||
$this->all_permissions_are_loaded=false;
|
$this->all_permissions_are_loaded=false;
|
||||||
$this->tab_loaded=array();
|
$this->tab_loaded=array();
|
||||||
|
|||||||
@ -103,7 +103,7 @@ if ($_GET["id"])
|
|||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
if ($objMod->rights_class) {
|
if ($objMod->rights_class) {
|
||||||
|
|
||||||
$ret=$objMod->insert_permissions();
|
$ret=$objMod->insert_permissions(0);
|
||||||
|
|
||||||
$modules[$objMod->rights_class]=$objMod;
|
$modules[$objMod->rights_class]=$objMod;
|
||||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||||
|
|||||||
@ -113,7 +113,7 @@ dol_fiche_head($head, 'rights', $title, 0, 'user');
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Charge les modules soumis a permissions
|
// Search all modules with permission and reload permissions def.
|
||||||
$modules = array();
|
$modules = array();
|
||||||
|
|
||||||
$listdir=$conf->file->dol_document_root;
|
$listdir=$conf->file->dol_document_root;
|
||||||
@ -134,7 +134,7 @@ foreach($listdir as $dirroot)
|
|||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
if ($objMod->rights_class) {
|
if ($objMod->rights_class) {
|
||||||
|
|
||||||
$ret=$objMod->insert_permissions();
|
$ret=$objMod->insert_permissions(0);
|
||||||
|
|
||||||
$modules[$objMod->rights_class]=$objMod;
|
$modules[$objMod->rights_class]=$objMod;
|
||||||
//print "modules[".$objMod->rights_class."]=$objMod;";
|
//print "modules[".$objMod->rights_class."]=$objMod;";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user