Changeset 6026


Ignore:
Timestamp:
04/25/12 12:34:48 (12 years ago)
Author:
cristiano
Message:

Ticket #2640 - correção aceitar evento via cliente externo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/services/iCal.php

    r6017 r6026  
    186186            switch (strtoupper($component->objName)) { 
    187187                case 'VEVENT': 
    188                      
     188             
    189189                    switch ($method)  
    190190                    { 
     
    430430                         case 'REPLY': 
    431431                             if(  $schedulable = self::_getSchedulable($uid) ) 
    432                              { 
     432                             {                                         
    433433                                   while($property = $component->getProperty('attendee',FALSE , TRUE))                                  
    434434                                       if( $pID  = self::_getParticipantByMail(str_replace('MAILTO:', '', $property['value']), $schedulable['participants'])) 
    435435                                            $interation['participant://'.$pID] = array( 'id' => $pID , 'status' => constant('STATUS_'.strtoupper($property['params']['PARTSTAT'])) );                             
     436                              
     437                                    $interation['schedulable://'.$schedulable['id']]['sequence']  = $schedulable['sequence'] +1;    
    436438                             } 
    437439                               break; 
     
    460462                            
    461463                         default: 
     464                              
    462465                             $schedulable = self::_getSchedulable($uid); 
    463466                              
    464467                             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                             } 
    466480                             else // Importar evento 
    467481                                $interation = self::_makeVEVENT( array() , $component , $params); 
    468  
     482                              
     483                              
     484                              
    469485                             break; 
    470486                    } 
     
    582598 
    583599            } 
    584  
     600           
    585601             return $return;    
    586602        } 
     
    797813                if( $class && defined(constant(strtoupper('CLASS_'.$class))) ) 
    798814                    $schedulable['class'] = constant(strtoupper('CLASS_'.$class)); 
    799                 else if( !isset($exists['class']) ) 
     815                else if( !isset($schedulable['class']) ) 
    800816                    $schedulable['class'] = CLASS_PRIVATE ; // padrão classe private 
    801817 
     
    833849                $mailUser = trim(str_replace('MAILTO:', '', $property['value'])); 
    834850 
    835                 $participantID = mt_rand().'2(Formatter)'; 
     851                $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ?  $tpID : mt_rand().'2(Formatter)'; 
    836852                $participant['schedulable'] = $eventID;                                       
    837853                 
     
    882898                $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_'.$property['params']['PARTSTAT']) !== null ) ? constant('STATUS_'.$property['params']['PARTSTAT']) : STATUS_UNANSWERED; 
    883899                $participant['isOrganizer'] = '1'; 
    884                                 $participant['acl'] = 'rowi'; 
     900                $participant['acl'] = 'rowi'; 
    885901 
    886902                /* Verifica se este usuario é um usuario interno do ldap */      
     
    915931               $user = Controller::read( array( 'concept' => 'user', 'id' => $params['owner'] ) , array('mail'));  
    916932 
    917                if(!self::_getParticipantByMail($user['mail'] , $exists['participants'])) 
     933               if(!self::_getParticipantByMail($user['mail'] , $schedulable['participants'])) 
    918934               { 
    919935                    $participantID = mt_rand().'2(Formatter)'; 
     
    10061022                 
    10071023                 
    1008                  static private function _getContentType( $fileName ) 
     1024        static private function _getContentType( $fileName ) 
    10091025        { 
    10101026            $strFileType = strtolower(substr ( $fileName , strrpos($fileName, '.') )); 
Note: See TracChangeset for help on using the changeset viewer.