mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: use bad object
This commit is contained in:
parent
5a20fa8169
commit
9924b2f17d
|
|
@ -147,7 +147,6 @@ foreach ($modulesdir as $dir)
|
|||
|
||||
$db->commit();
|
||||
|
||||
|
||||
// Affiche lignes des permissions
|
||||
$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
|
|
@ -159,10 +158,11 @@ $sql.= " ORDER BY r.module, r.id";
|
|||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$var=True;
|
||||
$old = "";
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$var = True;
|
||||
$oldmod = "";
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
|
@ -176,7 +176,7 @@ if ($result)
|
|||
|
||||
// Check if permission we found is inside a module definition. If not, we discard it.
|
||||
$found=false;
|
||||
foreach($objMod->rights as $key => $val)
|
||||
foreach($modules[$obj->module]->rights as $key => $val)
|
||||
{
|
||||
$rights_class=$objMod->rights_class;
|
||||
if ($val[4] == $obj->perms && (empty($val[5]) || $val[5] == $obj->subperms))
|
||||
|
|
@ -190,12 +190,13 @@ if ($result)
|
|||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Break found, it's a new module to catch
|
||||
if ($old <> $obj->module)
|
||||
if ($oldmod <> $obj->module)
|
||||
{
|
||||
$objMod=$modules[$obj->module];
|
||||
$picto=($objMod->picto?$objMod->picto:'generic');
|
||||
$oldmod = $obj->module;
|
||||
$objMod = $modules[$obj->module];
|
||||
$picto = ($objMod->picto?$objMod->picto:'generic');
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
|
|
@ -203,7 +204,6 @@ if ($result)
|
|||
print '<td align="center">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
$old = $obj->module;
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user