Ignore:
Timestamp:
08/10/12 12:25:20 (12 years ago)
Author:
acoutinho
Message:

Ticket #2966 - Correcao de bugs e refactoring das novas funcionalidades

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/services/iCal.php

    r6951 r6985  
    292292 
    293293    public function parse($data, $params = false) { 
    294         Config::regSet('noAlarm', TRUE); //Evita o envio de notificação 
     294        Config::regSet('noAlarm', TRUE); //Evita o envio de notificação 
    295295        $vcalendar = new icalCreator( ); 
    296296        $vcalendar->parse(trim($data)); 
     
    305305            $interation = array(); 
    306306            $uid = $component->getProperty('uid', false, false); //Resgata o uid do componente 
    307              
    308             ob_start(); 
    309             print_r(strtoupper($component->objName)); 
    310             $output = ob_get_clean(); 
    311             file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND); 
    312          
    313307 
    314308            switch (strtoupper($component->objName)) { 
     
    352346                                    } 
    353347 
    354                                     Config::regSet('noAlarm', FALSE); //reativa notificação 
     348                                    Config::regSet('noAlarm', FALSE); //reativa notificação 
    355349                                } else { 
    356350 
    357                                     if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
     351                                    if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
    358352                                        $interation = self::_makeVEVENT($schedulable, $component, $params); 
    359353                                    else if ($component->getProperty('sequence', false, false) === $schedulable['sequence']) { 
    360354                                        //Ler melhor rfc sobre isto 3.2.2.2 
    361                                         //Aparentemente é para retornar um ical com o evento atualizado para o attende 
     355                                        //Aparentemente é para retornar um ical com o evento atualizado para o attende 
    362356                                    } 
    363357 
     
    368362                                        }else 
    369363                                            $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 
    370                                         //Verifica a importação de eventos em que não participo 
     364                                        //Verifica a importação de eventos em que não participo 
    371365                                        if ($pID) { 
    372366                                            $interation['participant://' . $pID]['status'] = $params['status']; 
     
    377371                                $interation = self::_makeVEVENT(array(), $component, $params); 
    378372 
    379                                 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 
     373                                if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 
    380374 
    381375                                    /* Data de Inicio */ 
     
    650644                                $interation['participant://' . $pID]['status'] = $params['status']; 
    651645                        } 
    652                         Config::regSet('noAlarm', FALSE); //reativa notificação 
     646                        Config::regSet('noAlarm', FALSE); //reativa notificação 
    653647                    } else { 
    654648 
    655                         if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
     649                        if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
    656650                            $interation = self::_makeVEVENT($schedulable, $component, $params); 
    657651                        else if ($component->getProperty('sequence', false, false) === $schedulable['sequence']) { 
    658652                        //Ler melhor rfc sobre isto 3.2.2.2 
    659                         //Aparentemente é para retornar um ical com o evento atualizado para o attende 
     653                        //Aparentemente é para retornar um ical com o evento atualizado para o attende 
    660654                        } 
    661655 
     
    666660                            }else 
    667661                                $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 
    668                             //Verifica a importação de eventos em que não participo 
     662                            //Verifica a importação de eventos em que não participo 
    669663                            if ($pID) { 
    670664                                $interation['participant://' . $pID]['status'] = $params['status']; 
     
    675669                    $interation = self::_makeVEVENT(array(), $component, $params); 
    676670 
    677                     if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 
     671                    if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 
    678672 
    679673                        /* Data de Inicio */ 
     
    944938                    switch ($method) { 
    945939                        case 'PUBLISH': 
    946                             $interation = ICAL_ACTION_IMPORT; 
     940                            $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 
    947941                            break; 
    948942 
     
    961955                                        if (!self::_existInMyCalendars($schedulable['id'], $params['owner'])) { 
    962956                                            $interation = ICAL_ACTION_UPDATE; 
    963                                             $interation = ( strrpos($value['acl'], ATTENDEE_ACL_PARTICIPATION_REQUIRED) ) ? ICAL_ACTION_IMPORT_REQUIRED : ICAL_ACTION_IMPORT; 
     957                                            $interation = ( strrpos($value['acl'], ATTENDEE_ACL_PARTICIPATION_REQUIRED) ) ? ICAL_ACTION_IMPORT_REQUIRED : array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 
    964958                                            break; 
    965959                                        } 
    966960                                    } else { 
    967                                         if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
     961                                        if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
    968962                                            $interation = ($isOrganizer) ? ICAL_ACTION_ORGANIZER_UPDATE : ICAL_ACTION_UPDATE; 
    969963                                        else 
     
    974968                                    } 
    975969                            }else 
    976                                 $interation = ICAL_ACTION_IMPORT; 
     970                                $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 
    977971                             
    978972                            if(($interation != ICAL_ACTION_NONE) && ($interation != ICAL_ACTION_ORGANIZER_NONE) && ($interation != ICAL_ACTION_ORGANIZER_UPDATE) && ($interation != ICAL_ACTION_NONE)) { 
     
    10241018                                $interation = ICAL_ACTION_NONE; 
    10251019                            else // Importar evento 
    1026                                 $interation = ICAL_ACTION_IMPORT; 
     1020                                $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 
    10271021 
    10281022                            break; 
     
    10341028                    switch ($method) { 
    10351029                        case 'PUBLISH': 
    1036                             $interation = ICAL_ACTION_IMPORT; 
     1030                            $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 
    10371031                            break; 
    10381032 
     
    10501044                                            $isOrganizer = true; 
    10511045 
    1052                                         if (!self::_existInMyCalendars($schedulable['id'], $params['owner'])) { 
    1053                                              
    1054                                             ob_start(); 
    1055                                             print_r($schedulable['id']); 
    1056                                             print_r( $params['owner']); 
    1057                                             $output = ob_get_clean(); 
    1058                                             file_put_contents( "/tmp/acoutinho.log",  $output , FILE_APPEND); 
    1059                                              
    1060                                             $interation = ICAL_ACTION_IMPORT; 
     1046                                        if (!self::_existInMyCalendars($schedulable['id'], $params['owner'])) {    
     1047                                            $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 
    10611048                                            break; 
    10621049                                        } 
    10631050                                    } else { 
    1064                                         if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
     1051                                        if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 
    10651052                                            $interation = ($isOrganizer) ? ICAL_ACTION_ORGANIZER_UPDATE : ICAL_ACTION_UPDATE; 
    10661053                                        else 
     
    10711058                                    } 
    10721059                            }else 
    1073                                 $interation = ICAL_ACTION_IMPORT; 
     1060                                $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 
    10741061                            break; 
    10751062 
     
    11041091                                $interation = ICAL_ACTION_NONE; 
    11051092                            else // Importar evento 
    1106                                 $interation = ICAL_ACTION_IMPORT; 
     1093                                $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 
    11071094 
    11081095                            break; 
     
    14081395            $participant['isOrganizer'] = '0'; 
    14091396 
    1410             /* Verifica se este usuario é um usuario interno do ldap */ 
     1397            /* Verifica se este usuario é um usuario interno do ldap */ 
    14111398            $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 
    14121399 
     
    14431430            $participant['acl'] = 'rowi'; 
    14441431 
    1445             /* Verifica se este usuario é um usuario interno do ldap */ 
     1432            /* Verifica se este usuario é um usuario interno do ldap */ 
    14461433            $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 
    14471434 
     
    16661653            $participant['isOrganizer'] = '0'; 
    16671654 
    1668             /* Verifica se este usuario é um usuario interno do ldap */ 
     1655            /* Verifica se este usuario é um usuario interno do ldap */ 
    16691656            $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 
    16701657 
     
    17011688            $participant['acl'] = 'rowi'; 
    17021689 
    1703             /* Verifica se este usuario é um usuario interno do ldap */ 
     1690            /* Verifica se este usuario é um usuario interno do ldap */ 
    17041691            $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 
    17051692 
Note: See TracChangeset for help on using the changeset viewer.