Changeset 7028 for trunk/prototype/services/iCal.php
- Timestamp:
- 08/15/12 16:35:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/services/iCal.php
r7006 r7028 107 107 108 108 $vevent->setProperty('uid', $v['uid']); 109 110 break; 111 case TASK_ID: 109 break; 110 case TODO_ID: 112 111 113 112 $todo = $ical->newComponent('todo'); … … 138 137 } 139 138 140 if(isset($v['due']) && $v['due'] != '' ){139 if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){ 141 140 $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone); 142 141 $dueTime->setTimezone($apTimezoneOBJ); 143 142 144 143 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 145 } 146 147 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 144 $todo->setProperty('dueTime', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 145 } 148 146 149 147 if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0) … … 186 184 } 187 185 188 189 186 return $ical->createCalendar(); 190 187 } … … 269 266 break; 270 267 271 case T ASK_ID:268 case TODO_ID: 272 269 273 270 $todo = $ical->newComponent('todo'); … … 298 295 } 299 296 300 if(isset($v['due']) && $v['due'] != '' ){297 if(isset($v['due']) && $v['due'] != '' && (int)$v['due'] > 0){ 301 298 $dueTime = new DateTime('@' . (int) ($v['due'] / 1000), $timezone); 302 299 $dueTime->setTimezone($apTimezoneOBJ); … … 304 301 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone)); 305 302 } 306 307 $todo->setProperty('due', $dueTime->format(DATE_RFC822), array('TZID' => $apTimezone));308 303 309 304 if (isset($v['participants']) && is_array($v['participants']) && count($v['participants']) > 0) … … 838 833 $user = Controller::Read(array('concept' => 'user'), false, array('filter' => array('=', 'id', $params['owner'])) ); 839 834 $pID = self::_getParticipantByMail($user[0]['mail'], $schedulable['participants']); 840 }else 835 }else{ 841 836 $pID = self::_getParticipantByMail(Config::me('mail'), $schedulable['participants']); 842 //Verifica a importação de eventos em que não participo 843 if ($pID) { 844 $interation['participant://' . $pID]['status'] = $params['status']; 837 //Verifica a importação de tarefas em que não participo 838 if ($pID) { 839 $pID = mt_rand() . '2(Formatter)'; 840 $interation['participant://' . $pID]['status'] = $params['status']; 841 $interation['participant://' . $pID]['user'] = $params['owner']; 842 $interation['participant://' . $pID]['isOrganizer'] = '0'; 843 $interation['participant://' . $pID]['schedulable'] = $schedulable['id']; 844 }else 845 $interation['participant://' . $pID]['status'] = $params['status']; 845 846 } 846 847 } 847 848 } 848 849 } else { // Importar tarefa 849 $interation = self::_makeV EVENT(array(), $component, $params);850 $interation = self::_makeVTODO(array(), $component, $params); 850 851 851 852 if (strpos($params['prodid'], 'kigkonsult.se') !== false) { //envia notificação para fora … … 915 916 if ($percentage = $component->getProperty('percent-complete', false, false)) 916 917 $sc['percentage'] = mb_convert_encoding(str_ireplace(array('\n', '\t'), array("\n", "\t"), $percentage), 'UTF-8', 'UTF-8,ISO-8859-1'); 917 918 $todo->setProperty('priority', $v['priority']);919 $todo->setProperty('percent-complete', $v['percentage']);920 $todo->setProperty('status', $this->_getStatusTodo($v['status']));921 918 922 919 /* Definindo location */ … … 1331 1328 ); 1332 1329 1333 return isset($a[$ id]) ? $a[$id] : 'STATUS_TODO_NEED_ACTION';1330 return isset($a[$action]) ? $a[$action] : 'STATUS_TODO_NEED_ACTION'; 1334 1331 1335 1332 } … … 1834 1831 1835 1832 $participantID = ($tpID = self::_getParticipantByMail($mailUser, $schedulable['participants'])) ? $tpID : mt_rand() . '2(Formatter)'; 1836 $participant['schedulable'] = $ eventID;1833 $participant['schedulable'] = $todoID; 1837 1834 1838 1835 if (isset($params['status']) && $mailUser == Config::me('mail')) … … 1874 1871 $participantID = mt_rand() . '2(Formatter)'; 1875 1872 1876 $participant['schedulable'] = $ eventID;1873 $participant['schedulable'] = $todoID; 1877 1874 $participant['status'] = (isset($property['params']['PARTSTAT']) && constant('STATUS_' . $property['params']['PARTSTAT']) !== null ) ? constant('STATUS_' . $property['params']['PARTSTAT']) : STATUS_UNANSWERED; 1878 1875 $participant['isOrganizer'] = '1';
Note: See TracChangeset
for help on using the changeset viewer.