Ignore:
Timestamp:
07/11/12 12:09:14 (12 years ago)
Author:
douglasz
Message:

Ticket #2955 - Melhorar atualização de status de participante externo de evento do Calendar.

Location:
sandbox/2.4.2-expresso3/prototype
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso3/prototype/modules/calendar/constants.php

    r6295 r6755  
    3333define('ICAL_ACTION_IMPORT_FROM_PERMISSION', 10); 
    3434define('ICAL_ACTION_NONE_FROM_PERMISSION', 11); 
     35define('ICAL_NOT_FOUND', 12); 
    3536 
    3637define('ATTENDEE_ACL_ORGANIZATION', 'o'); 
  • sandbox/2.4.2-expresso3/prototype/services/iCal.php

    r6528 r6755  
    475475                                $interation['schedulable://' . $schedulable['id']] = false; 
    476476                            break; 
    477  
     477                                 
    478478                        case 'ADD': 
    479479                            break; 
     
    623623 
    624624                        case 'REPLY': 
    625                             $interation = ICAL_ACTION_REPLY; 
     625                                if ($schedulable = self::_getSchedulable($uid)) { 
     626                                        while ($property = $component->getProperty('attendee', FALSE, TRUE)) 
     627                                            if ($attendee = self::_getParticipantByMail(str_replace('MAILTO:', '', $property['value']), $schedulable['participants'], true)) 
     628                                                        $interation = (constant('STATUS_' . strtoupper($property['params']['PARTSTAT'])) == $attendee['status']) ?  ICAL_ACTION_NONE : ICAL_ACTION_REPLY; 
     629                            }else 
     630                                $interation = ICAL_NOT_FOUND; 
    626631                            break; 
    627632 
     
    713718     
    714719     
    715     private static function _getParticipantByMail($mail, &$participants) { 
     720    private static function _getParticipantByMail($mail, &$participants, $isFull) { 
    716721        if ($participants && $participants != '') 
    717722            foreach ($participants as $i => $v) 
    718723                if ((is_array($v) && isset($v['user'])) && ($v['user']['mail'] == $mail || (isset($v['user']['mailAlternateAddress']) && in_array($mail, $v['user']['mailAlternateAddress'])))) 
    719                     return $v['id']; 
     724                      return !!$isFull ? $v : $v['id']; 
    720725        return false; 
    721726    } 
Note: See TracChangeset for help on using the changeset viewer.