diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 36c00d3621f..cd6d68254ea 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) { @@ -118,6 +118,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) { @@ -129,7 +130,7 @@ if ($_POST['action'] == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch($_POST["socid"]); $error++; - $mesg='