From c986ab95cff6e570cd777d04fedf9563b27503a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Jun 2020 14:09:43 +0200 Subject: [PATCH] FIX Edit of a time spent line --- htdocs/projet/tasks/time.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 78f5039fe8a..c0adf0984cc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -215,11 +215,11 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) } } -if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel"] && $user->rights->projet->lire) +if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $user->rights->projet->lire) { $error = 0; - if (empty($_POST["new_durationhour"]) && empty($_POST["new_durationmin"])) + if (!GETPOST("new_durationhour") && !GETPOST("new_durationmin")) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Duration")), null, 'errors'); $error++; @@ -227,9 +227,9 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel if (!$error) { - if ($_POST['taskid'] != $id) + if (GETPOST('taskid', 'int') != $id) // GETPOST('taskid') is id of new task { - $id = $_POST['taskid']; + $id = GETPOST('taskid', 'int'); $object->fetchTimeSpent(GETPOST('lineid', 'int')); // TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids)) @@ -1363,6 +1363,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; if (!$i) $totalarray['nbfield']++; } + } else { + print ''; } // Task label