PageRenderTime 63ms CodeModel.GetById 40ms RepoModel.GetById 0ms app.codeStats 0ms

/ui/obminclude/lib/Vpdi/Icalendar/Attendee.php

https://github.com/mbaechler/OBM
PHP | 97 lines | 26 code | 10 blank | 61 comment | 0 complexity | f5c71d606a7bebb30ffe70f3e36812e4 MD5 | raw file
  1. <?php
  2. /*
  3. +-------------------------------------------------------------------------+
  4. | Copyright (c) 1997-2010 OBM.org project members team |
  5. | |
  6. | This program is free software; you can redistribute it and/or |
  7. | modify it under the terms of the GNU General Public License |
  8. | as published by the Free Software Foundation; version 2 |
  9. | of the License. |
  10. | |
  11. | This program is distributed in the hope that it will be useful, |
  12. | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  13. | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  14. | GNU General Public License for more details. |
  15. +-------------------------------------------------------------------------+
  16. | http://www.obm.org |
  17. +-------------------------------------------------------------------------+
  18. */
  19. /**
  20. * Represents an attendee of a calendar event
  21. *
  22. * It is a property containing a CAL-ADDRESS value, with additional parameters
  23. * regarding the organizer property
  24. *
  25. * Example : ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;
  26. * CN="J. Doe";RSVP=TRUE:mailto:jdoe@example.com
  27. *
  28. * @package Vpdi
  29. * @version $Id:$
  30. * @author Raphaƫl Rougeron <raphael.rougeron@gmail.com>
  31. * @license GPL 2.0
  32. */
  33. class Vpdi_Icalendar_Attendee extends Vpdi_Icalendar_Organizer {
  34. /**
  35. * Status of the attendee's participation
  36. *
  37. * @var string
  38. */
  39. public $partstat;
  40. /**
  41. * Indicates whether the favor of a reply is requested
  42. *
  43. * @var boolean
  44. */
  45. public $rsvp;
  46. /**
  47. * Type of calendar user
  48. *
  49. * @var string
  50. */
  51. public $cutype;
  52. /**
  53. * Groups that the attendee belongs to
  54. *
  55. * @var string
  56. */
  57. public $member;
  58. /**
  59. * Indicates that the original request was delegated to
  60. *
  61. * @var string
  62. */
  63. public $delegatedTo;
  64. /**
  65. * Indicates whom the original request was delegated from
  66. *
  67. * @var string
  68. */
  69. public $delegatedFrom;
  70. protected $propName = 'ATTENDEE';
  71. public static function decode(Vpdi_Property $ATTENDEE) {
  72. $org = new Vpdi_Icalendar_Attendee($ATTENDEE->value());
  73. $org->decodeParameters($ATTENDEE);
  74. return $org;
  75. }
  76. public function __construct($uri = '', $cn = null) {
  77. parent::__construct($uri, $cn);
  78. $this->paramMapping+= array(
  79. 'partstat' => array('PARTSTAT', 'ParamText'),
  80. 'rsvp' => array('RSVP', 'Boolean'),
  81. 'cutype' => array('CUTYPE', 'ParamText'),
  82. 'member' => array('MEMBER', 'TextList'), // a ParamValueList could be better...
  83. 'delegatedTo' => array('DELEGATED-TO', 'TextList'),
  84. 'delegatedFrom' => array('DELEGATED-FROM', 'TextList')
  85. );
  86. }
  87. }