Changeset 8257 for branches/2.5
- Timestamp:
- 11/25/13 01:47:25 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/prototype/services/iCal.php
r8232 r8257 495 495 $isResponseDelegated = false; 496 496 if ((isset($pv['delegatedFrom']) && $pv['delegatedFrom'] == 0) || !isset($pv['delegatedFrom'])) { 497 if ($pv['isOrganizer'] == 1) 498 $vevent->setProperty('organizer', $pv['user']['mail'], array('CN' => $pv['user']['name'])); 499 else { 497 if ($pv['isOrganizer'] == 1){ 498 if($pv['user']['id'] == Config::me('uidNumber')) 499 $pv['user']['mail'] = $pv['user']['mailSenderAddress']; 500 501 $vevent->setProperty('organizer', $pv['user']['mail'], array('CN' => $pv['user']['name'])); 502 }else { 500 503 $pParams = array(); 501 504 $pParams['CN'] = $pv['user']['name']; … … 618 621 if (self::_getTime($component, 'dtstamp') > $schedulable['dtstamp'] || $component->getProperty('sequence', false, false) > $schedulable['sequence']){ //Organizador esta requisitando que você atualize o evento 619 622 623 620 624 $params['calendar'] = $params['calendar'] == 'true' ? $calendar : $params['calendar']; 621 625 $interation = self::_makeVEVENT($schedulable, $component, $params); … … 642 646 $interation = self::_makeVEVENT(array(), $component, $params); 643 647 644 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora648 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora 645 649 646 650 /* Data de Inicio */ … … 693 697 694 698 699 695 700 if ($uid = $component->getProperty('uid', false, false)) 696 701 ; … … 710 715 711 716 717 718 712 719 if ($property = $component->getProperty('organizer', FALSE, TRUE)) { 713 720 $participant = array(); … … 733 740 $sc['participants'][] = $participant; 734 741 } 742 735 743 736 744 … … 749 757 $sc['participants'][] = $participant; 750 758 $sc['type'] = EVENT_ID; 759 751 760 752 761 … … 801 810 break; 802 811 } 812 803 813 require_once ROOTPATH . '/api/parseTPL.php'; 804 814 … … 1228 1238 foreach ($schedulable['participants'] as $value){ 1229 1239 1240 1230 1241 if ($value['user']['id'] == $params['owner']) { 1231 1242 $isParticipant = true; … … 1429 1440 1430 1441 1442 1431 1443 return $offset; 1432 1444 } … … 1457 1469 } 1458 1470 1471 1459 1472 private function _getStatusTodo($id) { 1460 1473 $a = array( … … 1467 1480 return isset($a[$id]) ? $a[$id] : 'NEED_ACTION'; 1468 1481 } 1482 1469 1483 1470 1484 private static function _checkParticipantByPermissions($schedulable) { … … 1583 1597 1584 1598 static private function _makeVEVENT($schedulable, $component, $params) { 1599 1600 1585 1601 $interation = array(); 1586 1602 $eventID = isset($schedulable['id']) ? $schedulable['id'] : mt_rand() . '(Formatter)'; … … 1641 1657 1642 1658 1659 1643 1660 $schedulable['summary'] = mb_convert_encoding($component->getProperty('summary', false, false), 'ISO-8859-1', 'UTF-8,ISO-8859-1'); 1644 1661 … … 1650 1667 if ($location = $component->getProperty('location', false, false)) 1651 1668 $schedulable['location'] = mb_convert_encoding($location, 'ISO-8859-1', 'UTF-8,ISO-8859-1'); 1669 1652 1670 1653 1671 … … 1694 1712 $participant['schedulable'] = $eventID; 1695 1713 1696 if (isset($params['status']) && $mailUser == Config::me('mail'))1714 if (isset($params['status']) && ltrim( substr( $mailUser, 0 , strpos( $mailUser, '@' ) ), '@' ) == ltrim( substr( Config::me('mail'), 0, strpos( Config::me('mail'), '@' ) ), '@' )) 1697 1715 $participant['status'] = $params['status']; 1698 1716 else 1699 1717 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1700 1701 1718 1702 1719 $participant['isOrganizer'] = '0'; … … 1731 1748 1732 1749 1750 1733 1751 if($participant = self::_getParticipantByMail($mailUser, $schedulable['participants'], true)){ 1734 1752 … … 1748 1766 /* Verifica se este usuario é um usuario interno do ldap */ 1749 1767 $intUser = Controller::find(array('concept' => 'user'), array('id', 'isExternal'), array('filter' => array('OR', array('=', 'mail', $mailUser), array('=', 'mailAlternateAddress', $mailUser)))); 1750 $user = null; 1751 if ($intUser && count($intUser) > 0) { 1768 1769 $user = null; 1770 if ($intUser && count($intUser) > 0 && $intUser[0]['id']) { 1752 1771 $participant['isExternal'] = isset($intUser[0]['isExternal']) ? $intUser[0]['isExternal'] : 0; 1753 1772 $participant['user'] = $intUser[0]['id']; … … 1942 1961 $schedulable['summary'] = mb_convert_encoding($component->getProperty('summary', false, false), 'ISO-8859-1', 'UTF-8,ISO-8859-1'); 1943 1962 1963 1944 1964 /* Definindo Description */ 1945 1965 if ($desc = $component->getProperty('description', false, false)) … … 2144 2164 $interation['schedulable://' . $todoID] = $schedulable; 2145 2165 2166 2167 2146 2168 return $interation; 2147 2169 } … … 2163 2185 foreach ($sig2 as $val) 2164 2186 $calendars[] = $val['calendar']; 2187 2165 2188 2166 2189
Note: See TracChangeset
for help on using the changeset viewer.