Changeset 6026
- Timestamp:
- 04/25/12 12:34:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/services/iCal.php
r6017 r6026 186 186 switch (strtoupper($component->objName)) { 187 187 case 'VEVENT': 188 188 189 189 switch ($method) 190 190 { … … 430 430 case 'REPLY': 431 431 if( $schedulable = self::_getSchedulable($uid) ) 432 { 432 { 433 433 while($property = $component->getProperty('attendee',FALSE , TRUE)) 434 434 if( $pID = self::_getParticipantByMail(str_replace('MAILTO:', '', $property['value']), $schedulable['participants'])) 435 435 $interation['participant://'.$pID] = array( 'id' => $pID , 'status' => constant('STATUS_'.strtoupper($property['params']['PARTSTAT'])) ); 436 437 $interation['schedulable://'.$schedulable['id']]['sequence'] = $schedulable['sequence'] +1; 436 438 } 437 439 break; … … 460 462 461 463 default: 464 462 465 $schedulable = self::_getSchedulable($uid); 463 466 464 467 if($schedulable && ( self::_getTime($component , 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty( 'sequence' , false , false ) > $schedulable['sequence'])) //Caso o evento exista 465 $interation = self::_makeVEVENT($schedulable , $component , $params); 468 { 469 $interation = self::_makeVEVENT($schedulable , $component , $params); 470 471 if(!self::_existInMyCalendars($schedulable['id'])) 472 { 473 $calendarToSchedulable = array(); 474 $calendarToSchedulable['calendar'] = $params['calendar']; 475 $calendarToSchedulable['schedulable'] = $schedulable['id']; 476 $interation['calendarToSchedulable://'.mt_rand().'(Formatter)'] = $calendarToSchedulable; 477 } 478 479 } 466 480 else // Importar evento 467 481 $interation = self::_makeVEVENT( array() , $component , $params); 468 482 483 484 469 485 break; 470 486 } … … 582 598 583 599 } 584 600 585 601 return $return; 586 602 } … … 797 813 if( $class && defined(constant(strtoupper('CLASS_'.$class))) ) 798 814 $schedulable['class'] = constant(strtoupper('CLASS_'.$class)); 799 else if( !isset($ exists['class']) )815 else if( !isset($schedulable['class']) ) 800 816 $schedulable['class'] = CLASS_PRIVATE ; // padrão classe private 801 817 … … 833 849 $mailUser = trim(str_replace('MAILTO:', '', $property['value'])); 834 850 835 $participantID = mt_rand().'2(Formatter)';851 $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ? $tpID : mt_rand().'2(Formatter)'; 836 852 $participant['schedulable'] = $eventID; 837 853 … … 882 898 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_'.$property['params']['PARTSTAT']) !== null ) ? constant('STATUS_'.$property['params']['PARTSTAT']) : STATUS_UNANSWERED; 883 899 $participant['isOrganizer'] = '1'; 884 900 $participant['acl'] = 'rowi'; 885 901 886 902 /* Verifica se este usuario é um usuario interno do ldap */ … … 915 931 $user = Controller::read( array( 'concept' => 'user', 'id' => $params['owner'] ) , array('mail')); 916 932 917 if(!self::_getParticipantByMail($user['mail'] , $ exists['participants']))933 if(!self::_getParticipantByMail($user['mail'] , $schedulable['participants'])) 918 934 { 919 935 $participantID = mt_rand().'2(Formatter)'; … … 1006 1022 1007 1023 1008 1024 static private function _getContentType( $fileName ) 1009 1025 { 1010 1026 $strFileType = strtolower(substr ( $fileName , strrpos($fileName, '.') ));
Note: See TracChangeset
for help on using the changeset viewer.