From 66dafbd201d620f748f6d9ccf0f01930162fc1f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Dec 2008 14:31:47 +0000 Subject: [PATCH] Show greyed lines for not allowed export filters --- htdocs/exports/export.class.php | 10 ++++++---- htdocs/exports/export.php | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/exports/export.class.php b/htdocs/exports/export.class.php index 97e5469dea3..3bd0d087680 100644 --- a/htdocs/exports/export.class.php +++ b/htdocs/exports/export.class.php @@ -112,11 +112,11 @@ class Export $bool=$user->rights->$perm[0]->$perm[1]; } if ($perm[0]=='user' && $user->admin) $bool=true; - //print("$bool
"); + //print $bool." $perm[0]"."
"; // 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++; - } +// } } } } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 60c5d909fbb..cca355119a8 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -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 ''; - print ''.img_picto($langs->trans("NewExport"),'filenew').''; - print ''; + if ($objexport->array_export_perms[$key]) + { + print ''.img_picto($langs->trans("NewExport"),'filenew').''; + } + else + { + print $langs->trans("NotEnoughPermissions"); + } + print ''; } } else