PageRenderTime 39ms CodeModel.GetById 35ms app.highlight 1ms RepoModel.GetById 1ms 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/**
21 * Represents an attendee of a calendar event
22 * 
23 * It is a property containing a CAL-ADDRESS value, with additional parameters
24 * regarding the organizer property
25 * 
26 * Example : ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;
27 *              CN="J. Doe";RSVP=TRUE:mailto:jdoe@example.com
28 * 
29 * @package Vpdi
30 * @version $Id:$
31 * @author Raphaƫl Rougeron <raphael.rougeron@gmail.com> 
32 * @license GPL 2.0
33 */
34  
35class Vpdi_Icalendar_Attendee extends Vpdi_Icalendar_Organizer {
36  /**
37   * Status of the attendee's participation
38   * 
39   * @var string
40   */
41  public $partstat;
42  
43  /**
44   * Indicates whether the favor of a reply is requested
45   * 
46   * @var boolean
47   */
48  public $rsvp;
49  
50  /**
51   * Type of calendar user
52   * 
53   * @var string
54   */
55  public $cutype;
56  
57  /**
58   * Groups that the attendee belongs to
59   * 
60   * @var string
61   */
62  public $member;
63  
64  /**
65   * Indicates that the original request was delegated to
66   * 
67   * @var string
68   */
69  public $delegatedTo;
70  
71  /**
72   * Indicates whom the original request was delegated from
73   * 
74   * @var string
75   */
76  public $delegatedFrom;
77  
78  protected $propName = 'ATTENDEE';
79  
80  public static function decode(Vpdi_Property $ATTENDEE) {
81    $org = new Vpdi_Icalendar_Attendee($ATTENDEE->value());
82    $org->decodeParameters($ATTENDEE);
83    return $org;
84  }
85  
86  public function __construct($uri = '', $cn = null) {
87    parent::__construct($uri, $cn);
88    $this->paramMapping+= array(
89      'partstat' => array('PARTSTAT', 'ParamText'),
90      'rsvp' => array('RSVP', 'Boolean'),
91      'cutype' => array('CUTYPE', 'ParamText'),
92      'member' => array('MEMBER', 'TextList'), // a ParamValueList could be better...
93      'delegatedTo' => array('DELEGATED-TO', 'TextList'),
94      'delegatedFrom' => array('DELEGATED-FROM', 'TextList')
95    );
96  }
97}