Fix phpcs

This commit is contained in:
Laurent Destailleur 2021-03-02 02:06:09 +01:00
parent ebc3210308
commit 0670a00b83
6 changed files with 46 additions and 50 deletions

View File

@ -341,8 +341,7 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
/* ************************************************************************** */
if ($action == 'create') {
// Update fields properties in realtime
if (!empty($conf->use_javascript_ajax))
{
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
setPaymentType();

View File

@ -356,8 +356,7 @@ if ($action == 'create') {
// Company
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
// Thirdparty
if ($soc->id > 0)
{
if ($soc->id > 0) {
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
print '<td>';
print $soc->getNomUrl(1);

View File

@ -2133,11 +2133,11 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
}
else
{
/* Disable button to pay and show hourglass cursor */
jQuery('#hourglasstopay').show();
jQuery('#buttontopay').hide();
/* Disable button to pay and show hourglass cursor */
jQuery('#hourglasstopay').show();
jQuery('#buttontopay').hide();
stripe.handleCardPayment(
stripe.handleCardPayment(
clientSecret, cardElement, {
payment_method_data: {
billing_details: {
@ -2159,32 +2159,32 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
}
<?php } ?>
}
},
save_payment_method: <?php if ($stripecu) {
},
save_payment_method: <?php if ($stripecu) {
print 'true';
} else {
print 'false';
} ?> /* true when a customer was provided when creating payment intent. true ask to save the card */
}
).then(function(result) {
).then(function(result) {
console.log(result);
if (result.error) {
console.log("Error on result of handleCardPayment");
jQuery('#buttontopay').show();
jQuery('#hourglasstopay').hide();
// Inform the user if there was an error
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
} else {
if (result.error) {
console.log("Error on result of handleCardPayment");
jQuery('#buttontopay').show();
jQuery('#hourglasstopay').hide();
// Inform the user if there was an error
var errorElement = document.getElementById('card-errors');
errorElement.textContent = result.error.message;
} else {
// The payment has succeeded. Display a success message.
console.log("No error on result of handleCardPayment, so we submit the form");
// Submit the form
jQuery('#buttontopay').hide();
jQuery('#hourglasstopay').show();
// Send form (action=charge that will do nothing)
jQuery('#payment-form').submit();
}
});
console.log("No error on result of handleCardPayment, so we submit the form");
// Submit the form
jQuery('#buttontopay').hide();
jQuery('#hourglasstopay').show();
// Send form (action=charge that will do nothing)
jQuery('#payment-form').submit();
}
});
}
});

View File

@ -86,14 +86,14 @@ if (empty($conf) || !is_object($conf)) {
<tr>
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
<td><?php echo $langs->trans('SupplierCode'); ?></td>
<td>
<table class="nobordernopadding">
<tr>
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
</tr>
</table>
<td><?php echo $langs->trans('SupplierCode'); ?></td>
<td>
<table class="nobordernopadding">
<tr>
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
</tr>
</table>
</td>
</tr>

View File

@ -94,14 +94,14 @@ if (empty($conf) || !is_object($conf)) {
<tr>
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
<td><?php echo $langs->trans('SupplierCode'); ?></td>
<td>
<table class="nobordernopadding">
<tr>
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
</tr>
</table>
<td><?php echo $langs->trans('SupplierCode'); ?></td>
<td>
<table class="nobordernopadding">
<tr>
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
</tr>
</table>
</td>
</tr>

View File

@ -78,13 +78,12 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
*
* @return void
*/
public static function setUpBeforeClass()
{
public static function setUpBeforeClass() {
global $conf,$user,$langs,$db;
if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
}
if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
print "\n".__METHOD__." This PHPUnit test can be launched manually only onto a server with PHP timezone set to TZ=Europe/Paris, not a TZ=".getServerTimeZoneString().".\n"; die();
}
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
@ -96,8 +95,7 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
*
* @return void
*/
public static function tearDownAfterClass()
{
public static function tearDownAfterClass() {
global $conf,$user,$langs,$db;
$db->rollback();