* InfoLog/REST API: attributes "progress" and "percentComplete" were NOT parsed when creating or updating entries

This commit is contained in:
ralf 2024-07-30 09:42:02 +02:00
parent f88089f1cf
commit 6bc1306b08
2 changed files with 14 additions and 3 deletions

View File

@ -351,6 +351,15 @@ class JsCalendar extends JsBase
$event['info_priority'] = self::parsePriority($value, true);
break;
case 'progress':
$event['info_status'] = self::parseProgress($value, $event['info_type'] ??
(isset($data['egroupware.org:type']) ? self::parseInfoType($data['egroupware.org:type']) : 'task'));
break;
case 'percentComplete':
$event['info_percent'] = self::parseInt($value);
break;
case 'privacy':
$event['info_access'] = self::parsePrivacy($value);
break;
@ -432,9 +441,10 @@ class JsCalendar extends JsBase
{
if (!($status = array_search($progress, self::$status2progress)))
{
if (!str_starts_with('egroupware.org:', $progress) ||
($status = substr($progress, strlen('egroupware.org:'))) &&
isset($info_type) && !isset(self::getInfolog()->status[$info_type][$status]))
if (!str_starts_with($progress, 'egroupware.org:') ||
($status = substr($progress, strlen('egroupware.org:'))) && !(
isset(self::$status2progress[$status]) ||
isset($info_type) && isset(self::getInfolog()->status[$info_type][$status])))
{
$status = 'not-started';
}

View File

@ -18,6 +18,7 @@ Following RFCs / drafts used/planned for JSON encoding of InfoLog entries
* `completed` (InfoLog `done`)
* `cancelled`
* `egroupware.org:<infolog-status>` (all other status supported by InfoLog use a `egroupware.org:` prefix)
* `percentComplete` integer value between 0 and 100
* `participants` contains task-owner (role `owner`), responsible users (role `attendee`) and CC'ed (role `informational`)
* participants is an object with either the numerical user-id or the email address as attribute-name and an object with the following attributes:
* `name` of owner, responsible or CC'ed