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