Fix: error message not visible

This commit is contained in:
Regis Houssin 2011-02-12 08:10:18 +00:00
parent 5a0f50a06c
commit a25b3eeb2f

View File

@ -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='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>';
}
}
@ -612,13 +613,9 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewMember"));
if ($errmsg)
{
print '<div class="error">'.$errmsg.'</div>';
}
if ($errmsg) print '<div class="error">'.$errmsg.'</div>';
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -631,7 +628,6 @@ if ($action == 'create')
print '</script>'."\n";
}
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
@ -814,7 +810,6 @@ if ($action == 'edit')
if ($mesg) print '<div class="ok">'.$mesg.'</div>';
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
@ -1010,7 +1005,7 @@ if ($rowid && $action != 'edit')
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
if ($msg) print '<div class="error">'.$msg.'</div>';
dol_htmloutput_errors($errmsg,$errmsgs);
// Confirm create user
if ($_GET["action"] == 'create_user')