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='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; + $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; } } @@ -612,13 +613,9 @@ if ($action == 'create') print_fiche_titre($langs->trans("NewMember")); - if ($errmsg) - { - print '
'.$errmsg.'
'; - } + if ($errmsg) print '
'.$errmsg.'
'; if ($mesg) print '
'.$mesg.'
'; - if ($conf->use_javascript_ajax) { print "\n".''."\n"; } - print '
'; print ''; print ''; @@ -814,7 +810,6 @@ if ($action == 'edit') if ($mesg) print '
'.$mesg.'
'; - if ($conf->use_javascript_ajax) { print "\n".'