diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 1f89d71f12e..af91f9eb4e7 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -50,9 +50,9 @@ $adh = new Adherent($db); $adho = new AdherentOptions($db); $errmsg=''; -$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; -$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; -$typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"]; +$action=GETPOST("action"); +$rowid=GETPOST("rowid"); +$typeid=GETPOST("typeid"); if ($rowid) { @@ -123,6 +123,7 @@ if ($_POST['action'] == 'setsocid') { $sql ="SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; $sql.=" WHERE fk_soc = '".$_POST["socid"]."'"; + $sql.=" AND entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { @@ -134,7 +135,7 @@ if ($_POST['action'] == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch($_POST["socid"]); $error++; - $mesg='