fix error, if there is no old vacation specifying a number of days, setting now same default as UI: 3 days

also some docu fixes
This commit is contained in:
ralf 2023-08-02 11:01:58 +02:00
parent 11a09c6269
commit bed1e43200
3 changed files with 7 additions and 4 deletions

View File

@ -154,7 +154,7 @@ The content of the POST request is a JSON encoded object with following attribut
``` ```
curl -i https://example.org/egroupware/groupdav.php/mail/vacation --user <user> -X POST -H 'Content-Type: application/json' \ curl -i https://example.org/egroupware/groupdav.php/mail/vacation --user <user> -X POST -H 'Content-Type: application/json' \
--data-binary '{"message":"I'm away from $$start$$ to $$end$$, will respond when I'm back.","start":"2023-01-01","end":"2023-01-10"}' --data-binary '{"text":"I'm away from $$start$$ to $$end$$, will respond when I'm back.","start":"2023-01-01","end":"2023-01-10"}'
HTTP/1.1 200 Ok HTTP/1.1 200 Ok

View File

@ -31,7 +31,7 @@ One can use the following URLs relative (!) to https://example.org/egroupware/gr
- ```/infolog/``` infologs of current user - ```/infolog/``` infologs of current user
- ```/(resources|locations)/<resource-name>/calendar``` calendar of a resource/location, if user has rights to view - ```/(resources|locations)/<resource-name>/calendar``` calendar of a resource/location, if user has rights to view
- ```/<current-username>/(resource|location)-<resource-name>``` shared calendar from a resource/location - ```/<current-username>/(resource|location)-<resource-name>``` shared calendar from a resource/location
- ```/mail/``` only REST API, currently only send EMail or launch interactive compose windows - ```/mail/``` REST API only
Shared addressbooks or calendars are only shown in the users home-set, if he subscribed to it via his CalDAV preferences! Shared addressbooks or calendars are only shown in the users home-set, if he subscribed to it via his CalDAV preferences!
@ -41,7 +41,10 @@ from the data of an ```allprop``` PROPFIND, allow browsing CalDAV/CardDAV tree w
## REST API: using EGroupware CalDAV/CardDAV server with JSON ## REST API: using EGroupware CalDAV/CardDAV server with JSON
- [Addressbook](Addressbook.md) - [Addressbook](Addressbook.md)
- [Calendar](Calendar.md) (currently recurring events are readonly, they are returned but can not be created or modified) - [Calendar](Calendar.md) (currently recurring events are readonly, they are returned but can not be created or modified)
- [Mail](Mail.md) (currently only sending mails or opening interactive compose windows) - [Mail](Mail.md) (currently only sending mails, opening interactive compose windows and vacation handling)
> For the REST API you always have to send an "Accept: application/json" header and for POST & PUT requests additionally
> a "Content-Type: application/json" header, otherwise you talk to the CalDAV/CardDAV server and don't get the response you expect!
Following RFCs / drafts used/planned for JSON encoding of resources Following RFCs / drafts used/planned for JSON encoding of resources
* [draft-ietf-jmap-jscontact: JSContact: A JSON Representation of Contact Data](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-jscontact) * [draft-ietf-jmap-jscontact: JSContact: A JSON Representation of Contact Data](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-jscontact)

View File

@ -190,7 +190,7 @@ class ApiHandler extends Api\CalDAV\Handler
} }
$vacation_rule = null; $vacation_rule = null;
$sieve = new Api\Mail\Sieve($account->imapServer()); $sieve = new Api\Mail\Sieve($account->imapServer());
$sieve->setVacation(array_merge($vacation, $update), null, $vacation_rule, true); $sieve->setVacation(array_merge(['days' => 3], $vacation, $update), null, $vacation_rule, true);
echo json_encode([ echo json_encode([
'status' => 200, 'status' => 200,
'message' => 'Vacation handling updated', 'message' => 'Vacation handling updated',