Merge pull request #15450 from frederic34/patch-10

remove warnings
This commit is contained in:
Laurent Destailleur 2020-11-20 13:33:49 +01:00 committed by GitHub
commit e6878c23a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@
* Copyright (C) 2014-2018 Charlene Benke <charlies@patas-monkey.com> * Copyright (C) 2014-2018 Charlene Benke <charlies@patas-monkey.com>
* Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com> * Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com>
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -57,8 +58,8 @@ $langs->loadLangs(array('bills', 'companies', 'interventions'));
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int'); $socid = (int) GETPOST('socid', 'int');
$contratid = GETPOST('contratid', 'int'); $contratid = (int) GETPOST('contratid', 'int');
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha'); $cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
@ -175,8 +176,7 @@ if (empty($reshook))
} else { } else {
$mesg = $object->error; $mesg = $object->error;
} }
} elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer) } elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
{
$result = $object->setDraft($user); $result = $object->setDraft($user);
if ($result >= 0) if ($result >= 0)
{ {
@ -187,8 +187,7 @@ if (empty($reshook))
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (!empty($newlang)) if (!empty($newlang)) {
{
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
@ -200,12 +199,11 @@ if (empty($reshook))
} else { } else {
$mesg = $object->error; $mesg = $object->error;
} }
} elseif ($action == 'add' && $user->rights->ficheinter->creer) } elseif ($action == 'add' && $user->rights->ficheinter->creer) {
{
$object->socid = $socid; $object->socid = $socid;
$object->duration = GETPOST('duration', 'int'); $object->duration = (int) GETPOST('duration', 'int');
$object->fk_project = GETPOST('projectid', 'int'); $object->fk_project = (int) GETPOST('projectid', 'int');
$object->fk_contrat = GETPOST('contratid', 'int'); $object->fk_contrat = (int) GETPOST('contratid', 'int');
$object->author = $user->id; $object->author = $user->id;
$object->description = GETPOST('description', 'restricthtml'); $object->description = GETPOST('description', 'restricthtml');
$object->ref = $ref; $object->ref = $ref;
@ -409,11 +407,10 @@ if (empty($reshook))
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")); $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty"));
$action = 'create'; $action = 'create';
} }
} elseif ($action == 'update' && $user->rights->ficheinter->creer) } elseif ($action == 'update' && $user->rights->ficheinter->creer) {
{
$object->socid = $socid; $object->socid = $socid;
$object->fk_project = GETPOST('projectid', 'int'); $object->fk_project = (int) GETPOST('projectid', 'int');
$object->fk_contrat = GETPOST('contratid', 'int'); $object->fk_contrat = (int) GETPOST('contratid', 'int');
$object->author = $user->id; $object->author = $user->id;
$object->description = GETPOST('description', 'restricthtml'); $object->description = GETPOST('description', 'restricthtml');
$object->ref = $ref; $object->ref = $ref;
@ -520,8 +517,7 @@ if (empty($reshook))
elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer) elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer)
{ {
$result = $object->setStatut(2); $result = $object->setStatut(2);
if ($result > 0) if ($result > 0) {
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
} else { } else {