diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index dcf64ed7634..13705796ad5 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -218,17 +218,17 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; } - if (!GETPOST('firstname')) ä{ + 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)) { + if GETPOSTISSET('birthmonth') { && empty($birthday)) $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; @@ -548,33 +548,33 @@ jQuery(document).ready(function () { print ''."\n"; // Type - if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { - $listoftype = $adht->liste_array(); - $tmp = array_keys($listoftype); - $defaulttype = ''; - $isempty = 1; - if (count($listoftype) == 1) { - $defaulttype = $tmp[0]; - $isempty = 0; - } - print ''."\n"; - } else { - $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); - print ''; +if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { + $listoftype = $adht->liste_array(); + $tmp = array_keys($listoftype); + $defaulttype = ''; + $isempty = 1; + if (count($listoftype) == 1) { + $defaulttype = $tmp[0]; + $isempty = 0; } + print ''."\n"; +} else { + $adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); + print ''; +} // Moral/Physic attribute $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); - if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''."\n"; - } else { - print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; - print ''; - } +if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { + print ''."\n"; +} else { + print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; + print ''; +} // Civility print ''."\n"; @@ -602,39 +602,39 @@ jQuery(document).ready(function () { // Country print ''; // State - if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} // EMail print ''."\n"; // Login - if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''."\n"; - print ''."\n"; - print ''."\n"; - } +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''."\n"; + print ''."\n"; + print ''."\n"; +} // Birthday print ''."\n"; // 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 ''."\n"; + print ''."\n"; +} +if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount + + // Set amount for the subscription + $amount = isset($amount) ? $amount : 0; + + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { + $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; } - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount - // Set amount for the subscription - $amount = isset($amount) ? $amount : 0; - - if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { - $amount = $conf->global->MEMBER_NEWFORM_AMOUNT; - } - - if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); - } - // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' - print ''; + if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { + $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); } + // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' + print ''; +} 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('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('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; - } +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); - } - 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("Login").' *
'.$langs->trans("Password").' *
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -653,13 +653,13 @@ jQuery(document).ready(function () { print '
'.$langs->trans("TurnoverOrBudget").' *'; - print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); - print ' € or $'; +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 ' '.$langs->trans("Currency".$conf->currency); + print '
\n"; print dol_get_fiche_end(); @@ -726,9 +726,9 @@ jQuery(document).ready(function () { // Save print '
'; print ''; - if (!empty($backtopage)) { - print '     '; - } +if (!empty($backtopage)) { + print '     '; +} print '
';