improve calendar features

This commit is contained in:
2026-03-18 14:17:38 +01:00
parent 14d4a2895a
commit 975e195ae3
13 changed files with 2274 additions and 138 deletions

View File

@@ -395,6 +395,68 @@ class CalDavClient
}
}
/**
* Public wrapper for findObjectByUid.
*
* @param string $caldavUrl
* @param string $username
* @param string $password
* @param string $uid
* @return array{href: string, etag: string, data: string}|null
*/
public static function findObjectByUidPublic(
string $caldavUrl,
string $username,
string $password,
string $uid
): ?array {
return self::findObjectByUid($caldavUrl, $username, $password, $uid);
}
/**
* Public wrapper for putCalendarObject.
*
* @param string $href
* @param string $username
* @param string $password
* @param string $data
* @param string $etag
* @return string Empty string on success, error on failure
*/
public static function putCalendarObjectPublic(
string $href,
string $username,
string $password,
string $data,
string $etag
): string {
return self::putCalendarObject($href, $username, $password, $data, $etag);
}
/**
* Delete a calendar object from the server.
*
* @param string $href Full URL of the calendar object
* @param string $username
* @param string $password
* @param string $etag ETag for If-Match header (empty to skip)
* @return bool True on success
*/
public static function deleteCalendarObject(
string $href,
string $username,
string $password,
string $etag
): bool {
$headers = [];
if ($etag !== '') {
$headers[] = 'If-Match: ' . $etag;
}
$response = self::request('DELETE', $href, $username, $password, '', $headers);
return $response !== null;
}
/**
* Perform an HTTP request to a CalDAV server.
*