diff --git a/htdocs/comm/action/fiche.php3 b/htdocs/comm/action/fiche.php3 index f4bfa4bb7d6..16ee14c4108 100644 --- a/htdocs/comm/action/fiche.php3 +++ b/htdocs/comm/action/fiche.php3 @@ -39,7 +39,7 @@ if ($user->societe_id > 0) * * */ -if ($action=='add_action') +if ($HTTP_POST_VARS["action"] == 'add_action') { if ($contactid) { @@ -51,8 +51,10 @@ if ($action=='add_action') if ($HTTP_POST_VARS["afaire"] <> 1) { - $actioncomm = new ActionComm($db); + + $actioncomm->priority = 2; + $actioncomm->type = $HTTP_POST_VARS["actionid"]; $actioncomm->date = $db->idate(mktime($HTTP_POST_VARS["achour"], $HTTP_POST_VARS["acmin"], @@ -61,7 +63,7 @@ if ($action=='add_action') $HTTP_POST_VARS["acday"], $HTTP_POST_VARS["acyear"]) ); - if ($actionid == 5) + if ($HTTP_POST_VARS["actionid"] == 5) { $actioncomm->percent = 0; } @@ -69,8 +71,7 @@ if ($action=='add_action') { $actioncomm->percent = 100; } - $actioncomm->priority = 2; - $actioncomm->type = $actionid; + $actioncomm->contact = $contactid; $actioncomm->user = $user; @@ -85,7 +86,7 @@ if ($action=='add_action') { $todo = new ActionComm($db); - $todo->type = $actionid; + $todo->type = $HTTP_POST_VARS["nextactionid"]; $todo->date = $db->idate(mktime(12,0,0,$remonth, $reday, $reyear)); $todo->libelle = $todo_label; $todo->priority = 2; @@ -164,18 +165,20 @@ if ($action=='create') } $societe = new Societe($db); $societe->get_nom($socid); - + + print '