diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 542aac2679a..78322b2ecd2 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -22,7 +22,7 @@ /** * \file htdocs/comm/action/document.php * \ingroup agenda - * \brief Page des documents joints sur les actions + * \brief Page of documents linked to actions */ require("../../main.inc.php"); @@ -40,7 +40,7 @@ $langs->load("other"); $langs->load("bills"); if (isset($_GET["error"])) $error=$_GET["error"]; -$objectid = isset($_GET["id"])?$_GET["id"]:''; +$objectid = GETPOST("id"); // Security check if ($user->societe_id > 0) @@ -132,9 +132,7 @@ if ($objectid > 0) $author->fetch($act->author->id); $act->author=$author; - $contact=new Contact($db); - $contact->fetch($act->contact->id); - $act->contact=$contact; + if ($act->contact->id) $act->fetch_contact($act->contact->id); $head=actions_prepare_head($act); dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');