Fixing style errors.

This commit is contained in:
stickler-ci 2021-04-17 12:21:40 +00:00
parent 17f84c4edc
commit fcbea36605

View File

@ -221,12 +221,12 @@ if (empty($reshook) && $action == 'add') {
if (!GETPOST('firstname') { if (!GETPOST('firstname') {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
} }
if (GETPOST('email') && !isValidEmail(GETPOST('email'))) { if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."<br>\n"; $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."<br>\n";
} }
$birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST('birthmin', 'int'), GETPOST('birthsec', 'int'), GETPOST('birthmonth', 'int'), GETPOST('birthday', 'int'), GETPOST('birthyear', 'int')); $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++; $error++;
@ -545,121 +545,121 @@ jQuery(document).ready(function () {
</script>'; </script>';
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n"; print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
// Type // Type
if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) { if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
$listoftype = $adht->liste_array(); $listoftype = $adht->liste_array();
$tmp = array_keys($listoftype); $tmp = array_keys($listoftype);
$defaulttype = ''; $defaulttype = '';
$isempty = 1; $isempty = 1;
if (count($listoftype) == 1) { if (count($listoftype) == 1) {
$defaulttype = $tmp[0]; $defaulttype = $tmp[0];
$isempty = 0; $isempty = 0;
}
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>';
print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
print '</td></tr>'."\n";
} else {
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
print '<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
} }
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>'; // Moral/Physic attribute
print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty); $morphys["phy"] = $langs->trans("Physical");
print '</td></tr>'."\n"; $morphys["mor"] = $langs->trans("Moral");
} else { if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) {
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE); print '<tr class="morphy"><td class="titlefield">'.$langs->trans('MemberNature').' <FONT COLOR="red">*</FONT></td><td>'."\n";
print '<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">'; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
} print '</td></tr>'."\n";
// Moral/Physic attribute } else {
$morphys["phy"] = $langs->trans("Physical"); print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
$morphys["mor"] = $langs->trans("Moral"); print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">';
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { }
print '<tr class="morphy"><td class="titlefield">'.$langs->trans('MemberNature').' <FONT COLOR="red">*</FONT></td><td>'."\n"; // Civility
print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print '<tr><td class="titlefield">'.$langs->trans('UserTitle').'</td><td>';
print '</td></tr>'."\n"; print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'</td></tr>'."\n";
} else { // Lastname
print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY]; print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n";
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">'; // Firstname
} print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n";
// Civility // Gender
print '<tr><td class="titlefield">'.$langs->trans('UserTitle').'</td><td>'; print '<tr><td>'.$langs->trans("Gender").'</td>';
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'</td></tr>'."\n"; print '<td>';
// Lastname $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'"></td></tr>'."\n"; print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1);
// Firstname print '</td></tr>';
print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'"></td></tr>'."\n"; // Company
// Gender print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Gender").'</td>'; // Address
print '<td>'; print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
$arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
print $form->selectarray('gender', $arraygender, GETPOST('gender') ?GETPOST('gender') : $object->gender, 1); // Zip / Town
print '</td></tr>'; print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>';
// Company print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n"; print ' / ';
// Address print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n"; print '</td></tr>';
print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n"; // Country
// Zip / Town print '<tr><td>'.$langs->trans('Country').'</td><td>';
print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>'; $country_id = GETPOST('country_id');
print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) {
print ' / '; $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); }
print '</td></tr>'; if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
// Country $country_code = dol_user_country();
print '<tr><td>'.$langs->trans('Country').'</td><td>'; //print $country_code;
$country_id = GETPOST('country_id'); if ($country_code) {
if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $new_country_id = getCountry($country_code, 3, $db, $langs);
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); //print 'xxx'.$country_code.' - '.$new_country_id;
} if ($new_country_id) {
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { $country_id = $new_country_id;
$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);
$country_code = getCountry($country_id, 2, $db, $langs); print $form->select_country($country_id, 'country_id');
print $form->select_country($country_id, 'country_id');
print '</td></tr>';
// State
if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($country_code) {
print $formcompany->select_state(GETPOST("state_id"), $country_code);
}
print '</td></tr>'; print '</td></tr>';
} // State
// EMail if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n"; print '<tr><td>'.$langs->trans('State').'</td><td>';
// Login if ($country_code) {
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print $formcompany->select_state(GETPOST("state_id"), $country_code);
print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n"; }
print '<tr><td>'.$langs->trans("Password").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.GETPOST("pass1").'"></td></tr>'."\n"; print '</td></tr>';
print '<tr><td>'.$langs->trans("PasswordAgain").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.GETPOST("pass2").'"></td></tr>'."\n"; }
} // EMail
// Birthday print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateOfBirth").'</td><td>'; // Login
print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '</td></tr>'."\n"; print '<tr><td>'.$langs->trans("Login").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="login" maxlength="50" class="minwidth100"value="'.dol_escape_htmltag(GETPOST('login')).'"></td></tr>'."\n";
// Photo print '<tr><td>'.$langs->trans("Password").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass1" class="minwidth100" value="'.GETPOST("pass1").'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n"; print '<tr><td>'.$langs->trans("PasswordAgain").' <FONT COLOR="red">*</FONT></td><td><input type="password" maxlength="128" name="pass2" class="minwidth100" value="'.GETPOST("pass2").'"></td></tr>'."\n";
// Public }
print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public"></td></tr>'."\n"; // Birthday
// Other attributes print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateOfBirth").'</td><td>';
$tpl_context = 'public'; // define template context to public print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0);
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print '</td></tr>'."\n";
// Comments // Photo
print '<tr>'; print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
print '<td class="tdtop">'.$langs->trans("Comments").'</td>'; // Public
print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>'; print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public"></td></tr>'."\n";
print '</tr>'."\n"; // Other attributes
$tpl_context = 'public'; // define template context to public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
// Comments
print '<tr>';
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>';
print '</tr>'."\n";
// Add specific fields used by Dolibarr foundation for example // Add specific fields used by Dolibarr foundation for example
if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { 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+'); $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 '<tr id="trbudget" class="trcompany"><td>'.$langs->trans("TurnoverOrBudget").' <FONT COLOR="red">*</FONT></td><td>'; print '<tr id="trbudget" class="trcompany"><td>'.$langs->trans("TurnoverOrBudget").' <FONT COLOR="red">*</FONT></td><td>';
print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1); print $form->selectarray('budget', $arraybudget, GETPOST('budget'), 1);
print ' € or $'; print ' € or $';
print '<script type="text/javascript"> print '<script type="text/javascript">
jQuery(document).ready(function () { jQuery(document).ready(function () {
initturnover(); initturnover();
jQuery("#morphy").click(function() { jQuery("#morphy").click(function() {
@ -693,51 +693,50 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
} }
}); });
</script>'; </script>';
print '</td></tr>'."\n"; print '</td></tr>'."\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
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { // Set amount for the subscription
$amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); $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 '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) {
print '<input type="text" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
} else {
print '<input type="text" name="amount" id="amounthidden" class="flat amount" disabled size="6" value="'.$amount.'">';
print '<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
}
print ' '.$langs->trans("Currency".$conf->currency);
print '</td></tr>';
} }
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' print "</table>\n";
print '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { print dol_get_fiche_end();
print '<input type="text" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
} else { // Save
print '<input type="text" name="amount" id="amounthidden" class="flat amount" disabled size="6" value="'.$amount.'">'; print '<div class="center">';
print '<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">'; print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
if (!empty($backtopage)) {
print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
} }
print ' '.$langs->trans("Currency".$conf->currency); print '</div>';
print '</td></tr>';
}
print "</table>\n";
print dol_get_fiche_end();
// Save
print '<div class="center">';
print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
if (!empty($backtopage)) {
print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
}
print '</div>';
print "</form>\n"; print "</form>\n";
print "<br>"; print "<br>";
print '</div></div>'; print '</div></div>';
llxFooterVierge(); llxFooterVierge();
$db->close(); $db->close();