Back to index

d-push  2.0
synccontact.php
Go to the documentation of this file.
00001 <?php
00002 /***********************************************
00003 * File      :   synccontact.php
00004 * Project   :   Z-Push
00005 * Descr     :   WBXML contact entities that can be parsed
00006 *               directly (as a stream) from WBXML.
00007 *               It is automatically decoded
00008 *               according to $mapping,
00009 *               and the Sync WBXML mappings.
00010 *
00011 * Created   :   05.09.2011
00012 *
00013 * Copyright 2007 - 2011 Zarafa Deutschland GmbH
00014 *
00015 * This program is free software: you can redistribute it and/or modify
00016 * it under the terms of the GNU Affero General Public License, version 3,
00017 * as published by the Free Software Foundation with the following additional
00018 * term according to sec. 7:
00019 *
00020 * According to sec. 7 of the GNU Affero General Public License, version 3,
00021 * the terms of the AGPL are supplemented with the following terms:
00022 *
00023 * "Zarafa" is a registered trademark of Zarafa B.V.
00024 * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
00025 * The licensing of the Program under the AGPL does not imply a trademark license.
00026 * Therefore any rights, title and interest in our trademarks remain entirely with us.
00027 *
00028 * However, if you propagate an unmodified version of the Program you are
00029 * allowed to use the term "Z-Push" to indicate that you distribute the Program.
00030 * Furthermore you may use our trademarks where it is necessary to indicate
00031 * the intended purpose of a product or service provided you use it in accordance
00032 * with honest practices in industrial or commercial matters.
00033 * If you want to propagate modified versions of the Program under the name "Z-Push",
00034 * you may only do so if you have a written permission by Zarafa Deutschland GmbH
00035 * (to acquire a permission please contact Zarafa at trademark@zarafa.com).
00036 *
00037 * This program is distributed in the hope that it will be useful,
00038 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00039 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00040 * GNU Affero General Public License for more details.
00041 *
00042 * You should have received a copy of the GNU Affero General Public License
00043 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00044 *
00045 * Consult LICENSE file for details
00046 ************************************************/
00047 
00048 class SyncContact extends SyncObject {
00049     public $anniversary;
00050     public $assistantname;
00051     public $assistnamephonenumber;
00052     public $birthday;
00053     public $body;
00054     public $bodysize;
00055     public $bodytruncated;
00056     public $business2phonenumber;
00057     public $businesscity;
00058     public $businesscountry;
00059     public $businesspostalcode;
00060     public $businessstate;
00061     public $businessstreet;
00062     public $businessfaxnumber;
00063     public $businessphonenumber;
00064     public $carphonenumber;
00065     public $children;
00066     public $companyname;
00067     public $department;
00068     public $email1address;
00069     public $email2address;
00070     public $email3address;
00071     public $fileas;
00072     public $firstname;
00073     public $home2phonenumber;
00074     public $homecity;
00075     public $homecountry;
00076     public $homepostalcode;
00077     public $homestate;
00078     public $homestreet;
00079     public $homefaxnumber;
00080     public $homephonenumber;
00081     public $jobtitle;
00082     public $lastname;
00083     public $middlename;
00084     public $mobilephonenumber;
00085     public $officelocation;
00086     public $othercity;
00087     public $othercountry;
00088     public $otherpostalcode;
00089     public $otherstate;
00090     public $otherstreet;
00091     public $pagernumber;
00092     public $radiophonenumber;
00093     public $spouse;
00094     public $suffix;
00095     public $title;
00096     public $webpage;
00097     public $yomicompanyname;
00098     public $yomifirstname;
00099     public $yomilastname;
00100     public $rtf;
00101     public $picture;
00102     public $categories;
00103 
00104     // AS 2.5 props
00105     public $customerid;
00106     public $governmentid;
00107     public $imaddress;
00108     public $imaddress2;
00109     public $imaddress3;
00110     public $managername;
00111     public $companymainphone;
00112     public $accountname;
00113     public $nickname;
00114     public $mms;
00115 
00116     function SyncContact() {
00117         $mapping = array (
00118                     SYNC_POOMCONTACTS_ANNIVERSARY                       => array (  self::STREAMER_VAR      => "anniversary",
00119                                                                                     self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE_DASHES  ),
00120 
00121                     SYNC_POOMCONTACTS_ASSISTANTNAME                     => array (  self::STREAMER_VAR      => "assistantname"),
00122                     SYNC_POOMCONTACTS_ASSISTNAMEPHONENUMBER             => array (  self::STREAMER_VAR      => "assistnamephonenumber"),
00123                     SYNC_POOMCONTACTS_BIRTHDAY                          => array (  self::STREAMER_VAR      => "birthday",
00124                                                                                     self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE_DASHES  ),
00125 
00126                     SYNC_POOMCONTACTS_BODY                              => array (  self::STREAMER_VAR      => "body"),
00127                     SYNC_POOMCONTACTS_BODYSIZE                          => array (  self::STREAMER_VAR      => "bodysize"),
00128                     SYNC_POOMCONTACTS_BODYTRUNCATED                     => array (  self::STREAMER_VAR      => "bodytruncated"),
00129                     SYNC_POOMCONTACTS_BUSINESS2PHONENUMBER              => array (  self::STREAMER_VAR      => "business2phonenumber"),
00130                     SYNC_POOMCONTACTS_BUSINESSCITY                      => array (  self::STREAMER_VAR      => "businesscity"),
00131                     SYNC_POOMCONTACTS_BUSINESSCOUNTRY                   => array (  self::STREAMER_VAR      => "businesscountry"),
00132                     SYNC_POOMCONTACTS_BUSINESSPOSTALCODE                => array (  self::STREAMER_VAR      => "businesspostalcode"),
00133                     SYNC_POOMCONTACTS_BUSINESSSTATE                     => array (  self::STREAMER_VAR      => "businessstate"),
00134                     SYNC_POOMCONTACTS_BUSINESSSTREET                    => array (  self::STREAMER_VAR      => "businessstreet"),
00135                     SYNC_POOMCONTACTS_BUSINESSFAXNUMBER                 => array (  self::STREAMER_VAR      => "businessfaxnumber"),
00136                     SYNC_POOMCONTACTS_BUSINESSPHONENUMBER               => array (  self::STREAMER_VAR      => "businessphonenumber"),
00137                     SYNC_POOMCONTACTS_CARPHONENUMBER                    => array (  self::STREAMER_VAR      => "carphonenumber"),
00138                     SYNC_POOMCONTACTS_CHILDREN                          => array (  self::STREAMER_VAR      => "children",
00139                                                                                     self::STREAMER_ARRAY    => SYNC_POOMCONTACTS_CHILD ),
00140 
00141                     SYNC_POOMCONTACTS_COMPANYNAME                       => array (  self::STREAMER_VAR      => "companyname"),
00142                     SYNC_POOMCONTACTS_DEPARTMENT                        => array (  self::STREAMER_VAR      => "department"),
00143                     SYNC_POOMCONTACTS_EMAIL1ADDRESS                     => array (  self::STREAMER_VAR      => "email1address"),
00144                     SYNC_POOMCONTACTS_EMAIL2ADDRESS                     => array (  self::STREAMER_VAR      => "email2address"),
00145                     SYNC_POOMCONTACTS_EMAIL3ADDRESS                     => array (  self::STREAMER_VAR      => "email3address"),
00146                     SYNC_POOMCONTACTS_FILEAS                            => array (  self::STREAMER_VAR      => "fileas"),
00147                     SYNC_POOMCONTACTS_FIRSTNAME                         => array (  self::STREAMER_VAR      => "firstname"),
00148                     SYNC_POOMCONTACTS_HOME2PHONENUMBER                  => array (  self::STREAMER_VAR      => "home2phonenumber"),
00149                     SYNC_POOMCONTACTS_HOMECITY                          => array (  self::STREAMER_VAR      => "homecity"),
00150                     SYNC_POOMCONTACTS_HOMECOUNTRY                       => array (  self::STREAMER_VAR      => "homecountry"),
00151                     SYNC_POOMCONTACTS_HOMEPOSTALCODE                    => array (  self::STREAMER_VAR      => "homepostalcode"),
00152                     SYNC_POOMCONTACTS_HOMESTATE                         => array (  self::STREAMER_VAR      => "homestate"),
00153                     SYNC_POOMCONTACTS_HOMESTREET                        => array (  self::STREAMER_VAR      => "homestreet"),
00154                     SYNC_POOMCONTACTS_HOMEFAXNUMBER                     => array (  self::STREAMER_VAR      => "homefaxnumber"),
00155                     SYNC_POOMCONTACTS_HOMEPHONENUMBER                   => array (  self::STREAMER_VAR      => "homephonenumber"),
00156                     SYNC_POOMCONTACTS_JOBTITLE                          => array (  self::STREAMER_VAR      => "jobtitle"),
00157                     SYNC_POOMCONTACTS_LASTNAME                          => array (  self::STREAMER_VAR      => "lastname"),
00158                     SYNC_POOMCONTACTS_MIDDLENAME                        => array (  self::STREAMER_VAR      => "middlename"),
00159                     SYNC_POOMCONTACTS_MOBILEPHONENUMBER                 => array (  self::STREAMER_VAR      => "mobilephonenumber"),
00160                     SYNC_POOMCONTACTS_OFFICELOCATION                    => array (  self::STREAMER_VAR      => "officelocation"),
00161                     SYNC_POOMCONTACTS_OTHERCITY                         => array (  self::STREAMER_VAR      => "othercity"),
00162                     SYNC_POOMCONTACTS_OTHERCOUNTRY                      => array (  self::STREAMER_VAR      => "othercountry"),
00163                     SYNC_POOMCONTACTS_OTHERPOSTALCODE                   => array (  self::STREAMER_VAR      => "otherpostalcode"),
00164                     SYNC_POOMCONTACTS_OTHERSTATE                        => array (  self::STREAMER_VAR      => "otherstate"),
00165                     SYNC_POOMCONTACTS_OTHERSTREET                       => array (  self::STREAMER_VAR      => "otherstreet"),
00166                     SYNC_POOMCONTACTS_PAGERNUMBER                       => array (  self::STREAMER_VAR      => "pagernumber"),
00167                     SYNC_POOMCONTACTS_RADIOPHONENUMBER                  => array (  self::STREAMER_VAR      => "radiophonenumber"),
00168                     SYNC_POOMCONTACTS_SPOUSE                            => array (  self::STREAMER_VAR      => "spouse"),
00169                     SYNC_POOMCONTACTS_SUFFIX                            => array (  self::STREAMER_VAR      => "suffix"),
00170                     SYNC_POOMCONTACTS_TITLE                             => array (  self::STREAMER_VAR      => "title"),
00171                     SYNC_POOMCONTACTS_WEBPAGE                           => array (  self::STREAMER_VAR      => "webpage"),
00172                     SYNC_POOMCONTACTS_YOMICOMPANYNAME                   => array (  self::STREAMER_VAR      => "yomicompanyname"),
00173                     SYNC_POOMCONTACTS_YOMIFIRSTNAME                     => array (  self::STREAMER_VAR      => "yomifirstname"),
00174                     SYNC_POOMCONTACTS_YOMILASTNAME                      => array (  self::STREAMER_VAR      => "yomilastname"),
00175                     SYNC_POOMCONTACTS_RTF                               => array (  self::STREAMER_VAR      => "rtf"),
00176                     SYNC_POOMCONTACTS_PICTURE                           => array (  self::STREAMER_VAR      => "picture",
00177                                                                                     self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_LENGTHMAX      => 49152 )),
00178 
00179                     SYNC_POOMCONTACTS_CATEGORIES                        => array (  self::STREAMER_VAR      => "categories",
00180                                                                                     self::STREAMER_ARRAY    => SYNC_POOMCONTACTS_CATEGORY ),
00181                 );
00182 
00183         if (Request::GetProtocolVersion() >= 2.5) {
00184             $mapping[SYNC_POOMCONTACTS2_CUSTOMERID]                     = array (   self::STREAMER_VAR      => "customerid");
00185             $mapping[SYNC_POOMCONTACTS2_GOVERNMENTID]                   = array (   self::STREAMER_VAR      => "governmentid");
00186             $mapping[SYNC_POOMCONTACTS2_IMADDRESS]                      = array (   self::STREAMER_VAR      => "imaddress");
00187             $mapping[SYNC_POOMCONTACTS2_IMADDRESS2]                     = array (   self::STREAMER_VAR      => "imaddress2");
00188             $mapping[SYNC_POOMCONTACTS2_IMADDRESS3]                     = array (   self::STREAMER_VAR      => "imaddress3");
00189             $mapping[SYNC_POOMCONTACTS2_MANAGERNAME]                    = array (   self::STREAMER_VAR      => "managername");
00190             $mapping[SYNC_POOMCONTACTS2_COMPANYMAINPHONE]               = array (   self::STREAMER_VAR      => "companymainphone");
00191             $mapping[SYNC_POOMCONTACTS2_ACCOUNTNAME]                    = array (   self::STREAMER_VAR      => "accountname");
00192             $mapping[SYNC_POOMCONTACTS2_NICKNAME]                       = array (   self::STREAMER_VAR      => "nickname");
00193             $mapping[SYNC_POOMCONTACTS2_MMS]                            = array (   self::STREAMER_VAR      => "mms");
00194         }
00195 
00196         if (Request::GetProtocolVersion() >= 12.0) {
00197             $mapping[SYNC_AIRSYNCBASE_BODY]                             = array (   self::STREAMER_VAR      => "asbody",
00198                                                                                     self::STREAMER_TYPE     => "SyncBaseBody");
00199 
00200             //unset these properties because airsyncbase body and attachments will be used instead
00201             unset($mapping[SYNC_POOMCONTACTS_BODY], $mapping[SYNC_POOMCONTACTS_BODYTRUNCATED]);
00202         }
00203 
00204         parent::SyncObject($mapping);
00205     }
00206 }
00207 
00208 ?>