Conflicts:
	htdocs/projet/tasks/time.php
This commit is contained in:
Laurent Destailleur 2019-06-16 22:17:04 +02:00
parent 5a4f2fa0b3
commit c0a30d1ff5

View File

@ -317,7 +317,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$object->project = clone $projectstatic; $object->project = clone $projectstatic;
} }
$userWrite = $projectstatic->restrictedProjectArea($user,'write'); $userRead = $projectstatic->restrictedProjectArea($user, 'read');
$linktocreatetime = '';
if ($projectstatic->id > 0) if ($projectstatic->id > 0)
{ {
@ -427,11 +428,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '<br>'; print '<br>';
// Link to create time // Link to create time
//if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) if ($user->rights->projet->all->lire || $user->rights->projet->lire)) // To enter time, read permission is enough
//{
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{ {
if ($projectstatic->public || $userWrite > 0) if ($projectstatic->public || $userRead > 0)
{ {
if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project
{ {
@ -453,7 +452,6 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{ {
$linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'<span class="fa fa-plus-circle valignmiddle"></span></a>'; $linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
} }
//}
} }
} }
@ -803,7 +801,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
// Duration - Time spent // Duration - Time spent
print '<td>'; print '<td>';
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 '</td>'; print '</td>';
// Progress declared // Progress declared