diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 155cb261040..c57610d0130 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -74,7 +74,7 @@ $socid = 0; restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); -$permissiontoadd = $$user->rights->mrp->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$permissiontoadd = $user->rights->projet->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php /* diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index bc6ec7d15cf..ef8ac6aa9df 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -659,9 +659,10 @@ if ($action == 'confirm_generateinter') { if (!$error) { $arrayoftasks = array(); foreach ($toselect as $key => $value) { - // Get userid, timepent + // Get userid, timespent $object->fetchTimeSpent($value); // $object->id is the task id + $arrayoftasks[$object->timespent_id]['id'] = $object->id; $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; $arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note; @@ -670,7 +671,7 @@ if ($action == 'confirm_generateinter') { foreach ($arrayoftasks as $timespent_id => $value) { $ftask = new Task($db); - $ftask->fetch($object->id); + $ftask->fetch($value['id']); // Define qty per hour $qtyhour = $value['timespent'] / 3600; $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); @@ -1433,12 +1434,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Note print '