clean indent

This commit is contained in:
Frédéric FRANCE 2019-10-27 10:07:47 +01:00
parent b2b057e9b5
commit 20f97807ce
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
5 changed files with 70 additions and 74 deletions

View File

@ -444,13 +444,13 @@ if (empty($reshook))
$error++;
}
$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year'));
$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
if (!empty($date_start) && !empty($date_end) && $date_start > $date_end)
{
setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors');
$error++;
}
$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year'));
$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year'));
if (!empty($date_start) && !empty($date_end) && $date_start > $date_end)
{
setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors');
$error++;
}
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@ -531,7 +531,7 @@ if (empty($reshook))
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat/100)), 'MU');
}
else
{
{
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat/100)), 'MU');
}
}
@ -727,9 +727,9 @@ if (empty($reshook))
$objectline->pa_ht=$pa_ht;
if ($fk_unit > 0) {
$objectline->fk_unit = GETPOST('unit');
$objectline->fk_unit = GETPOST('unit');
} else {
$objectline->fk_unit = null;
$objectline->fk_unit = null;
}
// Extrafields
@ -1418,19 +1418,20 @@ else
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->contrat->creer)
{
if ($action != 'classify')
if ($action != 'classify') {
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
@ -2253,7 +2254,7 @@ $db->close();
if (! empty($conf->margin->enabled) && $action == 'editline')
{
// TODO Why this ? To manage margin on contracts ?
?>
?>
<script type="text/javascript">
$(document).ready(function() {
var idprod = $("input[name='idprod']").val();
@ -2308,5 +2309,5 @@ $(document).ready(function() {
}
});
</script>
<?php
<?php
}

View File

@ -9,7 +9,7 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -861,9 +861,9 @@ class Contrat extends CommonObject
// multilangs
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($objp->fk_product) && ! empty($loadalsotranslation)) {
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
$line = new Product($this->db);
$line->fetch($objp->fk_product);
$line->getMultiLangs();
}
$this->lines[$pos] = $line;

View File

@ -24,19 +24,19 @@
// define CDAV_CONTACT_TAG if not
if(!defined('CDAV_CONTACT_TAG'))
{
if(isset($conf->global->CDAV_CONTACT_TAG))
if (isset($conf->global->CDAV_CONTACT_TAG))
define('CDAV_CONTACT_TAG', $conf->global->CDAV_CONTACT_TAG);
else
define('CDAV_CONTACT_TAG', '');
else
define('CDAV_CONTACT_TAG', '');
}
// define CDAV_URI_KEY if not
if(!defined('CDAV_URI_KEY'))
{
if(isset($conf->global->CDAV_URI_KEY))
if (isset($conf->global->CDAV_URI_KEY))
define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY);
else
define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8));
else
define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8));
}

View File

@ -220,7 +220,7 @@ if ($format == 'rss')
$result=readfile($outputfile);
if (! $result) print 'File '.$outputfile.' was empty.';
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
exit;
}
else

View File

@ -1878,42 +1878,37 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
//if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($paymentintent))
//{
print '
<table id="dolpaymenttable" summary="Payment form" class="center">
<tbody><tr><td class="textpublicpayment">';
print '
<table id="dolpaymenttable" summary="Payment form" class="center">
<tbody><tr><td class="textpublicpayment">';
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{
print '<div id="payment-request-button"><!-- A Stripe Element will be inserted here. --></div>';
}
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{
print '<div id="payment-request-button"><!-- A Stripe Element will be inserted here. --></div>';
}
print '
<div class="form-row left">
print '<div class="form-row left">';
print '<label for="card-element">'.$langs->trans("CreditOrDebitCard").'</label>';
<label for="card-element">'.$langs->trans("CreditOrDebitCard").'</label>';
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{
print '<br><input id="cardholder-name" class="marginbottomonly" name="cardholder-name" value="" type="text" placeholder="'.$langs->trans("CardOwner").'" autocomplete="off" autofocus required>';
}
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{
print '<br><input id="cardholder-name" class="marginbottomonly" name="cardholder-name" value="" type="text" placeholder="'.$langs->trans("CardOwner").'" autocomplete="off" autofocus required>';
}
print '<div id="card-element">
<!-- a Stripe Element will be inserted here. -->
</div>';
print '<div id="card-element">
<!-- a Stripe Element will be inserted here. -->
</div>
print '<!-- Used to display form errors -->
<div id="card-errors" role="alert"></div>
</div>';
<!-- Used to display form errors -->
<div id="card-errors" role="alert"></div>
print '<br>';
print '<button class="button buttonpayment" style="text-align: center; padding-left: 0; padding-right: 0;" id="buttontopay" data-secret="'.(is_object($paymentintent) ? $paymentintent->client_secret : '').'">'.$langs->trans("ValidatePayment").'</button>';
print '<img id="hourglasstopay" class="hidden" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/working.gif'.'">';
</div>
<br>';
print '<button class="button buttonpayment" style="text-align: center; padding-left: 0; padding-right: 0;" id="buttontopay" data-secret="'.(is_object($paymentintent) ? $paymentintent->client_secret : '').'">'.$langs->trans("ValidatePayment").'</button>';
print '<img id="hourglasstopay" class="hidden" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/working.gif'.'">';
print '
</td></tr></tbody>
</table>';
print '</td></tr></tbody>';
print '</table>';
//}
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
@ -2006,7 +2001,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
{
print $e->getMessage();
}
?>
?>
// Code for payment with option STRIPE_USE_NEW_CHECKOUT set
// Create a Stripe client.
@ -2049,11 +2044,11 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
});
<?php
<?php
}
elseif (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{
?>
?>
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set
// Create a Stripe client.
@ -2153,11 +2148,11 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
}
});
<?php
<?php
}
else // Old method (not SCA ready)
{
?>
?>
// Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off
// Create a Stripe client.
@ -2209,7 +2204,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
<?php
if (empty($conf->global->STRIPE_USE_3DSECURE)) // Ask credit card directly, no 3DS test
{
?>
?>
/* Use token */
stripe.createToken(card).then(function(result) {
if (result.error) {
@ -2221,11 +2216,11 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
stripeTokenHandler(result.token);
}
});
<?php
<?php
}
else // Ask credit card with 3DS test
{
?>
?>
/* Use 3DS source */
stripe.createSource(card).then(function(result) {
if (result.error) {
@ -2237,7 +2232,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
stripeSourceHandler(result.source);
}
});
<?php
<?php
}
?>
});
@ -2291,7 +2286,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
form.submit();
}
<?php
<?php
}
print '</script>';