Show greyed lines for not allowed export filters

This commit is contained in:
Laurent Destailleur 2008-12-08 14:31:47 +00:00
parent 48f0215e96
commit 66dafbd201
2 changed files with 15 additions and 6 deletions

View File

@ -112,11 +112,11 @@ class Export
$bool=$user->rights->$perm[0]->$perm[1];
}
if ($perm[0]=='user' && $user->admin) $bool=true;
//print("$bool<br>");
//print $bool." $perm[0]"."<br>";
// Permissions ok
if ($bool)
{
// if ($bool)
// {
// Charge fichier lang en rapport
$langtoload=$module->getLangFilesArray();
if (is_array($langtoload))
@ -129,6 +129,8 @@ class Export
// Module
$this->array_export_module[$i]=$module;
// Permission
$this->array_export_perms[$i]=$bool;
// Icon
$this->array_export_icon[$i]=(isset($module->export_icon[$r])?$module->export_icon[$r]:$module->picto);
// Code du dataset export
@ -151,7 +153,7 @@ class Export
dolibarr_syslog("Export loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".sizeof($module->export_fields_code[$r]));
$i++;
}
// }
}
}
}

View File

@ -292,8 +292,15 @@ if ($step == 1 || ! $datatoexport)
print img_object($objexport->array_export_module[$key]->getName(),$objexport->array_export_icon[$key]).' ';
print $objexport->array_export_label[$key];
print '</td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
print '</td></tr>';
if ($objexport->array_export_perms[$key])
{
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
}
else
{
print $langs->trans("NotEnoughPermissions");
}
print '</td></tr>';
}
}
else