diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index 25448f239e6..7502fbffa81 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -202,6 +202,12 @@ class modProjet extends DolibarrModules
$this->rights[$r][4] = 'all';
$this->rights[$r][5] = 'supprimer';
+ $r++;
+ $this->rights[$r][0] = 145; // id de la permission
+ $this->rights[$r][1] = "Can enter time consumed on assigned tasks (timesheet)"; // libelle de la permission
+ $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
+ $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
+ $this->rights[$r][4] = 'time';
// Menus
//-------
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index a05c9e7ea97..13dbef8bff3 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -707,7 +707,8 @@ Permission34=Delete products
Permission36=See/manage hidden products
Permission38=Export products
Permission39=Ignore minimum price
-Permission41=Read projects and tasks (shared project and projects I'm contact for). Can also enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
+Permission41=Read projects and tasks (shared project and projects I'm contact for).
+Permission145=Can enter time consumed, for me or my hierarchy, on assigned tasks (Timesheet)
Permission42=Create/modify projects (shared project and projects I'm contact for). Can also create tasks and assign users to project and tasks
Permission44=Delete projects (shared project and projects I'm contact for)
Permission45=Export projects
@@ -2145,4 +2146,4 @@ RandomlySelectedIfSeveral=Randomly selected if several pictures are available
DatabasePasswordObfuscated=Database password is obfuscated in conf file
DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
APIsAreNotEnabled=APIs modules are not enabled
-YouShouldSetThisToOff=You should set this to 0 or off
\ No newline at end of file
+YouShouldSetThisToOff=You should set this to 0 or off
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 57a50388a4f..0d0dadf3327 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -707,7 +707,8 @@ Permission34=Supprimer les produits
Permission36=Voir/gérer les produits cachés
Permission38=Exporter les produits
Permission39=Ignorer le prix minimum
-Permission41=Lire les projets et tâches (partagés ou dont vous n'êtes pas contact). Permet la saisie de temps passé, pour vous-même et votre hiérarchie (vos subordonnés), sur les tâches assignées (Feuilles de temps).
+Permission41=Lire les projets et tâches (partagés ou dont vous n'êtes pas contact).
+Permission145=Permet la saisie de temps passé, pour vous-même et votre hiérarchie (vos subordonnés), sur les tâches assignées (Feuilles de temps).
Permission42=Créer/modifier les projets (projets partagés et projets pour lesquels je suis contact). Permet aussi de créer des tâches et d'assigner des utilisateurs aux projets et tâches.
Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact)
Permission45=Exporter les projets
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index a9316bcedcd..4cac12ad801 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -149,7 +149,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$action = '';
}
-if ($action == 'addtimespent' && $user->rights->projet->lire) {
+if ($action == 'addtimespent' && $user->rights->projet->time) {
$error = 0;
$timespent_durationhour = GETPOST('timespent_durationhour', 'int');
@@ -281,7 +281,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
}
}
-if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->lire) {
+if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) {
$object->fetchTimeSpent(GETPOST('lineid', 'int'));
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
$result = $object->delTimeSpent($user);
@@ -722,7 +722,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
$linktocreatetimeBtnStatus = 0;
$linktocreatetimeUrl = '';
$linktocreatetimeHelpText = '';
- if ($user->rights->projet->all->lire || $user->rights->projet->lire) { // To enter time, read permission is enough
+ if ($user->rights->projet->all->lire || $user->rights->projet->time) {
if ($projectstatic->public || $userRead > 0) {
$linktocreatetimeBtnStatus = 1;
@@ -940,7 +940,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '';
} elseif ($action == 'splitline') {
print '';
- } elseif ($action == 'createtime' && $user->rights->projet->lire) {
+ } elseif ($action == 'createtime' && $user->rights->projet->time) {
print '';
} elseif ($massaction == 'generateinvoice' && $user->rights->facture->lire) {
print '';
@@ -1122,7 +1122,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
/*
* Form to add a new line of time spent
*/
- if ($action == 'createtime' && $user->rights->projet->lire) {
+ if ($action == 'createtime' && $user->rights->projet->time) {
print ''."\n";
if (!empty($id)) {
print '';
@@ -1537,7 +1537,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '';
print ' ';
print '';
- } elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks
+ } elseif ($user->rights->projet->time || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) {
if ($conf->MAIN_FEATURES_LEVEL >= 2) {
print ' ';