Changeset 6985 for sandbox/2.4.2-expresso1/prototype/services
- Timestamp:
- 08/10/12 12:25:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.2-expresso1/prototype/services/iCal.php
r6951 r6985 292 292 293 293 public function parse($data, $params = false) { 294 Config::regSet('noAlarm', TRUE); //Evita o envio de notifica ção294 Config::regSet('noAlarm', TRUE); //Evita o envio de notificação 295 295 $vcalendar = new icalCreator( ); 296 296 $vcalendar->parse(trim($data)); … … 305 305 $interation = array(); 306 306 $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 313 307 314 308 switch (strtoupper($component->objName)) { … … 352 346 } 353 347 354 Config::regSet('noAlarm', FALSE); //reativa notifica ção348 Config::regSet('noAlarm', FALSE); //reativa notificação 355 349 } else { 356 350 357 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que voc êatualize o evento351 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 358 352 $interation = self::_makeVEVENT($schedulable, $component, $params); 359 353 else if ($component->getProperty('sequence', false, false) === $schedulable['sequence']) { 360 354 //Ler melhor rfc sobre isto 3.2.2.2 361 //Aparentemente épara retornar um ical com o evento atualizado para o attende355 //Aparentemente é para retornar um ical com o evento atualizado para o attende 362 356 } 363 357 … … 368 362 }else 369 363 $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 370 //Verifica a importa ção de eventos em que não participo364 //Verifica a importação de eventos em que não participo 371 365 if ($pID) { 372 366 $interation['participant://' . $pID]['status'] = $params['status']; … … 377 371 $interation = self::_makeVEVENT(array(), $component, $params); 378 372 379 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notifica ção para fora373 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 380 374 381 375 /* Data de Inicio */ … … 650 644 $interation['participant://' . $pID]['status'] = $params['status']; 651 645 } 652 Config::regSet('noAlarm', FALSE); //reativa notifica ção646 Config::regSet('noAlarm', FALSE); //reativa notificação 653 647 } else { 654 648 655 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que voc êatualize o evento649 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 656 650 $interation = self::_makeVEVENT($schedulable, $component, $params); 657 651 else if ($component->getProperty('sequence', false, false) === $schedulable['sequence']) { 658 652 //Ler melhor rfc sobre isto 3.2.2.2 659 //Aparentemente épara retornar um ical com o evento atualizado para o attende653 //Aparentemente é para retornar um ical com o evento atualizado para o attende 660 654 } 661 655 … … 666 660 }else 667 661 $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 668 //Verifica a importa ção de eventos em que não participo662 //Verifica a importação de eventos em que não participo 669 663 if ($pID) { 670 664 $interation['participant://' . $pID]['status'] = $params['status']; … … 675 669 $interation = self::_makeVEVENT(array(), $component, $params); 676 670 677 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notifica ção para fora671 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 678 672 679 673 /* Data de Inicio */ … … 944 938 switch ($method) { 945 939 case 'PUBLISH': 946 $interation = ICAL_ACTION_IMPORT;940 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 947 941 break; 948 942 … … 961 955 if (!self::_existInMyCalendars($schedulable['id'], $params['owner'])) { 962 956 $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'); 964 958 break; 965 959 } 966 960 } else { 967 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que voc êatualize o evento961 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 968 962 $interation = ($isOrganizer) ? ICAL_ACTION_ORGANIZER_UPDATE : ICAL_ACTION_UPDATE; 969 963 else … … 974 968 } 975 969 }else 976 $interation = ICAL_ACTION_IMPORT;970 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 977 971 978 972 if(($interation != ICAL_ACTION_NONE) && ($interation != ICAL_ACTION_ORGANIZER_NONE) && ($interation != ICAL_ACTION_ORGANIZER_UPDATE) && ($interation != ICAL_ACTION_NONE)) { … … 1024 1018 $interation = ICAL_ACTION_NONE; 1025 1019 else // Importar evento 1026 $interation = ICAL_ACTION_IMPORT;1020 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'calendarIds'); 1027 1021 1028 1022 break; … … 1034 1028 switch ($method) { 1035 1029 case 'PUBLISH': 1036 $interation = ICAL_ACTION_IMPORT;1030 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 1037 1031 break; 1038 1032 … … 1050 1044 $isOrganizer = true; 1051 1045 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'); 1061 1048 break; 1062 1049 } 1063 1050 } else { 1064 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que voc êatualize o evento1051 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']) //Organizador esta requisitando que você atualize o evento 1065 1052 $interation = ($isOrganizer) ? ICAL_ACTION_ORGANIZER_UPDATE : ICAL_ACTION_UPDATE; 1066 1053 else … … 1071 1058 } 1072 1059 }else 1073 $interation = ICAL_ACTION_IMPORT;1060 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 1074 1061 break; 1075 1062 … … 1104 1091 $interation = ICAL_ACTION_NONE; 1105 1092 else // Importar evento 1106 $interation = ICAL_ACTION_IMPORT;1093 $interation = array('action' => ICAL_ACTION_IMPORT, 'type' => 'groupIds'); 1107 1094 1108 1095 break; … … 1408 1395 $participant['isOrganizer'] = '0'; 1409 1396 1410 /* Verifica se este usuario éum usuario interno do ldap */1397 /* Verifica se este usuario é um usuario interno do ldap */ 1411 1398 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1412 1399 … … 1443 1430 $participant['acl'] = 'rowi'; 1444 1431 1445 /* Verifica se este usuario éum usuario interno do ldap */1432 /* Verifica se este usuario é um usuario interno do ldap */ 1446 1433 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1447 1434 … … 1666 1653 $participant['isOrganizer'] = '0'; 1667 1654 1668 /* Verifica se este usuario éum usuario interno do ldap */1655 /* Verifica se este usuario é um usuario interno do ldap */ 1669 1656 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1670 1657 … … 1701 1688 $participant['acl'] = 'rowi'; 1702 1689 1703 /* Verifica se este usuario éum usuario interno do ldap */1690 /* Verifica se este usuario é um usuario interno do ldap */ 1704 1691 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1705 1692
Note: See TracChangeset
for help on using the changeset viewer.