Skip to content
Permalink
Browse files

Merge branch 'develop' of github.com:agendav/agendav into develop

  • Loading branch information...
adobo committed Jan 23, 2018
2 parents 899d27c + e096d91 commit b6a368a3f072870931f85a63fa6e4ba3586d3964
Showing with 236 additions and 142 deletions.
  1. +26 −17 web/src/CalDAV/Client.php
  2. +1 −1 web/src/CalDAV/Filter/PrincipalPropertySearch.php
  3. +1 −1 web/src/CalDAV/Filter/Uid.php
  4. +4 −2 web/src/CalDAV/Resource/Calendar.php
  5. +1 −1 web/src/CalDAV/Resource/CalendarObject.php
  6. +3 −3 web/src/CalDAV/Share/ACL.php
  7. +4 −4 web/src/CalDAV/Share/Permissions.php
  8. +3 −3 web/src/CalendarFinder.php
  9. +1 −1 web/src/Controller/Calendars/Create.php
  10. +1 −1 web/src/Controller/Calendars/Delete.php
  11. +1 −1 web/src/Controller/Calendars/InputHandlers/Shares.php
  12. +2 −2 web/src/Controller/Calendars/Save.php
  13. +6 −1 web/src/Controller/Event/Alter.php
  14. +5 −3 web/src/Controller/Event/Delete.php
  15. +3 −2 web/src/Controller/Event/Drop.php
  16. +3 −2 web/src/Controller/Event/GetBase.php
  17. +4 −3 web/src/Controller/Event/Listing.php
  18. +1 −1 web/src/Controller/Event/Resize.php
  19. +2 −2 web/src/Controller/Event/Save.php
  20. +7 −1 web/src/Controller/JSONController.php
  21. +17 −0 web/src/Controller/JavaScriptCode.php
  22. +2 −1 web/src/Controller/Preferences.php
  23. +2 −1 web/src/Csrf.php
  24. +1 −1 web/src/DB.php
  25. +3 −3 web/src/DB/Migrations/Version20140812133707.php
  26. +1 −1 web/src/DB/Migrations/Version20150804202842.php
  27. +1 −1 web/src/DB/Migrations/Version20151028190444.php
  28. +21 −3 web/src/Data/Preferences.php
  29. +9 −1 web/src/Data/Principal.php
  30. +1 −0 web/src/Data/Reminder.php
  31. +15 −6 web/src/Data/Share.php
  32. +4 −2 web/src/Data/Transformer/CalendarTransformer.php
  33. +2 −2 web/src/Data/Transformer/FullCalendarEventTransformer.php
  34. +2 −2 web/src/DateHelper.php
  35. +4 −2 web/src/Event.php
  36. +3 −2 web/src/Event/Builder/VObjectBuilder.php
  37. +1 −1 web/src/Event/RecurrenceId.php
  38. +2 −0 web/src/Event/VObjectEvent.php
  39. +5 −5 web/src/Event/VObjectEventInstance.php
  40. +13 −8 web/src/Event/VObjectHelper.php
  41. +2 −2 web/src/EventInstance.php
  42. +1 −1 web/src/Exception.php
  43. +2 −1 web/src/Http/Client.php
  44. +4 −4 web/src/Repositories/DAVPrincipalsRepository.php
  45. +6 −4 web/src/Repositories/DoctrineOrmPreferencesRepository.php
  46. +9 −7 web/src/Repositories/DoctrineOrmSharesRepository.php
  47. +4 −4 web/src/Repositories/SharesRepository.php
  48. +3 −4 web/src/Session/HttpFoundationSession.php
  49. +1 −1 web/src/Session/Session.php
  50. +6 −8 web/src/Sharing/SharingResolver.php
  51. +2 −2 web/src/XML/Generator.php
  52. +4 −6 web/src/XML/Parser.php
  53. +4 −4 web/src/XML/Toolkit.php
