Debug v23
This commit is contained in:
parent
c6d882b484
commit
77e681ce81
7 changed files with 64 additions and 40 deletions
|
|
@ -93,7 +93,9 @@ if ($action == 'update') {
|
|||
$res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", $showtable ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show"
|
||||
$res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show"
|
||||
if (GETPOSTISSET('MEMBER_HIDE_VOTE_ALLOWED')) {
|
||||
$res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show"
|
||||
}
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity);
|
||||
if ($forcetype < 0) {
|
||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity);
|
||||
|
|
@ -225,6 +227,24 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
|||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0)
|
||||
$skiptable = getDolGlobalInt('MEMBER_SKIP_TABLE');
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("MembersShowMembershipTypesTable");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_SHOW_TABLE", (int) !$skiptable, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Show "vote allowed" setting for membership types
|
||||
if (!$skiptable) {
|
||||
$hidevoteallowed = getDolGlobalInt('MEMBER_HIDE_VOTE_ALLOWED');
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("MembersShowVotesAllowed");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", (int) !$hidevoteallowed, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
|
|
@ -272,22 +292,6 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
|||
print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", getDolGlobalInt('MEMBER_COUNTERS_ARE_PUBLIC'), 1, false, 0, 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0)
|
||||
$skiptable = getDolGlobalInt('MEMBER_SKIP_TABLE');
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("MembersShowMembershipTypesTable");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_SHOW_TABLE", (int) !$skiptable, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Show "vote allowed" setting for membership types
|
||||
$hidevoteallowed = getDolGlobalInt('MEMBER_HIDE_VOTE_ALLOWED');
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("MembersShowVotesAllowed");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", (int) !$hidevoteallowed, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Jump to an online payment page
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ class AdherentType extends CommonObject
|
|||
while ($i < $nump) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$amountbytype[$obj->rowid] = $obj->amount;
|
||||
$amountbytype[$obj->rowid] = (float) $obj->amount;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -485,7 +485,13 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||
print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
|
||||
print '<td class="center">';
|
||||
$amount = (is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount));
|
||||
print '<span class="amount">'.$amount.'</span>';
|
||||
if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) {
|
||||
print img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
|
|
@ -645,7 +651,11 @@ if ($rowid > 0) {
|
|||
|
||||
// Amount
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
|
||||
print((is_null($object->amount) || $object->amount === '') ? '' : '<span class="amount">'.price($object->amount).'</span>');
|
||||
$amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '<span class="amount">'.$amount.'</span>';
|
||||
if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) {
|
||||
print ' '.img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup');
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
|
||||
|
|
@ -944,7 +954,6 @@ if ($rowid > 0) {
|
|||
$adh->firstname = $objp->firstname;
|
||||
$adh->datefin = $datefin;
|
||||
$adh->need_subscription = $objp->subscription;
|
||||
$adh->statut = $objp->status;
|
||||
$adh->status = $objp->status;
|
||||
$adh->email = $objp->email;
|
||||
$adh->photo = $objp->photo;
|
||||
|
|
@ -1089,8 +1098,9 @@ if ($rowid > 0) {
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
$amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '<input name="amount" size="5" value="';
|
||||
print((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print $amount;
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ MembersListNotUpToDate=List of valid members with out-of-date contribution
|
|||
MembersListExcluded=List of excluded members
|
||||
MembersListResiliated=List of terminated members
|
||||
MembersListQualified=List of qualified members
|
||||
MembersShowMembershipTypesTable=Show a table of all available membership types (if no, show directly the registration form)
|
||||
MembersShowMembershipTypesTable=Show a table to select its membership types before the registration form (if no, show directly the registration form)
|
||||
MembersShowVotesAllowed=Show whether votes are allowed, in the table of membership types
|
||||
MenuMembersToValidate=Draft members
|
||||
MenuMembersValidated=Validated members
|
||||
|
|
@ -227,7 +227,7 @@ MembershipPaid=Membership paid for current period (until %s)
|
|||
YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
|
||||
XMembersClosed=%s member(s) closed
|
||||
XExternalUserCreated=%s external user(s) created
|
||||
ForceMemberNature=Force member nature (Individual or Corporation)
|
||||
ForceMemberNature=Force member nature (Individual or Legal Entity)
|
||||
CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves.
|
||||
CreateDolibarrThirdPartyDesc=A third party is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution.
|
||||
MemberFirstname=Member firstname
|
||||
|
|
|
|||
|
|
@ -715,7 +715,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
$listetype = $adht->liste_array(1);
|
||||
print img_picto('', $adht->picto, 'class="pictofixedwidth"');
|
||||
if (count($listetype)) {
|
||||
print $form->selectarray("typeid", $listetype, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
|
||||
print $form->selectarray("typeid", $listetype, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', 'minwidth150 maxwidth300 widthcentpercentminusx', 1);
|
||||
} else {
|
||||
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
|
||||
}
|
||||
|
|
@ -834,7 +834,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
|
||||
// Title
|
||||
if (getDolGlobalString('MEMBER_NEWFORM_ASK_TITLE')) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans('UserTitle').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('UserTitle').'</td><td>';
|
||||
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'</td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
|
@ -846,7 +846,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
|
||||
// EMail
|
||||
print '<tr><td>'.(getDolGlobalString('ADHERENT_MAIL_REQUIRED') ? '<span class="fieldrequired">' : '').$langs->trans("EMail").(getDolGlobalString('ADHERENT_MAIL_REQUIRED') ? '</span>' : '').'</td>';
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.dol_escape_htmltag(GETPOST('member_email', "aZ09arobase")).'"></td></tr>'."\n";
|
||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth150 maxwidth300 widthcentpercentminusx" maxlength="255" value="'.dol_escape_htmltag(GETPOST('member_email', "aZ09arobase")).'"></td></tr>'."\n";
|
||||
|
||||
// Login
|
||||
if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED')) {
|
||||
|
|
@ -859,7 +859,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print '<tr><td>'.$langs->trans("Gender").'</td>';
|
||||
print '<td>';
|
||||
$arraygender = array('man' => $langs->trans("Genderman"), 'woman' => $langs->trans("Genderwoman"), 'other' => $langs->trans("Genderother"));
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print $form->selectarray('gender', $arraygender, GETPOST('gender', 'alphanohtml'), 1, 0, 0, '', 0, 0, 0, '', 'minwidth150 maxwidth300 widthcentpercentminusx', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Address
|
||||
|
|
@ -878,7 +878,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print img_picto('', 'country', 'class="pictofixedwidth paddingright"');
|
||||
$country_id = GETPOSTINT('country_id');
|
||||
if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
$country_id = getCountry(getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE'), '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
|
|
@ -892,7 +892,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print $form->select_country($country_id, 'country_id', '', 0, 'minwidth150 maxwidth300 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
|
|
@ -900,22 +900,22 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($country_code) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth paddingright"');
|
||||
print $formcompany->select_state(GETPOSTINT("state_id"), $country_code);
|
||||
print $formcompany->select_state(GETPOSTINT("state_id"), $country_code, 'state_id', 'minwidth150 maxwidth300 widthcentpercentminusx');
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').'<input type="text" name="phone" size="20" value="'.dol_escape_htmltag(GETPOST('phone')).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').'<input type="text" name="phone" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOST('phone')).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').'<input type="text" name="phone_perso" size="20" value="'.dol_escape_htmltag(GETPOST('phone_perso')).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').'<input type="text" name="phone_perso" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOST('phone_perso')).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').'<input type="text" name="phone_mobile" size="20" value="'.dol_escape_htmltag(GETPOST('phone_mobile')).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').'<input type="text" name="phone_mobile" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOST('phone_mobile')).'"></td></tr>';
|
||||
|
||||
// Birthday
|
||||
print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateOfBirth").'</td><td>';
|
||||
|
|
@ -923,7 +923,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print '</td></tr>'."\n";
|
||||
|
||||
// Photo
|
||||
print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth200" value="'.dol_escape_htmltag(GETPOST('photo')).'"></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";
|
||||
|
||||
// Public
|
||||
if (getDolGlobalString('MEMBER_PUBLIC_ENABLED')) {
|
||||
|
|
@ -938,8 +938,8 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
|
||||
// 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 '<td class="tdtop"></td>';
|
||||
print '<td class="tdtop"><textarea placeholder="'.dolPrintHTML($langs->trans("Comments")).'" 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
|
||||
|
|
@ -995,6 +995,11 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
$adht->fetch($typeid);
|
||||
$caneditamount = $adht->caneditamount;
|
||||
$amountbytype = $adht->amountByType(1); // Load the array of amount per type
|
||||
foreach ($amountbytype as $k => $v) {
|
||||
$amount = max(0, (float) $v, (float) getDolGlobalInt("MEMBER_MIN_AMOUNT"));
|
||||
$amountbytype[$k] = $amount;
|
||||
}
|
||||
|
||||
$amountbytype_json = json_encode($amountbytype);
|
||||
$caneditamountbytype = $adht->caneditamountByType(1); // Load the array of caneditamount per type
|
||||
$caneditamountbytype_json = json_encode($caneditamountbytype);
|
||||
|
|
@ -1053,9 +1058,10 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print '<script>
|
||||
jQuery(function($) {
|
||||
$("#typeid").on("change", function() {
|
||||
console.log("Type of membership changed, we force amount update");
|
||||
let typeId = $(this).val();
|
||||
let amountVal = amountbytype[typeId] || 0;
|
||||
let formattedAmount = parseFloat(amountVal).toFixed(2);
|
||||
let formattedAmount = parseFloat(amountVal);
|
||||
|
||||
if (canEditAmount[typeId] === "1") {
|
||||
// Editable mode
|
||||
|
|
@ -1079,7 +1085,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
|
||||
// Display Captcha code if is enabled
|
||||
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_MEMBER') && is_object($captchaobj)) {
|
||||
print '<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td><br>';
|
||||
print '<tr><td><label><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td><br>';
|
||||
if (method_exists($captchaobj, 'getCaptchaCodeForForm')) {
|
||||
print $captchaobj->getCaptchaCodeForForm(''); // @phan-suppress-current-line PhanUndeclaredMethod
|
||||
} else {
|
||||
|
|
@ -1156,7 +1162,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
// Label
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
print '<td>'.dolPrintHTML($objp->label).'</td>';
|
||||
// Duration
|
||||
print '<td class="center">';
|
||||
$unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
|
||||
|
|
|
|||
|
|
@ -378,6 +378,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
|||
padding-top: 6px !important;
|
||||
padding-bottom: 6px !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.nonature-back {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
|||
padding-top: 5px !important;
|
||||
padding-bottom: 6px !important;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.nonature-back {
|
||||
|
|
|
|||
Loading…
Reference in a new issue