Changeset 8032
- Timestamp:
- 03/18/13 17:19:52 (11 years ago)
- Location:
- branches/2.5/zpush
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/zpush/backend/expresso/providers/calendarProvider.php
r7687 r8032 30 30 { 31 31 $return = array(); 32 $sigs = Controller::find(array('concept' => 'calendarSignature'), array( 'id','calendar' ), array( 'filter' => array( '=' , 'user' , $this->_uidnumber ))); 33 34 foreach($sigs as $sig) 35 { 36 $calendar = Controller::read( array( 'concept' => 'calendar' , 'id' => $sig['calendar'] )); 37 if($calendar['type'] != 0 ) continue; //ecluir grupo de tarefas 38 39 $tmpSig = array(); 40 $tmpSig["id"] = 'calendar'.$sig['id']; 41 $tmpSig["parent"] = 0; 42 $tmpSig["mod"] = $calendar['name']; 43 $return[] = $tmpSig; 32 $criteria = CALENDAR_SYNC_SIGNED_CALENDARS ? array( 'filter' => array( 'AND' , array( '=' , 'type' , '0' ) , array( '=' , 'user' , $this->_uidnumber ))) : array( 'filter' => array ( 'AND' ,array( '=' , 'isOwner' , '1' ),array( '=' , 'type' , '0' ) , array( '=' , 'user' , $this->_uidnumber ))); 33 $sigs = Controller::find(array('concept' => 'calendarSignature'), array( 'id','calendar' ), $criteria); 34 35 if(Request::GetDeviceType() == 'iPhone' || Request::GetDeviceType() == 'iPad') 36 { 37 foreach($sigs as $sig) 38 { 39 $calendar = Controller::read( array( 'concept' => 'calendar' , 'id' => $sig['calendar'] )); 40 $tmpSig = array(); 41 $tmpSig["id"] = 'calendar'.$sig['id']; 42 $tmpSig["parent"] = 0; 43 $tmpSig["mod"] = $calendar['name']; 44 $return[] = $tmpSig; 45 } 46 } 47 else 48 { 49 $defaultCalendar = Controller::find(array('concept' => 'modulePreference'), array('value','id') , array('filter' => array( 'and' , array('=' , 'name' , 'defaultCalendar') , array('=' , 'module' , 'expressoCalendar') , array('=' , 'user' , $this->_uidnumber ) )) ); 50 51 if(isset($defaultCalendar[0])) //Prioriza agenda default de importação pois o android so sincroniza a primeira agenda. 52 { 53 foreach($sigs as $i => $sig) 54 { 55 if($sig['calendar'] == $defaultCalendar[0]['value']) 56 { 57 $calendar = Controller::read( array( 'concept' => 'calendar' , 'id' => $sig['calendar'] )); 58 $tmpSig = array(); 59 $tmpSig["id"] = 'calendar'.$sig['id']; 60 $tmpSig["parent"] = 0; 61 $tmpSig["mod"] = $calendar['name']; 62 $return[] = $tmpSig; 63 } 64 } 65 } 66 else 67 { 68 $sig = $sigs[0]; 69 $calendar = Controller::read( array( 'concept' => 'calendar' , 'id' => $sig['calendar'] )); 70 $tmpSig = array(); 71 $tmpSig["id"] = 'calendar'.$sig['id']; 72 $tmpSig["parent"] = 0; 73 $tmpSig["mod"] = $calendar['name']; 74 $return[] = $tmpSig; 75 76 } 44 77 } 45 78 … … 525 558 $schedulable['timezone'] = $calendar['timezone']; 526 559 560 561 $sv = new DateTime('@'.($message->starttime + $GMT_CEL), $calendarSignatureTimezone); 562 563 if($sv->format('I') == 0) 564 $schedulable['startTime'] = $schedulable['startTime'] - 3600000; 565 566 $ev = new DateTime('@'.($message->endtime + $GMT_CEL), $calendarSignatureTimezone); 567 568 if($ev->format('I') == 0) 569 $schedulable['endTime'] = $schedulable['endTime'] - 3600000; 570 527 571 $schedulable['allDay'] = $message->alldayevent; 528 572 $schedulable['description'] = $message->body; … … 735 779 $schedulable['startTime'] = (($message->starttime + $GMT_CEL) + ($calendarSignatureTimezone->getOffset(new DateTime('@'.($message->starttime + $GMT_CEL), new DateTimeZone('UTC'))) * -1) ) *1000; //$message->starttime * 1000; 736 780 $schedulable['endTime'] = (($message->endtime + $GMT_CEL) + ($calendarSignatureTimezone->getOffset(new DateTime('@'.($message->endtime + $GMT_CEL), new DateTimeZone('UTC')))* -1)) *1000;//$message->endtime * 1000; 781 782 $sv = new DateTime('@'.($message->starttime + $GMT_CEL), $calendarSignatureTimezone); 783 784 if($sv->format('I') == 0) 785 $schedulable['startTime'] = $schedulable['startTime'] - 3600000; 786 787 $ev = new DateTime('@'.($message->endtime + $GMT_CEL), $calendarSignatureTimezone); 788 789 if($ev->format('I') == 0) 790 $schedulable['endTime'] = $schedulable['endTime'] - 3600000; 791 737 792 $schedulable['timezone'] = $calendar['timezone']; 738 739 793 740 794 … … 749 803 $participant['isOrganizer'] = '1'; 750 804 $participant['acl'] = 'rowi'; 805 $participant['status'] = '1'; 751 806 752 807 if($message->organizeremail) … … 1033 1088 1034 1089 //Inicia Variaveis de para API expresso 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1090 if(!isset($_SESSION)) 1091 session_start(); 1092 1093 $userWallet = array(); 1094 $userWallet['uidNumber'] = $entries[0]['uidnumber'][0]; 1095 $userWallet['uid'] = $entries[0]['uid'][0]; 1096 $userWallet['mail'] = $entries[0]['mail'][0]; 1097 1098 $_SESSION['wallet'] = array(); 1099 $_SESSION['wallet']['user'] = $userWallet; 1100 $_SESSION['flags']['currentapp'] = 'expressoCalendar'; 1046 1101 1047 1102 //----------------------------------------------------------------------------------------// -
branches/2.5/zpush/config.php
r7706 r8032 311 311 define('IMAP_USE_IMAPMAIL', true); 312 312 313 define('CALENDAR_SYNC_SIGNED_CALENDARS', false); 313 314 314 315 $rs = pg_query( $GLOBALS['connections']['db'], 'SELECT app_id FROM phpgw_applications WHERE app_name = \'zpush\'' );
Note: See TracChangeset
for help on using the changeset viewer.