@@ -29,20 +29,21 @@
class Client
{
/** @type AgenDAV\Http\Client HTTP client used */
/** @type \AgenDAV\Http\Client HTTP client used */
protected $http_client;
/** @type AgenDAV\XML\Toolkit XML toolkit */
/** @type \AgenDAV\XML\Toolkit XML toolkit */
protected $xml_toolkit;
/** @type AgenDAV\Event\Parser Event parser */
/** @type \AgenDAV\Event\Parser Event parser */
protected $event_parser;
/**
* @param \AgenDAV\Http\Client $http_client
* @param \AgenDAV\XML\Toolkit $xml_toolkit
* @param \AgenDAV\Event\Parser $event_parser
*/
public function __construct(
\AgenDAV\Http\Client $http_client,
@@ -72,7 +73,7 @@ public function canAuthenticate()
}
return ($response->hasHeader('DAV') &&
preg_match('/calendar-access/', $response->getHeaderLine('DAV')));
false !== strpos($response->getHeaderLine('DAV'), "calendar-access"));
}
/**
@@ -106,8 +107,10 @@ public function getCurrentUserPrincipal()
* Queries the CalDAV server for the calendar-home-set. It will be
* requested on the principal URL
*
* @param \AgenDAV\Data\Principal User principal
* @return string Calendar home set for given principal
* @param \AgenDAV\Data\Principal $principal User principal
*
* @return string Calendar home set for given principal
*
* @throws \AgenDAV\Exception\NotFound if no calendar-home-set is returned
*/
public function getCalendarHomeSet(Principal $principal)
@@ -179,7 +182,9 @@ public function getCalendars($url, $recurse = true)
* Gets a calendar details
*
* @param string $url URL
* @param \AgenDAV\CalDAV\Resource\Calendar Found calendar
*
* @return Calendar
*
* @throws \AgenDAV\Exception\NotFound In case the server replies with a 2xx code but
* no valid calendars are found
*/
@@ -197,7 +202,7 @@ public function getCalendarByUrl($url)
/**
* Creates a calendar collection
*
* @param AgenDAV\CalDAV\Resource\Calendar $calendar Calendar that we want to create
* @param \AgenDAV\CalDAV\Resource\Calendar $calendar Calendar that we want to create
* @return void
*/
public function createCalendar(Calendar $calendar)
@@ -287,7 +292,7 @@ public function fetchObjectByUid(Calendar $calendar, $uid)
/**
* Puts an calendar object on the CalDAV server, inside its parent collection
*
* @param AgenDAV\CalDAV\Resource\CalendarObject $calendar_object
* @param \AgenDAV\CalDAV\Resource\CalendarObject $calendar_object
* @return \GuzzleHttp\Psr7\Response
*/
public function uploadCalendarObject(CalendarObject $calendar_object)
@@ -311,7 +316,8 @@ public function uploadCalendarObject(CalendarObject $calendar_object)
/**
* Deletes a calendar object from the CalDAV server
*
* @param AgenDAV\CalDAV\Resource\CalendarObject
* @param CalendarObject $calendar_object
*
* @return \GuzzleHttp\Psr7\Response
*/
public function deleteCalendarObject(CalendarObject $calendar_object)
@@ -347,7 +353,8 @@ public function applyACL(Calendar $calendar, ACL $acl)
* @param string $url URL
* @param int $depth Depth header
* @param string $body Request body
* @result array key-value array, where keys are paths and properties are values
*
* @return array key-value array, where keys are paths and properties are values
*/
public function propfind($url, $depth, $body)
{
@@ -357,7 +364,7 @@ public function propfind($url, $depth, $body)
$contents = (string)$response->getBody();
$single_element_expected = ($depth === 0);
$result = $this->xml_toolkit->parseMultiStatus($contents, $single_element_expected);
$result = $this->xml_toolkit->parseMultistatus($contents, $single_element_expected);
return $result;
}
@@ -368,7 +375,8 @@ public function propfind($url, $depth, $body)
* @param string $url URL
* @param string $body Request body
* @param int $depth Depth header for this request. Default value: 1
* @result array key-value array, where keys are paths and properties are values
*
* @return array key-value array, where keys are paths and properties are values
*/
public function report($url, $body, $depth = 1)
{
@@ -377,7 +385,7 @@ public function report($url, $body, $depth = 1)
$response = $this->http_client->request('REPORT', $url, $body);
$contents = (string)$response->getBody();
$result = $this->xml_toolkit->parseMultiStatus($contents);
$result = $this->xml_toolkit->parseMultistatus($contents);
return $result;
}
@@ -387,9 +395,10 @@ public function report($url, $body, $depth = 1)
/**
* Converts a pre-parsed REPORT response to an array of CalendarObject
*
* @param array Data returned by report()
* @param AgenDAV\CalDAV\Resource\Calendar $calendar Calendar these objects come from
* @return array of CalendarObject
* @param array $raw_data Data returned by report()
* @param Calendar $calendar Calendar these objects come from
*
* @return CalendarObject[]
*/
protected function buildObjectCollection(array $raw_data, Calendar $calendar)
{
@@ -30,7 +30,7 @@
*/
class PrincipalPropertySearch implements ComponentFilter
{
/** @property string input */
/** @property string $input */
protected $input;
/**
@@ -29,7 +29,7 @@
*/
class Uid implements ComponentFilter
{
/** @property string Uid */
/** @property string $uid */
protected $uid;
/**
@@ -237,7 +237,8 @@ public function addShare(Share $share)
/**
* Removes a Share from this calendar
*
* @param \AgenDAV\Data\Share $share
* @param \AgenDAV\Data\Share $share_to_remove
*
* @return boolean true if the share was found and removed, false otherwise
*/
public function removeShare(Share $share_to_remove)
@@ -257,7 +258,8 @@ public function removeShare(Share $share_to_remove)
* Modifies the provided color to make sure it has an alpha channel
*
* @param string $color
* @result string
*
* @return string
*/
protected function ensureRgbaColor($color)
{
@@ -40,7 +40,7 @@ class CalendarObject
/**
* Contained event
*
* @var string
* @var \AgenDAV\Event
*/
protected $event;
@@ -35,14 +35,14 @@ class ACL
/**
* Current grants
*
* @var Array
* @var array $grants
*/
private $grants;
/**
* Creates a new ACL
*
* @param AgenDAV\CalDAV\Share\Permissions $permissions
* @param \AgenDAV\CalDAV\Share\Permissions $permissions
*/
public function __construct(Permissions $permissions)
{
@@ -107,7 +107,7 @@ public function getDefaultPrivileges()
/**
* Gets a list of privileges given to granted principals
*
* @return Array Associative array, where keys = owner/default/{principal-URL}
* @return array Associative array, where keys = owner/default/{principal-URL}
* and values are arrays of privileges in Clark notation
*/
public function getGrantsPrivileges()
@@ -29,7 +29,7 @@ class Permissions
/**
* Lists of permissions per role
*
* @var Array
* @var array $list
*/
private $list;
@@ -41,7 +41,7 @@ class Permissions
* values are arrays of permissions in Clark
* notation
*/
public function __construct(Array $permissions = [])
public function __construct(array $permissions = [])
{
$this->list = $permissions;
}
@@ -50,10 +50,10 @@ public function __construct(Array $permissions = [])
* Sets permissions for a given role
*
* @param string $role Role name (owner, read-write, read-only, default)
* @param Array $permissions List of permissions in Clark notation
* @param array $permissions List of permissions in Clark notation
* @throws \RuntimeException If the role was already configured
*/
public function setPrivilegesFor($role, Array $permissions)
public function setPrivilegesFor($role, array $permissions)
{
if (isset($this->list[$role])) {
throw new \RuntimeException('Privilege set for ' . $role . ' already defined');
@@ -47,7 +47,7 @@ class CalendarFinder
protected $current_principal;
/**
* @param Symfony\Component\HttpFoundation\Session\Session $session
* @param \Symfony\Component\HttpFoundation\Session\Session $session
* @param \AgenDAV\CalDAV\Client $client
*/
public function __construct(Session $session, Client $client)
@@ -136,7 +136,7 @@ protected function getCalendarSharedWith(Principal $principal)
* Applies custom properties to a calendar
*
* @param \AgenDAV\CalDAV\Resource\Calendar $calendar
* @param Array $properties
* @param array $properties
* @return void
*/
protected function applySharedProperties(Calendar $calendar, array $properties)
@@ -159,7 +159,7 @@ protected function applySharedProperties(Calendar $calendar, array $properties)
/**
* Stores existing calendar shares inside each Calendar object
*
* @param \AgenDAV\CalDAV\Resource\Calendar[] collection of calendars
* @param \AgenDAV\CalDAV\Resource\Calendar[] $calendars
*/
protected function addShares(Array $calendars)
{
@@ -35,7 +35,7 @@ class Create extends JSONController
/**
* Validates user input
*
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
* @return bool
*/
protected function validateInput(ParameterBag $input)
@@ -33,7 +33,7 @@ class Delete extends JSONController
/**
* Validates user input
*
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
* @return bool
*/
protected function validateInput(ParameterBag $input)
@@ -35,7 +35,7 @@ class Shares
* @return \AgenDAV\Data\Share[] in the same order as input
* @throws \LengthException If $with and $rw do not have the same number of elements
*/
public static function buildFromInput(Array $with, Array $rw, $owner, $calendar)
public static function buildFromInput(array $with, array $rw, $owner, $calendar)
{
$result = [];
@@ -38,7 +38,7 @@ class Save extends JSONController
/**
* Validates user input
*
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
* @return bool
*/
protected function validateInput(ParameterBag $input)
@@ -138,7 +138,7 @@ protected function updateCalDAV($calendar)
/**
* Saves calendar name and color into the Share object
*
* @param AgenDAV\Data\Share $share
* @param \AgenDAV\Data\Share $share
* @param ParameterBag $input
* @return void
*/
@@ -38,7 +38,7 @@ abstract class Alter extends JSONController
/**
* Validates user input
*
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
* @return bool
*/
protected function validateInput(ParameterBag $input)
@@ -60,6 +60,11 @@ protected function validateInput(ParameterBag $input)
/**
* Executes this operation
*
* @param ParameterBag $input
* @param Application $app
*
* @return JsonResponse
*/
public function execute(ParameterBag $input, Application $app)
{
@@ -33,7 +33,7 @@ class Delete extends JSONController
/**
* Validates user input
*
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
* @return bool
*/
protected function validateInput(ParameterBag $input)
@@ -73,7 +73,8 @@ public function execute(ParameterBag $input, Application $app)
/**
* Completely removes an object from the server
*
* @param \AgenDAV\CalDAV\Resource\CalendarObject
* @param \AgenDAV\CalDAV\Resource\CalendarObject $object
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
*/
protected function removeObject(CalendarObject $object)
@@ -85,8 +86,9 @@ protected function removeObject(CalendarObject $object)
/**
* Remove an event instance
*
* @param \AgenDAV\CalDAV\Resource\CalendarObject
* @param \AgenDAV\CalDAV\Resource\CalendarObject $object
* @param string $recurrence_id_string
*
* @return \Symfony\Component\HttpFoundation\JsonResponse
*/
protected function removeInstance(CalendarObject $object, $recurrence_id_string)
@@ -44,7 +44,7 @@ class Drop extends Alter
* @param \AgenDAV\EventInstance $instance
* @param \DateTimeZone $timezone
* @param int $minutes
* @param Symfony\Component\HttpFoundation\ParameterBag $input
* @param \Symfony\Component\HttpFoundation\ParameterBag $input
*/
protected function modifyInstance(
EventInstance $instance,
@@ -96,7 +96,8 @@ protected function modifyInstance(
*
* @param string $was_allday Possible values: 'true' or 'false'
* @param string $now_allday Possible values: 'true' or 'false'
* @return int One of the constants from this class
*
* @return int|null One of the constants from this class or null
*/
protected function describeMovement($was_allday, $now_allday)
{
@@ -106,10 +106,11 @@ protected function buildFullCalendarEvent(Calendar $calendar, CalendarObject $ob
/**
* Serialize a list of FullCalendar events using Fractal
*
* @param \AgenDAV\Event\FullCalendarEven $event FullCalendar event
* @param \AgenDAV\Event\FullCalendarEvent $event FullCalendar event
* @param \DateTimeZone $timezone Time zone the user has
* @param \Silex\Application $app
* @return array
*
* @return JsonResponse
*/
protected function serializeEvent(FullCalendarEvent $event, \DateTimeZone $timezone, Application $app)
{

0 comments on commit b6a368a

Please sign in to comment.
You can’t perform that action at this time.