source: trunk/zpush/lib/syncobjects/synccontact.php @ 7589

Revision 7589, 13.2 KB checked in by douglas, 11 years ago (diff)

Ticket #3209 - Integrar módulo de sincronização Z-push ao Expresso

Line 
1<?php
2/***********************************************
3* File      :   synccontact.php
4* Project   :   Z-Push
5* Descr     :   WBXML contact entities that can be parsed
6*               directly (as a stream) from WBXML.
7*               It is automatically decoded
8*               according to $mapping,
9*               and the Sync WBXML mappings.
10*
11* Created   :   05.09.2011
12*
13* Copyright 2007 - 2012 Zarafa Deutschland GmbH
14*
15* This program is free software: you can redistribute it and/or modify
16* it under the terms of the GNU Affero General Public License, version 3,
17* as published by the Free Software Foundation with the following additional
18* term according to sec. 7:
19*
20* According to sec. 7 of the GNU Affero General Public License, version 3,
21* the terms of the AGPL are supplemented with the following terms:
22*
23* "Zarafa" is a registered trademark of Zarafa B.V.
24* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
25* The licensing of the Program under the AGPL does not imply a trademark license.
26* Therefore any rights, title and interest in our trademarks remain entirely with us.
27*
28* However, if you propagate an unmodified version of the Program you are
29* allowed to use the term "Z-Push" to indicate that you distribute the Program.
30* Furthermore you may use our trademarks where it is necessary to indicate
31* the intended purpose of a product or service provided you use it in accordance
32* with honest practices in industrial or commercial matters.
33* If you want to propagate modified versions of the Program under the name "Z-Push",
34* you may only do so if you have a written permission by Zarafa Deutschland GmbH
35* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
36*
37* This program is distributed in the hope that it will be useful,
38* but WITHOUT ANY WARRANTY; without even the implied warranty of
39* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40* GNU Affero General Public License for more details.
41*
42* You should have received a copy of the GNU Affero General Public License
43* along with this program.  If not, see <http://www.gnu.org/licenses/>.
44*
45* Consult LICENSE file for details
46************************************************/
47
48class SyncContact extends SyncObject {
49    public $anniversary;
50    public $assistantname;
51    public $assistnamephonenumber;
52    public $birthday;
53    public $body;
54    public $bodysize;
55    public $bodytruncated;
56    public $business2phonenumber;
57    public $businesscity;
58    public $businesscountry;
59    public $businesspostalcode;
60    public $businessstate;
61    public $businessstreet;
62    public $businessfaxnumber;
63    public $businessphonenumber;
64    public $carphonenumber;
65    public $children;
66    public $companyname;
67    public $department;
68    public $email1address;
69    public $email2address;
70    public $email3address;
71    public $fileas;
72    public $firstname;
73    public $home2phonenumber;
74    public $homecity;
75    public $homecountry;
76    public $homepostalcode;
77    public $homestate;
78    public $homestreet;
79    public $homefaxnumber;
80    public $homephonenumber;
81    public $jobtitle;
82    public $lastname;
83    public $middlename;
84    public $mobilephonenumber;
85    public $officelocation;
86    public $othercity;
87    public $othercountry;
88    public $otherpostalcode;
89    public $otherstate;
90    public $otherstreet;
91    public $pagernumber;
92    public $radiophonenumber;
93    public $spouse;
94    public $suffix;
95    public $title;
96    public $webpage;
97    public $yomicompanyname;
98    public $yomifirstname;
99    public $yomilastname;
100    public $rtf;
101    public $picture;
102    public $categories;
103
104    // AS 2.5 props
105    public $customerid;
106    public $governmentid;
107    public $imaddress;
108    public $imaddress2;
109    public $imaddress3;
110    public $managername;
111    public $companymainphone;
112    public $accountname;
113    public $nickname;
114    public $mms;
115
116    function SyncContact() {
117        $mapping = array (
118                    SYNC_POOMCONTACTS_ANNIVERSARY                       => array (  self::STREAMER_VAR      => "anniversary",
119                                                                                    self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE_DASHES  ),
120
121                    SYNC_POOMCONTACTS_ASSISTANTNAME                     => array (  self::STREAMER_VAR      => "assistantname"),
122                    SYNC_POOMCONTACTS_ASSISTNAMEPHONENUMBER             => array (  self::STREAMER_VAR      => "assistnamephonenumber"),
123                    SYNC_POOMCONTACTS_BIRTHDAY                          => array (  self::STREAMER_VAR      => "birthday",
124                                                                                    self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE_DASHES  ),
125
126                    SYNC_POOMCONTACTS_BODY                              => array (  self::STREAMER_VAR      => "body"),
127                    SYNC_POOMCONTACTS_BODYSIZE                          => array (  self::STREAMER_VAR      => "bodysize"),
128                    SYNC_POOMCONTACTS_BODYTRUNCATED                     => array (  self::STREAMER_VAR      => "bodytruncated"),
129                    SYNC_POOMCONTACTS_BUSINESS2PHONENUMBER              => array (  self::STREAMER_VAR      => "business2phonenumber"),
130                    SYNC_POOMCONTACTS_BUSINESSCITY                      => array (  self::STREAMER_VAR      => "businesscity"),
131                    SYNC_POOMCONTACTS_BUSINESSCOUNTRY                   => array (  self::STREAMER_VAR      => "businesscountry"),
132                    SYNC_POOMCONTACTS_BUSINESSPOSTALCODE                => array (  self::STREAMER_VAR      => "businesspostalcode"),
133                    SYNC_POOMCONTACTS_BUSINESSSTATE                     => array (  self::STREAMER_VAR      => "businessstate"),
134                    SYNC_POOMCONTACTS_BUSINESSSTREET                    => array (  self::STREAMER_VAR      => "businessstreet"),
135                    SYNC_POOMCONTACTS_BUSINESSFAXNUMBER                 => array (  self::STREAMER_VAR      => "businessfaxnumber"),
136                    SYNC_POOMCONTACTS_BUSINESSPHONENUMBER               => array (  self::STREAMER_VAR      => "businessphonenumber"),
137                    SYNC_POOMCONTACTS_CARPHONENUMBER                    => array (  self::STREAMER_VAR      => "carphonenumber"),
138                    SYNC_POOMCONTACTS_CHILDREN                          => array (  self::STREAMER_VAR      => "children",
139                                                                                    self::STREAMER_ARRAY    => SYNC_POOMCONTACTS_CHILD ),
140
141                    SYNC_POOMCONTACTS_COMPANYNAME                       => array (  self::STREAMER_VAR      => "companyname"),
142                    SYNC_POOMCONTACTS_DEPARTMENT                        => array (  self::STREAMER_VAR      => "department"),
143                    SYNC_POOMCONTACTS_EMAIL1ADDRESS                     => array (  self::STREAMER_VAR      => "email1address"),
144                    SYNC_POOMCONTACTS_EMAIL2ADDRESS                     => array (  self::STREAMER_VAR      => "email2address"),
145                    SYNC_POOMCONTACTS_EMAIL3ADDRESS                     => array (  self::STREAMER_VAR      => "email3address"),
146                    SYNC_POOMCONTACTS_FILEAS                            => array (  self::STREAMER_VAR      => "fileas"),
147                    SYNC_POOMCONTACTS_FIRSTNAME                         => array (  self::STREAMER_VAR      => "firstname"),
148                    SYNC_POOMCONTACTS_HOME2PHONENUMBER                  => array (  self::STREAMER_VAR      => "home2phonenumber"),
149                    SYNC_POOMCONTACTS_HOMECITY                          => array (  self::STREAMER_VAR      => "homecity"),
150                    SYNC_POOMCONTACTS_HOMECOUNTRY                       => array (  self::STREAMER_VAR      => "homecountry"),
151                    SYNC_POOMCONTACTS_HOMEPOSTALCODE                    => array (  self::STREAMER_VAR      => "homepostalcode"),
152                    SYNC_POOMCONTACTS_HOMESTATE                         => array (  self::STREAMER_VAR      => "homestate"),
153                    SYNC_POOMCONTACTS_HOMESTREET                        => array (  self::STREAMER_VAR      => "homestreet"),
154                    SYNC_POOMCONTACTS_HOMEFAXNUMBER                     => array (  self::STREAMER_VAR      => "homefaxnumber"),
155                    SYNC_POOMCONTACTS_HOMEPHONENUMBER                   => array (  self::STREAMER_VAR      => "homephonenumber"),
156                    SYNC_POOMCONTACTS_JOBTITLE                          => array (  self::STREAMER_VAR      => "jobtitle"),
157                    SYNC_POOMCONTACTS_LASTNAME                          => array (  self::STREAMER_VAR      => "lastname"),
158                    SYNC_POOMCONTACTS_MIDDLENAME                        => array (  self::STREAMER_VAR      => "middlename"),
159                    SYNC_POOMCONTACTS_MOBILEPHONENUMBER                 => array (  self::STREAMER_VAR      => "mobilephonenumber"),
160                    SYNC_POOMCONTACTS_OFFICELOCATION                    => array (  self::STREAMER_VAR      => "officelocation"),
161                    SYNC_POOMCONTACTS_OTHERCITY                         => array (  self::STREAMER_VAR      => "othercity"),
162                    SYNC_POOMCONTACTS_OTHERCOUNTRY                      => array (  self::STREAMER_VAR      => "othercountry"),
163                    SYNC_POOMCONTACTS_OTHERPOSTALCODE                   => array (  self::STREAMER_VAR      => "otherpostalcode"),
164                    SYNC_POOMCONTACTS_OTHERSTATE                        => array (  self::STREAMER_VAR      => "otherstate"),
165                    SYNC_POOMCONTACTS_OTHERSTREET                       => array (  self::STREAMER_VAR      => "otherstreet"),
166                    SYNC_POOMCONTACTS_PAGERNUMBER                       => array (  self::STREAMER_VAR      => "pagernumber"),
167                    SYNC_POOMCONTACTS_RADIOPHONENUMBER                  => array (  self::STREAMER_VAR      => "radiophonenumber"),
168                    SYNC_POOMCONTACTS_SPOUSE                            => array (  self::STREAMER_VAR      => "spouse"),
169                    SYNC_POOMCONTACTS_SUFFIX                            => array (  self::STREAMER_VAR      => "suffix"),
170                    SYNC_POOMCONTACTS_TITLE                             => array (  self::STREAMER_VAR      => "title"),
171                    SYNC_POOMCONTACTS_WEBPAGE                           => array (  self::STREAMER_VAR      => "webpage"),
172                    SYNC_POOMCONTACTS_YOMICOMPANYNAME                   => array (  self::STREAMER_VAR      => "yomicompanyname"),
173                    SYNC_POOMCONTACTS_YOMIFIRSTNAME                     => array (  self::STREAMER_VAR      => "yomifirstname"),
174                    SYNC_POOMCONTACTS_YOMILASTNAME                      => array (  self::STREAMER_VAR      => "yomilastname"),
175                    SYNC_POOMCONTACTS_RTF                               => array (  self::STREAMER_VAR      => "rtf"),
176                    SYNC_POOMCONTACTS_PICTURE                           => array (  self::STREAMER_VAR      => "picture",
177                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_LENGTHMAX      => 49152 )),
178
179                    SYNC_POOMCONTACTS_CATEGORIES                        => array (  self::STREAMER_VAR      => "categories",
180                                                                                    self::STREAMER_ARRAY    => SYNC_POOMCONTACTS_CATEGORY ),
181                );
182
183        if (Request::GetProtocolVersion() >= 2.5) {
184            $mapping[SYNC_POOMCONTACTS2_CUSTOMERID]                     = array (   self::STREAMER_VAR      => "customerid");
185            $mapping[SYNC_POOMCONTACTS2_GOVERNMENTID]                   = array (   self::STREAMER_VAR      => "governmentid");
186            $mapping[SYNC_POOMCONTACTS2_IMADDRESS]                      = array (   self::STREAMER_VAR      => "imaddress");
187            $mapping[SYNC_POOMCONTACTS2_IMADDRESS2]                     = array (   self::STREAMER_VAR      => "imaddress2");
188            $mapping[SYNC_POOMCONTACTS2_IMADDRESS3]                     = array (   self::STREAMER_VAR      => "imaddress3");
189            $mapping[SYNC_POOMCONTACTS2_MANAGERNAME]                    = array (   self::STREAMER_VAR      => "managername");
190            $mapping[SYNC_POOMCONTACTS2_COMPANYMAINPHONE]               = array (   self::STREAMER_VAR      => "companymainphone");
191            $mapping[SYNC_POOMCONTACTS2_ACCOUNTNAME]                    = array (   self::STREAMER_VAR      => "accountname");
192            $mapping[SYNC_POOMCONTACTS2_NICKNAME]                       = array (   self::STREAMER_VAR      => "nickname");
193            $mapping[SYNC_POOMCONTACTS2_MMS]                            = array (   self::STREAMER_VAR      => "mms");
194        }
195
196        if (Request::GetProtocolVersion() >= 12.0) {
197            $mapping[SYNC_AIRSYNCBASE_BODY]                             = array (   self::STREAMER_VAR      => "asbody",
198                                                                                    self::STREAMER_TYPE     => "SyncBaseBody");
199
200            //unset these properties because airsyncbase body and attachments will be used instead
201            unset($mapping[SYNC_POOMCONTACTS_BODY], $mapping[SYNC_POOMCONTACTS_BODYTRUNCATED]);
202        }
203
204        parent::SyncObject($mapping);
205    }
206}
207
208?>
Note: See TracBrowser for help on using the repository browser.