Fix phpcs
This commit is contained in:
parent
ebc3210308
commit
0670a00b83
@ -341,8 +341,7 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
// Update fields properties in realtime
|
// 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 "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print '$(document).ready(function () {
|
print '$(document).ready(function () {
|
||||||
setPaymentType();
|
setPaymentType();
|
||||||
|
|||||||
@ -356,8 +356,7 @@ if ($action == 'create') {
|
|||||||
// Company
|
// Company
|
||||||
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
if (!empty($conf->societe->enabled) && !empty($conf->global->DONATION_USE_THIRDPARTIES)) {
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
if ($soc->id > 0)
|
if ($soc->id > 0) {
|
||||||
{
|
|
||||||
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
|
print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $soc->getNomUrl(1);
|
print $soc->getNomUrl(1);
|
||||||
|
|||||||
@ -2133,11 +2133,11 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Disable button to pay and show hourglass cursor */
|
/* Disable button to pay and show hourglass cursor */
|
||||||
jQuery('#hourglasstopay').show();
|
jQuery('#hourglasstopay').show();
|
||||||
jQuery('#buttontopay').hide();
|
jQuery('#buttontopay').hide();
|
||||||
|
|
||||||
stripe.handleCardPayment(
|
stripe.handleCardPayment(
|
||||||
clientSecret, cardElement, {
|
clientSecret, cardElement, {
|
||||||
payment_method_data: {
|
payment_method_data: {
|
||||||
billing_details: {
|
billing_details: {
|
||||||
@ -2159,32 +2159,32 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme
|
|||||||
}
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
save_payment_method: <?php if ($stripecu) {
|
save_payment_method: <?php if ($stripecu) {
|
||||||
print 'true';
|
print 'true';
|
||||||
} else {
|
} else {
|
||||||
print 'false';
|
print 'false';
|
||||||
} ?> /* true when a customer was provided when creating payment intent. true ask to save the card */
|
} ?> /* 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);
|
console.log(result);
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
console.log("Error on result of handleCardPayment");
|
console.log("Error on result of handleCardPayment");
|
||||||
jQuery('#buttontopay').show();
|
jQuery('#buttontopay').show();
|
||||||
jQuery('#hourglasstopay').hide();
|
jQuery('#hourglasstopay').hide();
|
||||||
// Inform the user if there was an error
|
// Inform the user if there was an error
|
||||||
var errorElement = document.getElementById('card-errors');
|
var errorElement = document.getElementById('card-errors');
|
||||||
errorElement.textContent = result.error.message;
|
errorElement.textContent = result.error.message;
|
||||||
} else {
|
} else {
|
||||||
// The payment has succeeded. Display a success message.
|
// The payment has succeeded. Display a success message.
|
||||||
console.log("No error on result of handleCardPayment, so we submit the form");
|
console.log("No error on result of handleCardPayment, so we submit the form");
|
||||||
// Submit the form
|
// Submit the form
|
||||||
jQuery('#buttontopay').hide();
|
jQuery('#buttontopay').hide();
|
||||||
jQuery('#hourglasstopay').show();
|
jQuery('#hourglasstopay').show();
|
||||||
// Send form (action=charge that will do nothing)
|
// Send form (action=charge that will do nothing)
|
||||||
jQuery('#payment-form').submit();
|
jQuery('#payment-form').submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -86,14 +86,14 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
||||||
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
||||||
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
|
<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>
|
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -94,14 +94,14 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
<td><span class="fieldrequired"><?php echo $langs->trans('Supplier'); ?></span></td>
|
||||||
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
<td><?php echo $this->control->tpl['yn_supplier']; ?></td>
|
||||||
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
<td><?php echo $langs->trans('SupplierCode'); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<table class="nobordernopadding">
|
<table class="nobordernopadding">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="code_fournisseur" size="16" value="<?php echo $this->control->tpl['suppliercode']; ?>" maxlength="24"></td>
|
<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>
|
<td><?php echo $this->control->tpl['help_suppliercode']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -78,13 +78,12 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass() {
|
||||||
{
|
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
|
|
||||||
if (getServerTimeZoneString() != 'Europe/Paris' && getServerTimeZoneString() != 'Europe/Berlin') {
|
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();
|
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.
|
$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
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass() {
|
||||||
{
|
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user