Merge pull request #13082 from oscim/patch-20

report and apply GETPOST method
This commit is contained in:
Laurent Destailleur 2020-02-12 18:43:59 +01:00 committed by GitHub
commit 08bd69d577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,11 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm');
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
$label = GETPOST('label', 'alpha');
$actioncode = GETPOST('actioncode');
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
@ -134,10 +139,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
// Add social contribution
if ($action == 'add' && $user->rights->tax->charges->creer)
{
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
$amount = price2num(GETPOST('amount'));
$actioncode = GETPOST('actioncode');
if (!$dateech)
{
@ -187,8 +189,6 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->creer)
{
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
$amount = price2num(GETPOST('amount'));
if (!$dateech)