diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index fec9b2e0421..ad5c864b9cc 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -35,7 +35,12 @@ $langs->load("orders"); $langs->load("sendings"); $langs->load("companies"); -$id = isset($_GET["id"])?$_GET["id"]:''; +$id=GETPOST('id'); +$ligne=GETPOST('ligne'); +$lineid=GETPOST('lineid'); +$action=GETPOST('action'); + +$id = isset($id)?$id:''; // Security check if ($user->societe_id) $socid=$user->societe_id; @@ -51,9 +56,9 @@ if ($_POST["action"] == 'addcontact' && $user->rights->propale->creer) $result = 0; $propal = new Propal($db); - $result = $propal->fetch($_GET["id"]); + $result = $propal->fetch($id); - if ($result > 0 && $_GET["id"] > 0) + if ($result > 0 && $id > 0) { $result = $propal->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]); } @@ -80,7 +85,7 @@ if ($_POST["action"] == 'addcontact' && $user->rights->propale->creer) if ($_POST["action"] == 'updateligne' && $user->rights->propale->creer) { $propal = new Propal($db); - if ($propal->fetch($_GET["id"])) + if ($propal->fetch($id)) { $contact = $propal->detail_contact($_POST["elrowid"]); $type = $_POST["type"]; @@ -102,16 +107,16 @@ if ($_POST["action"] == 'updateligne' && $user->rights->propale->creer) } // bascule du statut d'un contact -if ($_GET["action"] == 'swapstatut' && $user->rights->propale->creer) +if ($action == 'swapstatut' && $user->rights->propale->creer) { $propal = new Propal($db); - if ($propal->fetch($_GET["id"])) + if ($propal->fetch($id)) { - $contact = $propal->detail_contact($_GET["ligne"]); + $contact = $propal->detail_contact($ligne); $id_type_contact = $contact->fk_c_type_contact; $statut = ($contact->statut == 4) ? 5 : 4; - $result = $propal->update_contact($_GET["ligne"], $statut, $id_type_contact); + $result = $propal->update_contact($ligne, $statut, $id_type_contact); if ($result >= 0) { $db->commit(); @@ -127,11 +132,11 @@ if ($_GET["action"] == 'swapstatut' && $user->rights->propale->creer) } // Efface un contact -if ($_GET["action"] == 'deleteline' && $user->rights->propale->creer) +if ($action == 'deleteline' && $user->rights->propale->creer) { $propal = new Propal($db); - $propal->fetch($_GET["id"]); - $result = $propal->delete_contact($_GET["lineid"]); + $propal->fetch($id); + $result = $propal->delete_contact($lineid); if ($result >= 0) { @@ -163,8 +168,8 @@ $userstatic=new User($db); /* *************************************************************************** */ if (isset($mesg)) print $mesg; -$id = $_GET["id"]; -$ref= $_GET["ref"]; +$id = $id; +$ref= GETPOST('ref'); if ($id > 0 || ! empty($ref)) { $propal = New Propal($db); @@ -222,7 +227,7 @@ if ($id > 0 || ! empty($ref)) * Ajouter une ligne de contact * Non affiche en mode modification de ligne */ - if ($_GET["action"] != 'editline' && $user->rights->propale->creer) + if ($action != 'editline' && $user->rights->propale->creer) { print '
| '.$langs->trans("Source").' | '; print ''.$langs->trans("Company").' | '; print ''.$langs->trans("Contacts").' | '; print ''.$langs->trans("ContactType").' | '; - print ''.$langs->trans("Status").' | '; - print ''; + print ' | '.$langs->trans("Status").' | '; print "'; + print ' | '; if ($user->rights->propale->creer) { print ' '; | |