Changeset 7702 for trunk/prototype/services/iCal.php
- Timestamp:
- 01/03/13 08:46:17 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/services/iCal.php
r7695 r7702 64 64 if (( isset($v['repeat']) ) && ( isset($v['repeat']['frequency']) && $v['repeat']['frequency'] && $v['repeat']['frequency'] != 'none' )) 65 65 $vevent->setProperty('rrule', $this->formatIcalRepeat($v['repeat'])); 66 66 67 $vevent->setProperty('dtstamp', array('timestamp' => ($v['dtstamp'] / 1000) )); 67 68 68 69 if (isset($v['allDay']) && $v['allDay'] == 1) … … 200 201 $eTime->setTimezone($apTimezoneOBJ); 201 202 203 $vevent->setProperty('dtstamp', array('timestamp' => ($v['dtstamp'] / 1000) )); 204 202 205 if (isset($v['allDay']) && $v['allDay'] == 1) { 203 206 $todo->setProperty('dtstart', $sTime->format(DATE_RFC822), array("VALUE" => "DATE")); … … 281 284 $vevent->setProperty('location', $v['location']); 282 285 $vevent->setProperty('tranp', (isset($v['tranparent']) && $v['tranparent'] == TRANSP_TRANSPARENT ) ? 'TRANSPARENT' : 'OPAQUE' ); 286 287 $vevent->setProperty('dtstamp', array('timestamp' => ($v['dtstamp'] / 1000) )); 283 288 284 289 $timezone = new DateTimeZone('UTC'); … … 348 353 $todo->setProperty('status', $this->_getStatusTodo($v['status'])); 349 354 355 $vevent->setProperty('dtstamp', array('timestamp' => ($v['dtstamp'] / 1000) )); 356 350 357 $timezone = new DateTimeZone('UTC'); 351 358 $apTimezone = self::nomalizeTZID(( isset($v['timezone']) && $v['timezone'] != 'null' ) ? $v['timezone'] : $params['defaultTZI']); … … 543 550 case 'VEVENT': 544 551 552 545 553 switch ($method) { 546 554 case 'PUBLISH': … … 610 618 //Verifica a importação de eventos em que não participo 611 619 if ($pID) { 620 612 621 $interation['participant://' . $pID]['status'] = $params['status']; 622 613 623 } 614 624 } … … 848 858 break; 849 859 } 850 851 860 852 861 $return[] = $interation; 853 862 break; … … 1562 1571 $objTimezone = new DateTimeZone($schedulable['timezone']); 1563 1572 1564 if (isset($startTime['params']['VALUE']) && $startTime['params']['VALUE'] === 'DATE' && isset($params['calendar_timezone'])) {1573 if (isset($startTime['params']['VALUE']) && $startTime['params']['VALUE'] === 'DATE' ) { 1565 1574 $schedulable['allDay'] = 1; 1566 1575 $schedulable['startTime'] = self::date2timestamp($startTime['value']) - self::_getTzOffset('UTC', $schedulable['timezone'], '@' . self::date2timestamp($startTime['value'])) . '000'; … … 1667 1676 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1668 1677 1669 1678 $user = null; 1670 1679 if ($intUser && count($intUser) > 0) { 1671 1680 $participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0; … … 1689 1698 1690 1699 if ($property = $component->getProperty('organizer', FALSE, TRUE)) { 1691 $participant = array(); 1700 1692 1701 $mailUser = trim(str_replace('MAILTO:', '', $property['value'])); 1693 1702 1694 $participantID = mt_rand() . '2(Formatter)'; 1695 1696 $participant['schedulable'] = $eventID; 1697 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1698 $participant['isOrganizer'] = '1'; 1699 $participant['acl'] = 'rowi'; 1703 1704 if($participant = self::_getParticipantByMail($mailUser, $schedulable['participants'], true)){ 1705 1706 $participantID = $participant['id']; 1707 1708 }else{ 1709 1710 $participant = array(); 1711 1712 $participantID = mt_rand() . '2(Formatter)'; 1713 $participant['schedulable'] = $eventID; 1714 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1715 $participant['isOrganizer'] = '1'; 1716 $participant['acl'] = 'rowi'; 1717 } 1700 1718 1701 1719 /* Verifica se este usuario é um usuario interno do ldap */ 1702 1720 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1703 1704 1721 $user = null; 1705 1722 if ($intUser && count($intUser) > 0) { 1706 1707 1723 $participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0; 1724 $participant['user'] = $intUser[0]['id']; 1708 1725 } else { 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1726 $participant['isExternal'] = 1; 1727 /* Gera um randon id para o contexto formater */ 1728 $userID = mt_rand() . '4(Formatter)'; 1729 1730 $user['mail'] = $mailUser; 1731 $user['name'] = ( isset($property['params']['CN']) ) ? $property['params']['CN'] : ''; 1732 $user['participants'] = array($participantID); 1733 $user['isExternal'] = '1'; 1734 $participant['user'] = $userID; 1735 $interation['user://' . $userID] = $user; 1719 1736 } 1720 1737 … … 1828 1845 $interation['schedulable://' . $eventID] = $schedulable; 1829 1846 1830 1847 return $interation; 1831 1848 } 1832 1849 … … 1956 1973 $mailUser = trim(str_replace('MAILTO:', '', $property['value'])); 1957 1974 1958 $participantID = mt_rand() . '2(Formatter)'; 1959 1960 $participant['schedulable'] = $todoID; 1961 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1962 $participant['isOrganizer'] = '1'; 1963 $participant['acl'] = 'rowi'; 1975 if($participant = self::_getParticipantByMail($mailUser, $schedulable['participants'], true)){ 1976 1977 $participantID = $participant['id']; 1978 1979 }else{ 1980 1981 $participant = array(); 1982 1983 $participantID = mt_rand() . '2(Formatter)'; 1984 $participant['schedulable'] = $todoID; 1985 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1986 $participant['isOrganizer'] = '1'; 1987 $participant['acl'] = 'rowi'; 1988 } 1964 1989 1965 1990 /* Verifica se este usuario é um usuario interno do ldap */
Note: See TracChangeset
for help on using the changeset viewer.