';
print '';
print img_object('', 'user').' '.$langs->trans("Users");
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 25c3283846c..ea74482b4a1 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2006-2018 Laurent Destailleur
+ * Copyright (C) 2006-2020 Laurent Destailleur
* Copyright (C) 2010-2012 Regis Houssin
* Copyright (C) 2011 Juanjo Menent
* Copyright (C) 2018 Ferran Marcet
@@ -53,6 +53,7 @@ $projectid = GETPOST('projectid', 'int');
$ref = GETPOST('ref', 'alpha');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
+$tab = GETPOST('tab', 'aZ09');
$search_day = GETPOST('search_day', 'int');
$search_month = GETPOST('search_month', 'int');
@@ -620,8 +621,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
if ($withproject)
{
// Tabs for project
- if (empty($id)) $tab = 'timespent';
+ if (empty($id) || $tab == 'timespent') $tab = 'timespent';
else $tab = 'tasks';
+
$head = project_prepare_head($projectstatic);
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'));
@@ -958,6 +960,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print '';
print '';
print '';
+ print '';
if ($massaction == 'generateinvoice')
{
@@ -1139,7 +1142,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print ' | ';
print " |
\n";
- print '';
// Date
print '| ';
@@ -1149,28 +1152,31 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
print ' | ';
// Task
+ $nboftasks = 0;
if (empty($id))
{
print '';
- $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
+ $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, '');
print ' | ';
}
// Contributor
print '';
- print img_object('', 'user', 'class="hideonsmartphone"');
$contactsofproject = $projectstatic->getListContactId('internal');
if (count($contactsofproject) > 0)
{
+ print img_object('', 'user', 'class="hideonsmartphone"');
if (in_array($user->id, $contactsofproject)) $userid = $user->id;
else $userid = $contactsofproject[0];
if ($projectstatic->public) $contactsofproject = array();
- print $form->select_dolusers((GETPOST('userid', 'int') ?GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
+ print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200');
}
else
{
- print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
+ if ($nboftasks) {
+ print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime');
+ }
}
print ' | ';
@@ -1202,8 +1208,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
}
print '';
- print '';
- print '';
+ print '';
+ print '';
print ' |
';
print '