parent
96ae7b7857
commit
1f9835e918
3 changed files with 31 additions and 3 deletions
|
@ -440,6 +440,13 @@ class libvcalendar implements Iterator
|
||||||
$event['status'] = $value;
|
$event['status'] = $value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'COMPLETED':
|
||||||
|
if (self::convert_datetime($prop)) {
|
||||||
|
$event['status'] = 'COMPLETED';
|
||||||
|
$event['complete'] = 100;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'PRIORITY':
|
case 'PRIORITY':
|
||||||
if (is_numeric($value))
|
if (is_numeric($value))
|
||||||
$event['priority'] = $value;
|
$event['priority'] = $value;
|
||||||
|
@ -1089,8 +1096,10 @@ class libvcalendar implements Iterator
|
||||||
|
|
||||||
if (!empty($event['complete'])) {
|
if (!empty($event['complete'])) {
|
||||||
$ve->add('PERCENT-COMPLETE', intval($event['complete']));
|
$ve->add('PERCENT-COMPLETE', intval($event['complete']));
|
||||||
// Apple iCal required the COMPLETED date to be set in order to consider a task complete
|
}
|
||||||
if ($event['complete'] == 100)
|
|
||||||
|
// Apple iCal and BusyCal required the COMPLETED date to be set in order to consider a task complete
|
||||||
|
if ($event['status'] == 'COMPLETED' || $event['complete'] == 100) {
|
||||||
$ve->add($this->datetime_prop($cal, 'COMPLETED', $event['changed'] ?: new DateTime('now - 1 hour'), true));
|
$ve->add($this->datetime_prop($cal, 'COMPLETED', $event['changed'] ?: new DateTime('now - 1 hour'), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -348,6 +348,13 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals(1, count($task['x-custom']), "Custom properties");
|
$this->assertEquals(1, count($task['x-custom']), "Custom properties");
|
||||||
$this->assertEquals(4, count($task['categories']));
|
$this->assertEquals(4, count($task['categories']));
|
||||||
$this->assertEquals('1234567890-12345678-PARENT', $task['parent_id'], "Parent Relation");
|
$this->assertEquals('1234567890-12345678-PARENT', $task['parent_id'], "Parent Relation");
|
||||||
|
|
||||||
|
$completed = $tasks[1];
|
||||||
|
$this->assertEquals('COMPLETED', $completed['status'], "Task status=completed when COMPLETED property is present");
|
||||||
|
$this->assertEquals(100, $completed['complete'], "Task percent complete value");
|
||||||
|
|
||||||
|
$ics = $ical->export(array($completed));
|
||||||
|
$this->assertRegExp('/COMPLETED:[0-9TZ]+/', $ics, "Export COMPLETED property");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,4 +40,16 @@ TRIGGER;VALUE=DURATION:-P1D
|
||||||
DESCRIPTION:Default Mozilla Description
|
DESCRIPTION:Default Mozilla Description
|
||||||
END:VALARM
|
END:VALARM
|
||||||
END:VTODO
|
END:VTODO
|
||||||
|
|
||||||
|
BEGIN:VTODO
|
||||||
|
SUMMARY:Send and receive iTip messages with task assignments
|
||||||
|
UID:7ADB358AD071AA00306962BF329EF317-FCBB6C4091F28CA0
|
||||||
|
SEQUENCE:0
|
||||||
|
DTSTAMP:20150527T101614Z
|
||||||
|
CREATED:20140801T091954Z
|
||||||
|
LAST-MODIFIED:20150527T101611Z
|
||||||
|
COMPLETED:20150527T101611Z
|
||||||
|
X-BUSYMAC-LASTMODBY:Thomas Brüderli
|
||||||
|
END:VTODO
|
||||||
|
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
||||||
|
|
Loading…
Add table
Reference in a new issue