Overview

Packages

  • ActiveSync
  • None

Classes

  • Horde_ActiveSync_Message_Appointment
  • Horde_ActiveSync_Message_Attendee
  • Horde_ActiveSync_Message_Contact
  • Horde_ActiveSync_Message_Exception
  • Horde_ActiveSync_Message_Folder
  • Horde_ActiveSync_Message_Recurrence
  • Horde_ActiveSync_Message_Task
  • Horde_ActiveSync_State_Base
  • Horde_ActiveSync_State_History
  • Horde_ActiveSync_Timezone
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Horde_ActiveSync_Message_Task class represents a single ActiveSync Task.
  4:  *
  5:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
  6:  *
  7:  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  8:  * @package ActiveSync
  9:  */
 10: class Horde_ActiveSync_Message_Task extends Horde_ActiveSync_Message_Base
 11: {
 12:     public $categories = array();
 13:     public $bodytruncated = 0;
 14: 
 15:     /* POOMTASKS */
 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:      * Sets the task subject
 98:      *
 99:      * @param string $subject
100:      */
101:     public function setSubject($subject)
102:     {
103:         $this->_properties['subject'] = $subject;
104:     }
105: 
106:     /**
107:      * Get the task subject/title
108:      *
109:      * @return string  The task subject
110:      */
111:     public function getSubject()
112:     {
113:         return $this->_getAttribute('subject');
114:     }
115: 
116:     /**
117:      * Returns the body of the task.
118:      *
119:      * @return string  The descriptive body.
120:      */
121:     public function getBody()
122:     {
123:         return $this->_getAttribute('body');
124:     }
125: 
126:     /**
127:      * Set the task body element.
128:      *
129:      * @param string $body  The task body
130:      */
131:     public function setBody($body)
132:     {
133:         $this->_properties['body'] = $body;
134:     }
135: 
136:     /**
137:      * Set the task completion flag
138:      *
139:      * @param integer $flag  TASK_COMPLETE constant
140:      */
141:     public function setComplete($flag)
142:     {
143:         $this->_properties['complete'] = $flag;
144:     }
145: 
146:     /**
147:      * Get the completion flag
148:      *
149:      * @return integer  A TASK_COMPLETE constant
150:      */
151:     public function getComplete()
152:     {
153:         return $this->_getAttribute('complete');
154:     }
155: 
156:     /**
157:      * Set the date the task was completed.
158:      *
159:      * @param Horde_Date $date  The date in local tz.
160:      */
161:     public function setDateCompleted(Horde_Date $date)
162:     {
163:         $this->_properties['datecompleted'] = $date;
164:     }
165: 
166:     /**
167:      * Get the date completed.
168:      *
169:      * @return Horde_Date  The date in the local tz.
170:      */
171:     public function getDateCompleted()
172:     {
173:         return $this->_getAttribute('datecompleted');
174:     }
175: 
176:     /**
177:      * Set the due date. Note that even though the property is called UTCDueDate
178:      * we still pass a Horde_Date in the user's timezone since the dates are
179:      * transformed to UTC during encoding. Yay consistency...
180:      *
181:      * @param Horde_Date $date  The date.
182:      */
183:     public function setDueDate(Horde_Date $date)
184:     {
185:         $this->_properties['utcduedate'] = $date;
186:     }
187: 
188:     /**
189:      * Get the task due date.
190:      *
191:      * @return Horde_Date  Date in local tz
192:      */
193:     public function getDueDate()
194:     {
195:         return $this->_getAttribute('utcduedate');
196:     }
197: 
198:     /**
199:      * Set the importance
200:      *
201:      * @param integer $importance  A IMPORTANCE_* flag
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:      * Get the task importance level
214:      *
215:      * @return integer  A IMPORTANCE_* constant
216:      */
217:     public function getImportance()
218:     {
219:         return $this->_getAttribute('importance', self::IMPORTANCE_NORMAL);
220:     }
221: 
222:     /**
223:      * Set the reminder datetime
224:      *
225:      * @param Horde_Date $datetime  The time to trigger the alarm in local tz.
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:      * Get the reminder time.
235:      *
236:      * @return Horde_Date  in local tz
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:      * Set the task start datetime
249:      *
250:      * @param Horde_Date $date  Date in local tz
251:      */
252:     public function setStartDate(Horde_Date $date)
253:     {
254:         $this->_properties['utcstartdate'] = $date;
255:     }
256: 
257:     /**
258:      * Get the task start datetime
259:      *
260:      * @return Horde_Date
261:      */
262:     public function getStartDate()
263:     {
264:         return $this->_getAttribute('utcstartdate');
265:     }
266: 
267:     /**
268:      * Return this object's folder class
269:      *
270:      * @return string
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: }
API documentation generated by ApiGen