fix colspan too small

This commit is contained in:
Frédéric FRANCE 2021-01-20 22:40:40 +01:00 committed by GitHub
parent 9e5dc89cea
commit 01e41a8ddd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1114,22 +1114,21 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$i++;
}
}
} else dol_print_error($db);
} else {
dol_print_error($db);
}
}
// Show remote sources (not already shown as local source)
if (is_array($listofsources) && count($listofsources))
{
foreach ($listofsources as $src)
{
if (is_array($listofsources) && count($listofsources)) {
foreach ($listofsources as $src) {
if (!empty($arrayofstripecard[$src->id])) continue; // Already in previous list
$nbremote++;
print '<tr class="oddeven">';
// Local ID
if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD))
{
if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) {
print '<td>';
print '</td>';
}
@ -1142,8 +1141,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!empty($stripeacc)) $connect = $stripeacc.'/';
//$url='https://dashboard.stripe.com/'.$connect.'test/sources/'.$src->id;
$url = 'https://dashboard.stripe.com/'.$connect.'test/search?query='.$src->id;
if ($servicestatus)
{
if ($servicestatus) {
//$url='https://dashboard.stripe.com/'.$connect.'sources/'.$src->id;
$url = 'https://dashboard.stripe.com/'.$connect.'search?query='.$src->id;
}
@ -1151,73 +1149,58 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '</td>';
// Img of credit card
print '<td>';
if ($src->object == 'card')
{
if ($src->object == 'card') {
print img_credit_card($src->brand);
} elseif ($src->object == 'source' && $src->type == 'card')
{
} elseif ($src->object == 'source' && $src->type == 'card') {
print img_credit_card($src->card->brand);
} elseif ($src->object == 'source' && $src->type == 'sepa_debit')
{
} elseif ($src->object == 'source' && $src->type == 'sepa_debit') {
print '<span class="fa fa-university fa-2x fa-fw"></span>';
} elseif ($src->object == 'payment_method' && $src->type == 'card')
{
} elseif ($src->object == 'payment_method' && $src->type == 'card') {
print img_credit_card($src->card->brand);
} elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit')
{
} elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') {
print '<span class="fa fa-university fa-2x fa-fw"></span>';
}
print'</td>';
// Information
print '<td valign="middle">';
if ($src->object == 'card')
{
if ($src->object == 'card') {
print '....'.$src->last4.' - '.$src->exp_month.'/'.$src->exp_year.'';
print '</td><td>';
if ($src->country)
{
if ($src->country) {
$img = picto_from_langcode($src->country);
print $img ? $img.' ' : '';
print getCountry($src->country, 1);
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
} elseif ($src->object == 'source' && $src->type == 'card')
{
} elseif ($src->object == 'source' && $src->type == 'card') {
print '<span class="opacitymedium">'.$src->owner->name.'</span><br>....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.'';
print '</td><td>';
if ($src->card->country)
{
if ($src->card->country) {
$img = picto_from_langcode($src->card->country);
print $img ? $img.' ' : '';
print getCountry($src->card->country, 1);
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
} elseif ($src->object == 'source' && $src->type == 'sepa_debit')
{
} elseif ($src->object == 'source' && $src->type == 'sepa_debit') {
print 'SEPA debit';
print '</td><td>';
if ($src->sepa_debit->country)
{
if ($src->sepa_debit->country) {
$img = picto_from_langcode($src->sepa_debit->country);
print $img ? $img.' ' : '';
print getCountry($src->sepa_debit->country, 1);
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
} elseif ($src->object == 'payment_method' && $src->type == 'card')
{
} elseif ($src->object == 'payment_method' && $src->type == 'card') {
print '<span class="opacitymedium">'.$src->billing_details->name.'</span><br>....'.$src->card->last4.' - '.$src->card->exp_month.'/'.$src->card->exp_year.'';
print '</td><td>';
if ($src->card->country)
{
if ($src->card->country) {
$img = picto_from_langcode($src->card->country);
print $img ? $img.' ' : '';
print getCountry($src->card->country, 1);
} else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
} elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit')
{
} elseif ($src->object == 'payment_method' && $src->type == 'sepa_debit') {
print 'SEPA debit';
print '</td><td>';
if ($src->sepa_debit->country)
{
if ($src->sepa_debit->country) {
$img = picto_from_langcode($src->sepa_debit->country);
print $img ? $img.' ' : '';
print getCountry($src->sepa_debit->country, 1);
@ -1229,8 +1212,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
// Default
print '<td class="center" width="50">';
if ((empty($customerstripe->invoice_settings) && $customerstripe->default_source != $src->id) ||
(!empty($customerstripe->invoice_settings) && $customerstripe->invoice_settings->default_payment_method != $src->id))
{
(!empty($customerstripe->invoice_settings) && $customerstripe->invoice_settings->default_payment_method != $src->id)) {
print '<a href="'.DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id.'&source='.$src->id.'&action=setassourcedefault&token='.newToken().'">';
print img_picto($langs->trans("Default"), 'off');
print '</a>';
@ -1252,8 +1234,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print $hookmanager->resPrint;
// Action column
print '<td class="right nowraponall">';
if ($user->rights->societe->creer)
{
if ($user->rights->societe->creer) {
print '<a href="'.DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id.'&source='.$src->id.'&action=deletecard&token='.newToken().'">';
print img_picto($langs->trans("Delete"), 'delete');
print '</a>';
@ -1264,10 +1245,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
}
}
if ($nbremote == 0 && $nblocal == 0)
{
$colspan = 8;
if (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD)) $colspan++;
if ($nbremote == 0 && $nblocal == 0) {
$colspan = (!empty($conf->global->STRIPE_ALLOW_LOCAL_CARD) ? 10 : 9);
print '<tr><td class="opacitymedium" colspan="'.$colspan.'">'.$langs->trans("None").'</td></tr>';
}
print "</table>";