1 | <?php |
---|
2 | /*********************************************** |
---|
3 | * File : syncrecurrence.php |
---|
4 | * Project : Z-Push |
---|
5 | * Descr : WBXML appointment reccurence entities |
---|
6 | * that can be parsed directly (as a stream) |
---|
7 | * from WBXML. |
---|
8 | * It is automatically decoded |
---|
9 | * according to $mapping, |
---|
10 | * and the Sync WBXML mappings. |
---|
11 | * |
---|
12 | * Created : 05.09.2011 |
---|
13 | * |
---|
14 | * Copyright 2007 - 2012 Zarafa Deutschland GmbH |
---|
15 | * |
---|
16 | * This program is free software: you can redistribute it and/or modify |
---|
17 | * it under the terms of the GNU Affero General Public License, version 3, |
---|
18 | * as published by the Free Software Foundation with the following additional |
---|
19 | * term according to sec. 7: |
---|
20 | * |
---|
21 | * According to sec. 7 of the GNU Affero General Public License, version 3, |
---|
22 | * the terms of the AGPL are supplemented with the following terms: |
---|
23 | * |
---|
24 | * "Zarafa" is a registered trademark of Zarafa B.V. |
---|
25 | * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH |
---|
26 | * The licensing of the Program under the AGPL does not imply a trademark license. |
---|
27 | * Therefore any rights, title and interest in our trademarks remain entirely with us. |
---|
28 | * |
---|
29 | * However, if you propagate an unmodified version of the Program you are |
---|
30 | * allowed to use the term "Z-Push" to indicate that you distribute the Program. |
---|
31 | * Furthermore you may use our trademarks where it is necessary to indicate |
---|
32 | * the intended purpose of a product or service provided you use it in accordance |
---|
33 | * with honest practices in industrial or commercial matters. |
---|
34 | * If you want to propagate modified versions of the Program under the name "Z-Push", |
---|
35 | * you may only do so if you have a written permission by Zarafa Deutschland GmbH |
---|
36 | * (to acquire a permission please contact Zarafa at trademark@zarafa.com). |
---|
37 | * |
---|
38 | * This program is distributed in the hope that it will be useful, |
---|
39 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
41 | * GNU Affero General Public License for more details. |
---|
42 | * |
---|
43 | * You should have received a copy of the GNU Affero General Public License |
---|
44 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
45 | * |
---|
46 | * Consult LICENSE file for details |
---|
47 | ************************************************/ |
---|
48 | |
---|
49 | |
---|
50 | class SyncRecurrence extends SyncObject { |
---|
51 | public $type; |
---|
52 | public $until; |
---|
53 | public $occurrences; |
---|
54 | public $interval; |
---|
55 | public $dayofweek; |
---|
56 | public $dayofmonth; |
---|
57 | public $weekofmonth; |
---|
58 | public $monthofyear; |
---|
59 | |
---|
60 | function SyncRecurrence() { |
---|
61 | $mapping = array ( |
---|
62 | // Recurrence type |
---|
63 | // 0 = Recurs daily |
---|
64 | // 1 = Recurs weekly |
---|
65 | // 2 = Recurs monthly |
---|
66 | // 3 = Recurs monthly on the nth day |
---|
67 | // 5 = Recurs yearly |
---|
68 | // 6 = Recurs yearly on the nth day |
---|
69 | SYNC_POOMCAL_TYPE => array ( self::STREAMER_VAR => "type", |
---|
70 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_REQUIRED => self::STREAMER_CHECK_SETZERO, |
---|
71 | self::STREAMER_CHECK_ONEVALUEOF => array(0,1,2,3,5,6) )), |
---|
72 | |
---|
73 | SYNC_POOMCAL_UNTIL => array ( self::STREAMER_VAR => "until", |
---|
74 | self::STREAMER_TYPE => self::STREAMER_TYPE_DATE), |
---|
75 | |
---|
76 | SYNC_POOMCAL_OCCURRENCES => array ( self::STREAMER_VAR => "occurrences", |
---|
77 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_CMPHIGHER => 0, |
---|
78 | self::STREAMER_CHECK_CMPLOWER => 1000 )), |
---|
79 | |
---|
80 | SYNC_POOMCAL_INTERVAL => array ( self::STREAMER_VAR => "interval", |
---|
81 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_CMPHIGHER => 0, |
---|
82 | self::STREAMER_CHECK_CMPLOWER => 1000 )), |
---|
83 | |
---|
84 | // DayOfWeek values |
---|
85 | // 1 = Sunday |
---|
86 | // 2 = Monday |
---|
87 | // 4 = Tuesday |
---|
88 | // 8 = Wednesday |
---|
89 | // 16 = Thursday |
---|
90 | // 32 = Friday |
---|
91 | // 62 = Weekdays // not in spec: daily weekday recurrence |
---|
92 | // 64 = Saturday |
---|
93 | // 127 = The last day of the month. Value valid only in monthly or yearly recurrences. |
---|
94 | // As this is a bitmask, actually all values 0 > x < 128 are allowed |
---|
95 | SYNC_POOMCAL_DAYOFWEEK => array ( self::STREAMER_VAR => "dayofweek", |
---|
96 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_CMPHIGHER => 0, |
---|
97 | self::STREAMER_CHECK_CMPLOWER => 128 )), |
---|
98 | |
---|
99 | // DayOfMonth values |
---|
100 | // 1-31 representing the day |
---|
101 | SYNC_POOMCAL_DAYOFMONTH => array ( self::STREAMER_VAR => "dayofmonth", |
---|
102 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_CMPHIGHER => 0, |
---|
103 | self::STREAMER_CHECK_CMPLOWER => 32 )), |
---|
104 | |
---|
105 | // WeekOfMonth |
---|
106 | // 1-4 = Y st/nd/rd/th week of month |
---|
107 | // 5 = last week of month |
---|
108 | SYNC_POOMCAL_WEEKOFMONTH => array ( self::STREAMER_VAR => "weekofmonth", |
---|
109 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_ONEVALUEOF => array(1,2,3,4,5) )), |
---|
110 | |
---|
111 | // MonthOfYear |
---|
112 | // 1-12 representing the month |
---|
113 | SYNC_POOMCAL_MONTHOFYEAR => array ( self::STREAMER_VAR => "monthofyear", |
---|
114 | self::STREAMER_CHECKS => array( self::STREAMER_CHECK_ONEVALUEOF => array(1,2,3,4,5,6,7,8,9,10,11,12) )), |
---|
115 | ); |
---|
116 | |
---|
117 | parent::SyncObject($mapping); |
---|
118 | } |
---|
119 | } |
---|
120 | ?> |
---|