1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10: class Horde_ActiveSync_Message_Task extends Horde_ActiveSync_Message_Base
11: {
12: public $categories = array();
13: public $bodytruncated = 0;
14:
15:
16: const POOMTASKS_BODY = 'POOMTASKS:Body';
17: const POOMTASKS_BODYSIZE = 'POOMTASKS:BodySize';
18: const POOMTASKS_BODYTRUNCATED = 'POOMTASKS:BodyTruncated';
19: const POOMTASKS_CATEGORIES = 'POOMTASKS:Categories';
20: const POOMTASKS_CATEGORY = 'POOMTASKS:Category';
21: const POOMTASKS_COMPLETE = 'POOMTASKS:Complete';
22: const POOMTASKS_DATECOMPLETED = 'POOMTASKS:DateCompleted';
23: const POOMTASKS_DUEDATE = 'POOMTASKS:DueDate';
24: const POOMTASKS_UTCDUEDATE = 'POOMTASKS:UtcDueDate';
25: const POOMTASKS_IMPORTANCE = 'POOMTASKS:Importance';
26: const POOMTASKS_RECURRENCE = 'POOMTASKS:Recurrence';
27: const POOMTASKS_TYPE = 'POOMTASKS:Type';
28: const POOMTASKS_START = 'POOMTASKS:Start';
29: const POOMTASKS_UNTIL = 'POOMTASKS:Until';
30: const POOMTASKS_OCCURRENCES = 'POOMTASKS:Occurrences';
31: const POOMTASKS_INTERVAL = 'POOMTASKS:Interval';
32: const POOMTASKS_DAYOFWEEK = 'POOMTASKS:DayOfWeek';
33: const POOMTASKS_DAYOFMONTH = 'POOMTASKS:DayOfMonth';
34: const POOMTASKS_WEEKOFMONTH = 'POOMTASKS:WeekOfMonth';
35: const POOMTASKS_MONTHOFYEAR = 'POOMTASKS:MonthOfYear';
36: const POOMTASKS_REGENERATE = 'POOMTASKS:Regenerate';
37: const POOMTASKS_DEADOCCUR = 'POOMTASKS:DeadOccur';
38: const POOMTASKS_REMINDERSET = 'POOMTASKS:ReminderSet';
39: const POOMTASKS_REMINDERTIME = 'POOMTASKS:ReminderTime';
40: const POOMTASKS_SENSITIVITY = 'POOMTASKS:Sensitivity';
41: const POOMTASKS_STARTDATE = 'POOMTASKS:StartDate';
42: const POOMTASKS_UTCSTARTDATE = 'POOMTASKS:UtcStartDate';
43: const POOMTASKS_SUBJECT = 'POOMTASKS:Subject';
44: const POOMTASKS_RTF = 'POOMTASKS:Rtf';
45:
46: const TASK_COMPLETE_TRUE = 1;
47: const TASK_COMPLETE_FALSE = 0;
48:
49: const IMPORTANCE_LOW = 0;
50: const IMPORTANCE_NORMAL = 1;
51: const IMPORTANCE_HIGH = 2;
52:
53: const REMINDER_SET_FALSE = 0;
54: const REMINDER_SET_TRUE = 1;
55:
56: protected $_mapping = array (
57: self::POOMTASKS_BODY => array (self::KEY_ATTRIBUTE => 'body'),
58: self::POOMTASKS_COMPLETE => array (self::KEY_ATTRIBUTE => 'complete'),
59: self::POOMTASKS_DATECOMPLETED => array (self::KEY_ATTRIBUTE => 'datecompleted', self::KEY_TYPE => self::TYPE_DATE_DASHES),
60: self::POOMTASKS_DUEDATE => array (self::KEY_ATTRIBUTE => 'duedate', self::KEY_TYPE => self::TYPE_DATE_DASHES),
61: self::POOMTASKS_UTCDUEDATE => array (self::KEY_ATTRIBUTE => 'utcduedate', self::KEY_TYPE => self::TYPE_DATE_DASHES),
62: self::POOMTASKS_IMPORTANCE => array (self::KEY_ATTRIBUTE => 'importance'),
63: self::POOMTASKS_RECURRENCE => array (self::KEY_ATTRIBUTE => 'recurrence', self::KEY_TYPE => 'SyncTaskRecurrence'),
64: self::POOMTASKS_REGENERATE => array (self::KEY_ATTRIBUTE => 'regenerate'),
65: self::POOMTASKS_DEADOCCUR => array (self::KEY_ATTRIBUTE => 'deadoccur'),
66: self::POOMTASKS_REMINDERSET => array (self::KEY_ATTRIBUTE => 'reminderset'),
67: self::POOMTASKS_REMINDERTIME => array (self::KEY_ATTRIBUTE => 'remindertime', self::KEY_TYPE => self::TYPE_DATE_DASHES),
68: self::POOMTASKS_SENSITIVITY => array (self::KEY_ATTRIBUTE => 'sensitiviy'),
69: self::POOMTASKS_STARTDATE => array (self::KEY_ATTRIBUTE => 'startdate', self::KEY_TYPE => self::TYPE_DATE_DASHES),
70: self::POOMTASKS_UTCSTARTDATE => array (self::KEY_ATTRIBUTE => 'utcstartdate', self::KEY_TYPE => self::TYPE_DATE_DASHES),
71: self::POOMTASKS_SUBJECT => array (self::KEY_ATTRIBUTE => 'subject'),
72: self::POOMTASKS_RTF => array (self::KEY_ATTRIBUTE => 'rtf'),
73: self::POOMTASKS_CATEGORIES => array (self::KEY_ATTRIBUTE => 'categories', self::KEY_VALUES => self::POOMTASKS_CATEGORY),
74: );
75:
76: protected $_properties = array(
77: 'body' => false,
78: 'complete' => false,
79: 'datecompleted' => false,
80: 'duedate' => false,
81: 'utcduedate' => false,
82: 'importance' => false,
83: 'recurrence' => false,
84: 'regenerate' => false,
85: 'deadoccur' => false,
86: 'reminderset' => false,
87: 'remindertime' => false,
88: 'sensitiviy' => false,
89: 'startdate' => false,
90: 'utcstartdate' => false,
91: 'subject' => false,
92: 'rtf' => false,
93: 'categories' => false,
94: );
95:
96: 97: 98: 99: 100:
101: public function setSubject($subject)
102: {
103: $this->_properties['subject'] = $subject;
104: }
105:
106: 107: 108: 109: 110:
111: public function getSubject()
112: {
113: return $this->_getAttribute('subject');
114: }
115:
116: 117: 118: 119: 120:
121: public function getBody()
122: {
123: return $this->_getAttribute('body');
124: }
125:
126: 127: 128: 129: 130:
131: public function setBody($body)
132: {
133: $this->_properties['body'] = $body;
134: }
135:
136: 137: 138: 139: 140:
141: public function setComplete($flag)
142: {
143: $this->_properties['complete'] = $flag;
144: }
145:
146: 147: 148: 149: 150:
151: public function getComplete()
152: {
153: return $this->_getAttribute('complete');
154: }
155:
156: 157: 158: 159: 160:
161: public function setDateCompleted(Horde_Date $date)
162: {
163: $this->_properties['datecompleted'] = $date;
164: }
165:
166: 167: 168: 169: 170:
171: public function getDateCompleted()
172: {
173: return $this->_getAttribute('datecompleted');
174: }
175:
176: 177: 178: 179: 180: 181: 182:
183: public function setDueDate(Horde_Date $date)
184: {
185: $this->_properties['utcduedate'] = $date;
186: }
187:
188: 189: 190: 191: 192:
193: public function getDueDate()
194: {
195: return $this->_getAttribute('utcduedate');
196: }
197:
198: 199: 200: 201: 202:
203: public function setImportance($importance)
204: {
205: if (is_null($importance)) {
206: $importance = self::IMPORTANCE_NORMAL;
207: }
208:
209: $this->_properties['importance'] = $importance;
210: }
211:
212: 213: 214: 215: 216:
217: public function getImportance()
218: {
219: return $this->_getAttribute('importance', self::IMPORTANCE_NORMAL);
220: }
221:
222: 223: 224: 225: 226:
227: public function setReminder(Horde_Date $datetime)
228: {
229: $this->_properties['remindertime'] = $datetime;
230: $this->_properties['reminderset'] = self::REMINDER_SET_TRUE;
231: }
232:
233: 234: 235: 236: 237:
238: public function getReminder()
239: {
240: if (!$this->_getAttribute('reminderset')) {
241: return false;
242: }
243:
244: return $this->_getAttribute('remindertime');
245: }
246:
247: 248: 249: 250: 251:
252: public function setStartDate(Horde_Date $date)
253: {
254: $this->_properties['utcstartdate'] = $date;
255: }
256:
257: 258: 259: 260: 261:
262: public function getStartDate()
263: {
264: return $this->_getAttribute('utcstartdate');
265: }
266:
267: 268: 269: 270: 271:
272: public function getClass()
273: {
274: return 'Tasks';
275: }
276:
277: protected function _checkSendEmpty($tag)
278: {
279: if ($tag == self::POOMTASKS_BODYTRUNCATED && $this->bodysize > 0) {
280: return true;
281: }
282:
283: return false;
284: }
285:
286: }