Parcourir la source

Fix: Can't add user

Laurent Destailleur il y a 11 ans
Parent
commit
da0aebb2e9
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      htdocs/projet/tasks/contact.php

+ 2 - 1
htdocs/projet/tasks/contact.php

@@ -61,7 +61,8 @@ if ($action == 'addcontact' && $user->rights->projet->creer)
 
     if ($result > 0 && $id > 0)
     {
-  		$result = $object->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]);
+    	$idfortaskuser=GETPOST("contactid")>0?GETPOST("contactid"):GETPOST("userid");
+  		$result = $object->add_contact($idfortaskuser, GETPOST("type"), GETPOST("source"));
     }
 
 	if ($result >= 0)