This commit is contained in:
Florian HENRY 2021-07-16 11:14:30 +02:00
parent 813440bd16
commit 63a47112ae
4 changed files with 17 additions and 9 deletions

View File

@ -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
//-------

View File

@ -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
YouShouldSetThisToOff=You should set this to 0 or off

View File

@ -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

View File

@ -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 '<input type="hidden" name="action" value="updateline">';
} elseif ($action == 'splitline') {
print '<input type="hidden" name="action" value="updatesplitline">';
} elseif ($action == 'createtime' && $user->rights->projet->lire) {
} elseif ($action == 'createtime' && $user->rights->projet->time) {
print '<input type="hidden" name="action" value="addtimespent">';
} elseif ($massaction == 'generateinvoice' && $user->rights->facture->lire) {
print '<input type="hidden" name="action" value="confirm_generateinvoice">';
@ -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 '<!-- table to add time spent -->'."\n";
if (!empty($id)) {
print '<input type="hidden" name="taskid" value="'.$id.'">';
@ -1537,7 +1537,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
print '<br>';
print '<input type="submit" class="button buttongen margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
} 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 '&nbsp;';