From 3056197848d6749fb5fc806e48d7fd0ecaf81a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 19 Nov 2020 20:57:26 +0100 Subject: [PATCH] remove warnings --- htdocs/fichinter/card.php | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index da1de06cc16..51cc56b408d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -8,6 +8,7 @@ * Copyright (C) 2014-2018 Charlene Benke * Copyright (C) 2015-2016 Abbes Bahfir * Copyright (C) 2018 Philippe Grand + * Copyright (C) 2020 Frédéric France * * 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 @@ -57,8 +58,8 @@ $langs->loadLangs(array('bills', 'companies', 'interventions')); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); -$contratid = GETPOST('contratid', 'int'); +$socid = (int) GETPOST('socid', 'int'); +$contratid = (int) GETPOST('contratid', 'int'); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); @@ -175,8 +176,7 @@ if (empty($reshook)) } else { $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); if ($result >= 0) { @@ -187,8 +187,7 @@ if (empty($reshook)) $newlang = ''; 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 (!empty($newlang)) - { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); } @@ -200,14 +199,13 @@ if (empty($reshook)) } else { $mesg = $object->error; } - } elseif ($action == 'add' && $user->rights->ficheinter->creer) - { + } elseif ($action == 'add' && $user->rights->ficheinter->creer) { $object->socid = $socid; - $object->duration = GETPOST('duration', 'int'); - $object->fk_project = GETPOST('projectid', 'int'); - $object->fk_contrat = GETPOST('contratid', 'int'); + $object->duration = (int) GETPOST('duration', 'int'); + $object->fk_project = (int) GETPOST('projectid', 'int'); + $object->fk_contrat = (int) GETPOST('contratid', 'int'); $object->author = $user->id; - $object->description = GETPOST('description', 'restricthtml'); + $object->description = GETPOST('description', 'restricthtml'); $object->ref = $ref; $object->model_pdf = GETPOST('model', 'alpha'); $object->note_private = GETPOST('note_private', 'restricthtml'); @@ -409,13 +407,12 @@ if (empty($reshook)) $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")); $action = 'create'; } - } elseif ($action == 'update' && $user->rights->ficheinter->creer) - { + } elseif ($action == 'update' && $user->rights->ficheinter->creer) { $object->socid = $socid; - $object->fk_project = GETPOST('projectid', 'int'); - $object->fk_contrat = GETPOST('contratid', 'int'); + $object->fk_project = (int) GETPOST('projectid', 'int'); + $object->fk_contrat = (int) GETPOST('contratid', 'int'); $object->author = $user->id; - $object->description = GETPOST('description', 'restricthtml'); + $object->description = GETPOST('description', 'restricthtml'); $object->ref = $ref; $result = $object->update($user); @@ -520,8 +517,7 @@ if (empty($reshook)) elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer) { $result = $object->setStatut(2); - if ($result > 0) - { + if ($result > 0) { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else {