Fixing style errors.

This commit is contained in:
stickler-ci 2021-04-09 00:28:07 +00:00
parent f2a49ef72f
commit dce5c6be8f
4 changed files with 35 additions and 35 deletions

View File

@ -224,10 +224,10 @@ print "</td></tr>\n";
$adht = new AdherentType($db); $adht = new AdherentType($db);
$amountbytype = empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE) ? -1 : json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); $amountbytype = empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE) ? -1 : json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true);
print '<tr class="oddeven"><td>'.$langs->trans("DefineAmountMemberType").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("DefineAmountMemberType").'</td><td>';
foreach ($adht->liste_array(1) as $typeid => $type){ foreach ($adht->liste_array(1) as $typeid => $type) {
print $type .' : '; print $type .' : ';
print '<input type="text" id="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" name="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" " size="5" value="'.(!empty($amountbytype[$typeid]) ? $amountbytype[$typeid] : '').'">'; print '<input type="text" id="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" name="MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE['.$typeid.']" " size="5" value="'.(!empty($amountbytype[$typeid]) ? $amountbytype[$typeid] : '').'">';
print '<br />'; print '<br />';
} }
print "</td></tr>\n"; print "</td></tr>\n";

View File

@ -1494,7 +1494,7 @@ class Adherent extends CommonObject
* *
* @return int rowid of record added, <0 if KO * @return int rowid of record added, <0 if KO
*/ */
public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = NULL) public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;

View File

@ -1439,36 +1439,36 @@ if ($source == 'membersubscription') {
} }
if ($member->type) { if ($member->type) {
// Last member type // Last member type
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("LastMemberType"); print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("LastMemberType");
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.dol_escape_htmltag($member->type); print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.dol_escape_htmltag($member->type);
print "</td></tr>"."\n"; print "</td></tr>"."\n";
} }
if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) { if (!empty($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE)) {
// Amount by member type // Amount by member type
$amountbytype = json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true); $amountbytype = json_decode($conf->global->MEMBER_SUBSCRIPTION_AMOUNT_BY_TYPE, true);
// Set the member type // Set the member type
$member->typeid = (int)(GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); $member->typeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid);
// If we change the type of membership, we set also label of new type // If we change the type of membership, we set also label of new type
$member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle');
// Set amount for the subscription // Set amount for the subscription
$amount = $amountbytype[$member->typeid] ? $amountbytype[$member->typeid] : $member->last_subscription_amount; $amount = $amountbytype[$member->typeid] ? $amountbytype[$member->typeid] : $member->last_subscription_amount;
// list member type // list member type
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$adht = new AdherentType($db); $adht = new AdherentType($db);
if( !$action){ if ( !$action) {
$form = new Form($db); // so wecan call method selectarray $form = new Form($db); // so wecan call method selectarray
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("NewSubscription"); print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("NewSubscription");
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'; print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
print $form->selectarray("typeid", $adht->liste_array(1) , $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.$source.'&ref='.$ref.'&amount='.$amount.'&typeid=\' + this.value + \'&securekey='.$SECUREKEY.'\');"', 0, 0, 0, '', '', 1); print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.$source.'&ref='.$ref.'&amount='.$amount.'&typeid=\' + this.value + \'&securekey='.$SECUREKEY.'\');"', 0, 0, 0, '', '', 1);
print "</td></tr>"."\n"; print "</td></tr>"."\n";
} elseif ($action == dopayment) { } elseif ($action == dopayment) {
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("NewMemberType"); print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("NewMemberType");
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.dol_escape_htmltag($member->type); print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.dol_escape_htmltag($member->type);
print '<input type="hidden" name="membertypeid" value="'.$member->typeid.'">'; print '<input type="hidden" name="membertypeid" value="'.$member->typeid.'">';
print "</td></tr>"."\n"; print "</td></tr>"."\n";
} }
} }
// Amount // Amount