Autofill mor/phy when creating member from membership type card.

This commit is contained in:
Laurent Destailleur 2023-04-24 15:07:30 +02:00
parent a6d1cdcef9
commit 86a0df9ce0
2 changed files with 11 additions and 2 deletions

View File

@ -550,6 +550,7 @@ if ($rowid > 0) {
print dol_get_fiche_end();
/*
* Buttons
*/
@ -562,8 +563,16 @@ if ($rowid > 0) {
}
// Add
if ($object->morphy == 'phy') {
$morphy = 'phy';
} elseif ($object->morphy == 'mor') {
$morphy = 'mor';
} else {
$morphy = '';
}
if ($user->hasRight('adherent', 'configurer')&& !empty($object->status)) {
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.($morphy ? '&morphy='.urlencode($morphy) : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
} else {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
}

View File

@ -1646,7 +1646,7 @@ if ($source == 'member' || $source == 'membersubscription') {
} else {
print '<b class="amount">'.price($amount, 1, $langs, 1, -1, -1, $currency).'</b>'; // Price with currency
if ($minimumamount > $amount) {
print ' '. $langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency));
print ' &nbsp; <span class="opacitymedium small">'. $langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)).'</span>';
}
print '<input type="hidden" name="newamount" value="'.$amount.'">';
}