From dd5e42e3253b22d69a0c465e101a97e6f0871dc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Jun 2019 22:17:04 +0200 Subject: [PATCH] FIX #11325 FIX #5249 --- htdocs/projet/tasks/time.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f3da816fabd..766c2b38e2d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -467,7 +467,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $object->project = clone $projectstatic; } - $userWrite = $projectstatic->restrictedProjectArea($user, 'write'); + $userRead = $projectstatic->restrictedProjectArea($user, 'read'); $linktocreatetime = ''; if ($projectstatic->id > 0) @@ -582,9 +582,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $linktocreatetimeBtnStatus = 0; $linktocreatetimeUrl = ''; $linktocreatetimeHelpText = ''; - if ($user->rights->projet->all->creer || $user->rights->projet->creer) + if ($user->rights->projet->all->lire || $user->rights->projet->lire) // To enter time, read permission is enough { - if ($projectstatic->public || $userWrite > 0) + if ($projectstatic->public || $userRead > 0) { $linktocreatetimeBtnStatus = 1; @@ -1017,7 +1017,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) // Duration - Time spent print ''; - print $form->select_duration('timespent_duration', ($_POST['timespent_duration']?$_POST['timespent_duration']:''), 0, 'text'); + $durationtouse = ($_POST['timespent_duration']?$_POST['timespent_duration']:''); + if (GETPOSTISSET('timespent_durationhour') || GETPOSTISSET('timespent_durationmin')) + { + $durationtouse = (GETPOST('timespent_durationhour') * 3600 + GETPOST('timespent_durationmin') * 60); + } + print $form->select_duration('timespent_duration', $durationtouse, 0, 'text'); print ''; // Progress declared