diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index 112ffc8d5b7..98f97325c40 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -36,12 +36,8 @@ if (defined("FICHEINTER_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/mod
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/ficheinter/".FICHEINTER_ADDON.".php");
}
-// Sécurité accés client
-if ($user->societe_id > 0)
-{
- $action = '';
- $socidp = $user->societe_id;
-}
+$user->getrights("ficheinter");
+if (!$user->rights->ficheinter->lire) accessforbidden();
if ($_GET["socidp"])
@@ -50,6 +46,13 @@ if ($_GET["socidp"])
$objsoc->fetch($_GET["socidp"]);
}
+// Sécurité accés client
+if ($user->societe_id > 0)
+{
+ $action = '';
+ $socidp = $user->societe_id;
+}
+
/*
* Traitements des actions
@@ -94,15 +97,14 @@ if ($_POST["action"] == 'update')
$_GET["id"]=$_POST["id"]; // Force raffraichissement sur fiche venant d'etre créée
}
-/**
- * Generation du pdf
- */
+// Generation du pdf
if ($_GET["action"] == 'generate' && $_GET["id"])
{
- fichinter_pdf_create($db, $_GET["id"]);
+ fichinter_pdf_create($db, $_GET["id"], $_POST['model']);
}
+
llxHeader();
$sel = new Form($db);
@@ -164,7 +166,7 @@ if ($_GET["action"] == 'create')
if ($conf->projet->enabled)
{
- // Projet associ
+ // Projet associe
$langs->load("project");
print '
| '.$langs->trans("Project").' | |