diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 01c7b2d93e0..8cef0b37a2e 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -386,10 +386,10 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) } } - // Test validite des parametres - if (empty($typeid)) { - $error++; - $errmsg .= $langs->trans("ErrorMemberTypeNotDefined")."
\n"; + // Check parameters + if (empty($morphy) || $morphy == "-1") { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Person"))."
\n"; } // Test si le login existe deja if (empty($login)) { @@ -418,6 +418,10 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer) $langs->load("errors"); $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; } + if (! ($typeid > 0)) { // Keep () before ! + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type"))."
\n"; + } if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; $langs->load("errors"); @@ -631,13 +635,6 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhé $html = new Form($db); -if ($errmsg) -{ - print '
'.$errmsg.'
'; - print "\n"; -} -if ($mesg) print '
'.$mesg.'
'; - // fetch optionals attributes and labels $adho->fetch_name_optionals_label(); @@ -670,6 +667,13 @@ if ($action == 'edit') dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user'); + if ($errmsg) + { + print '
'.$errmsg.'
'; + } + if ($mesg) print '
'.$mesg.'
'; + + $rowspan=15; $rowspan+=sizeof($adho->attribute_label); if ($conf->societe->enabled) $rowspan++; @@ -825,6 +829,12 @@ if ($action == 'create') print_fiche_titre($langs->trans("NewMember")); + if ($errmsg) + { + print '
'.$errmsg.'
'; + } + if ($mesg) print '
'.$mesg.'
'; + print '
'; print ''; print ''; @@ -835,7 +845,7 @@ if ($action == 'create') $morphys["phy"] = "Physique"; $morphys["mor"] = "Morale"; print "".$langs->trans("Person")."*\n"; - $html->select_array("morphy", $morphys, $adh->morphy); + $html->select_array("morphy", $morphys, $adh->morphy, 1); print "\n"; // Company @@ -872,7 +882,7 @@ if ($action == 'create') $listetype=$adht->liste_array(); if (sizeof($listetype)) { - $html->select_array("typeid", $listetype, $typeid); + $html->select_array("typeid", $listetype, $typeid, 1); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } @@ -1285,7 +1295,8 @@ if ($rowid && $action != 'edit') { if ($user->rights->societe->creer) { - print ''.$langs->trans("CreateDolibarrThirdParty").''; + if ($adh->statut != -1) print ''.$langs->trans("CreateDolibarrThirdParty").''; + else print ''.$langs->trans("CreateDolibarrLogin").''; } else { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7dd472fe995..8db1b16f6ae 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -552,7 +552,7 @@ NotSupported=Not supported RequiredField=Required field Result=Result ToTest=Test - +ValidateBefore=Card must be validated before using this feature # Week day Day1=Monday Day2=Tuesday diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index cea249215d8..0d6b33ffe85 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -551,7 +551,7 @@ NotSupported=Non supporté RequiredField=Champ obligatoire Result=Résultat ToTest=Tester - +ValidateBefore=La fiche doit être validée pour pouvoir utiliser cette fonction # Week day Day1=Lundi Day2=Mardi