diff --git a/doc/REST-CalDAV-CardDAV/Timesheet.md b/doc/REST-CalDAV-CardDAV/Timesheet.md index 2bd42c7e1f..b777e9ba62 100644 --- a/doc/REST-CalDAV-CardDAV/Timesheet.md +++ b/doc/REST-CalDAV-CardDAV/Timesheet.md @@ -14,6 +14,7 @@ Following schema is used for JSON encoding of timesheets * duration: integer in minutes * quantity: double * project: string +* pm_id: integer ID of ProjectManager app (readonly currently!) * unitprice: double * category: category object with a single(!) category-name e.g. `{"category name": true}` * owner: string with either email or username or integer ID @@ -188,6 +189,7 @@ curl 'https://example.org/egroupware/groupdav.php/timesheet/140' -H "Accept: app "duration": 60, "quantity": 1, "project": "2024-0001: Test Project", + "pm_id": 123, "unitprice": 100.0, "pricelist": 123, "owner": "ralf@example.org", diff --git a/timesheet/src/JsTimesheet.php b/timesheet/src/JsTimesheet.php index 212195056e..702f357536 100644 --- a/timesheet/src/JsTimesheet.php +++ b/timesheet/src/JsTimesheet.php @@ -52,7 +52,8 @@ class JsTimesheet extends Api\CalDAV\JsBase 'description' => $timesheet['description'], 'start' => self::UTCDateTime($timesheet['start'], true), 'duration' => (int)$timesheet['duration'], - 'project' => $timesheet['project'], + 'project' => $timesheet['project_blur'] ?? null, + 'pm_id' => !empty($timesheet['pm_id']) ? (int)$timesheet['pm_id'] : null, 'quantity' => (double)$timesheet['quantity'], 'unitprice' => (double)$timesheet['unitprice'], 'category' => self::categories($timesheet['cat_id']),