diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index bb320e9f48a..e99e20452cc 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') { if ($action == 'update') { $public = GETPOST('MEMBER_ENABLE_PUBLIC'); - $amount = GETPOST('MEMBER_NEWFORM_AMOUNT'); + $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2); $editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); @@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print ''; print $langs->trans("DefaultAmount"); print ''; - print ''; + print ''; print "\n"; // Can edit diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f84fce1a2b6..1e2f7aaa63d 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -536,15 +536,16 @@ jQuery(document).ready(function () { jQuery(document).ready(function () { function initmorphy() { - if (jQuery("#morphy").val()==\'phy\') { - jQuery("#trcompany").hide(); - } - if (jQuery("#morphy").val()==\'mor\') { - jQuery("#trcompany").show(); - } + console.log("Call initmorphy"); + if (jQuery("#morphy").val() == \'phy\') { + jQuery("#trcompany").hide(); + } + if (jQuery("#morphy").val() == \'mor\') { + jQuery("#trcompany").show(); + } }; initmorphy(); - jQuery("#morphy").click(function() { + jQuery("#morphy").change(function() { initmorphy(); }); jQuery("#selectcountry_id").change(function() { @@ -592,21 +593,31 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { print ''; } -// Civility +// Company +print ''.$langs->trans("Company").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print ''."\n"; +// Title print ''.$langs->trans('UserTitle').''; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').''."\n"; // Lastname print ''.$langs->trans("Lastname").' *'."\n"; // Firstname print ''.$langs->trans("Firstname").' *'."\n"; +// EMail +print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; +// Login +if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { + print ''.$langs->trans("Login").' *'."\n"; + print ''.$langs->trans("Password").' *'."\n"; + print ''.$langs->trans("PasswordAgain").' *'."\n"; +} // Gender print ''.$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 ''; -// Company -print ''.$langs->trans("Company").''."\n"; // Address print ''.$langs->trans("Address").''."\n"; print ''."\n"; @@ -618,7 +629,8 @@ print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'se print ''; // Country print ''.$langs->trans('Country').''; -$country_id = GETPOST('country_id'); +print img_picto('', 'country', 'class="pictofixedwidth"'); +$country_id = GETPOST('country_id', 'int'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); } @@ -644,14 +656,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) { } print ''; } -// EMail -print ''.$langs->trans("Email").($conf->global->ADHERENT_MAIL_REQUIRED ? ' *' : '').''."\n"; -// Login -if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''.$langs->trans("Login").' *'."\n"; - print ''.$langs->trans("Password").' *'."\n"; - print ''.$langs->trans("PasswordAgain").' *'."\n"; -} // Birthday print ''.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); @@ -669,7 +673,8 @@ print ''.$langs->trans("Comments").''; print ''; print ''."\n"; - // Add specific fields used by Dolibarr foundation for example +// Add specific fields used by Dolibarr foundation for example +// TODO Move this into generic feature. 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").' *'; @@ -712,6 +717,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { '; print ''."\n"; } + if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { // $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount