diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 19fa23af080..0920e5976b1 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -221,12 +221,12 @@ if (empty($reshook) && $action == 'add') {
if (!GETPOST('firstname') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n";
- }
- if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
- $error++;
- $langs->load("errors");
- $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n";
- }
+}
+if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
+ $error++;
+ $langs->load("errors");
+ $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."
\n";
+}
$birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int'));
if GETPOSTISSET('birthmonth') && empty($birthday)) {
$error++;
@@ -545,121 +545,121 @@ jQuery(document).ready(function () {
';
-print '
| '.$langs->trans("Type").' * | '; + print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); + print ' |
| '.$langs->trans("Type").' * | '; - print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); - print ' |
| '.$langs->trans('MemberNature').' * | '."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); - print ' |
| '.$langs->trans('UserTitle').' | '; -print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').' |
| '.$langs->trans("Lastname").' * | |
| '.$langs->trans("Firstname").' * | |
| '.$langs->trans("Gender").' | '; -print ''; -$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); -print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); -print ' |
| '.$langs->trans("Company").' | |
| '.$langs->trans("Address").' | '."\n"; -print ' |
| '.$langs->trans('Zip').' / '.$langs->trans('Town').' | '; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print ' |
| '.$langs->trans('Country').' | '; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; + // Moral/Physic attribute + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { + print ' |
| '.$langs->trans('MemberNature').' * | '."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); + print ' |
| '.$langs->trans('UserTitle').' | '; + print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').' |
| '.$langs->trans("Lastname").' * | |
| '.$langs->trans("Firstname").' * | |
| '.$langs->trans("Gender").' | '; + print ''; + $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); + print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); + print ' |
| '.$langs->trans("Company").' | |
| '.$langs->trans("Address").' | '."\n"; + print ' |
| '.$langs->trans('Zip').' / '.$langs->trans('Town').' | '; + print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); + print ' / '; + print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); + print ' |
| '.$langs->trans('Country').' | '; + $country_id = GETPOST('country_id'); + if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); + } + if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } } } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print ' |
| '.$langs->trans('State').' | '; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } + $country_code = getCountry($country_id, 2, $db, $langs); + print $form->select_country($country_id, 'country_id'); print ' |
| '.$langs->trans("Email").' * | |
| '.$langs->trans("Login").' * | |
| '.$langs->trans("Password").' * | |
| '.$langs->trans("PasswordAgain").' * | |
| '.$langs->trans("DateOfBirth").' | '; -print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); -print ' |
| '.$langs->trans("URLPhoto").' | |
| '.$langs->trans("Public").' | |
| '.$langs->trans("Comments").' | '; -print ''; -print ' |
| '.$langs->trans('State').' | '; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } + print ' |
| '.$langs->trans("Email").' * | |
| '.$langs->trans("Login").' * | |
| '.$langs->trans("Password").' * | |
| '.$langs->trans("PasswordAgain").' * | |
| '.$langs->trans("DateOfBirth").' | '; + print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); + print ' |
| '.$langs->trans("URLPhoto").' | |
| '.$langs->trans("Public").' | |
| '.$langs->trans("Comments").' | '; + print ''; + print ' |
| '.$langs->trans("TurnoverOrBudget").' * | '; - print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); - print ' € or $'; + // Add specific fields used by Dolibarr foundation for example + if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { + $arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+'); + print ' |
| '.$langs->trans("TurnoverOrBudget").' * | '; + print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); + print ' € or $'; - print ''; - print ' |
| '.$langs->trans("Subscription").' | '; + if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { + print ''; + } else { + print ''; + print ''; + } + print ' '.$langs->trans("Currency".$conf->currency); + print ' |
| '.$langs->trans("Subscription").' | '; - if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; - } else { - print ''; - print ''; + print " |