Ignore:
Timestamp:
08/15/12 16:35:27 (12 years ago)
Author:
acoutinho
Message:

Ticket #3032 - Nao e enviado email de confirmacao de participacao de participante externo em tarefa

File:
1 edited

Legend:

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

    r7006 r7028  
    107107 
    108108                            $vevent->setProperty('uid', $v['uid']);   
    109                              
    110                             break; 
    111             case TASK_ID: 
     109                            break; 
     110            case TODO_ID: 
    112111 
    113112                $todo = $ical->newComponent('todo'); 
     
    138137                } 
    139138 
    140                 if(isset($v['due']) && $v['due'] != ''){ 
     139                if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){ 
    141140                    $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone); 
    142141                    $dueTime->setTimezone($apTimezoneOBJ); 
    143142 
    144143                    $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 
    145                 } 
    146                  
    147                 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 
     144                    $todo->setProperty('dueTime', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 
     145                }                 
    148146                        
    149147                if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0) 
     
    186184                }        
    187185 
    188          
    189186                return $ical->createCalendar(); 
    190187    } 
     
    269266                            break; 
    270267                         
    271         case TASK_ID: 
     268        case TODO_ID: 
    272269 
    273270            $todo = $ical->newComponent('todo'); 
     
    298295            } 
    299296 
    300             if(isset($v['due']) && $v['due'] != ''){ 
     297            if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){ 
    301298                $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone); 
    302299                $dueTime->setTimezone($apTimezoneOBJ); 
     
    304301                $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 
    305302            } 
    306              
    307             $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 
    308303                    
    309304            if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0) 
     
    838833                               $user = Controller::Read(array('concept' => 'user'), false, array('filter' => array('=', 'id', $params['owner'])) );                      
    839834                                $pID = self::_getParticipantByMail($user[0]['mail'], $schedulable['participants']); 
    840                             }else 
     835                            }else{ 
    841836                                $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 
    842                             //Verifica a importação de eventos em que não participo 
    843                             if ($pID) { 
    844                                 $interation['participant://' . $pID]['status'] = $params['status']; 
     837                                //Verifica a importação de tarefas em que não participo 
     838                                if ($pID) { 
     839                                    $pID =  mt_rand() . '2(Formatter)'; 
     840                                    $interation['participant://' . $pID]['status'] = $params['status']; 
     841                                    $interation['participant://' . $pID]['user'] = $params['owner']; 
     842                                    $interation['participant://' . $pID]['isOrganizer'] = '0'; 
     843                                    $interation['participant://' . $pID]['schedulable'] = $schedulable['id']; 
     844                                }else 
     845                                    $interation['participant://' . $pID]['status'] = $params['status']; 
    845846                            } 
    846847                        } 
    847848                    } 
    848849                } else { // Importar tarefa 
    849                     $interation = self::_makeVEVENT(array(), $component, $params); 
     850                    $interation = self::_makeVTODO(array(), $component, $params); 
    850851 
    851852                    if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 
     
    915916            if ($percentage = $component->getProperty('percent-complete', false, false)) 
    916917                $sc['percentage'] = mb_convert_encoding(str_ireplace(array('\n', '\t'), array("\n", "\t"), $percentage), 'UTF-8', 'UTF-8,ISO-8859-1'); 
    917  
    918             $todo->setProperty('priority', $v['priority']); 
    919             $todo->setProperty('percent-complete', $v['percentage']); 
    920             $todo->setProperty('status', $this->_getStatusTodo($v['status'])); 
    921918 
    922919                        /* Definindo location */ 
     
    13311328    ); 
    13321329 
    1333     return isset($a[$id]) ? $a[$id] : 'STATUS_TODO_NEED_ACTION'; 
     1330    return isset($a[$action]) ? $a[$action] : 'STATUS_TODO_NEED_ACTION'; 
    13341331     
    13351332    } 
     
    18341831 
    18351832            $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ? $tpID : mt_rand() . '2(Formatter)'; 
    1836             $participant['schedulable'] = $eventID; 
     1833            $participant['schedulable'] = $todoID; 
    18371834 
    18381835            if (isset($params['status']) && $mailUser == Config::me('mail')) 
     
    18741871            $participantID = mt_rand() . '2(Formatter)'; 
    18751872 
    1876             $participant['schedulable'] = $eventID; 
     1873            $participant['schedulable'] = $todoID; 
    18771874            $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 
    18781875            $participant['isOrganizer'] = '1'; 
Note: See TracChangeset for help on using the changeset viewer.