FIX #19294 implement detailed timespent in task of project API

This commit is contained in:
mschamp
2022-01-28 22:59:32 +01:00
parent d9691e16d5
commit a8dd73d007
3 changed files with 97 additions and 8 deletions

View File

@@ -228,7 +228,7 @@ class Projects extends DolibarrApi
* See also API /tasks
*
* @param int $id Id of project
* @param int $includetimespent 0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines (2 is no implemented yet)
* @param int $includetimespent 0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines
* @return int
*
* @url GET {id}/tasks
@@ -253,9 +253,8 @@ class Projects extends DolibarrApi
if ($includetimespent == 1) {
$timespent = $line->getSummaryOfTimeSpent(0);
}
if ($includetimespent == 1) {
// TODO
// Add class for timespent records and loop and fill $line->lines with records of timespent
if ($includetimespent == 2) {
$timespent = $line->fetchTimeSpentOnTask();
}
array_push($result, $this->_cleanObjectDatas($line));
}