Browse Source

Merge pull request #23080 from owncloud/use-non-localized-birthday-title

Use a birthday title which does not require translation because we ha…
remotes/origin/external-storage-mountpoint-root
Thomas Müller 10 years ago
parent
commit
750ec93394
  1. 4
      apps/dav/lib/caldav/birthdayservice.php
  2. 2
      apps/dav/tests/unit/carddav/birthdayservicetest.php

4
apps/dav/lib/caldav/birthdayservice.php

@ -123,7 +123,7 @@ class BirthdayService {
}
$title = str_replace('{name}',
strtr((string)$doc->FN, array('\,' => ',', '\;' => ';')),
'{name}\'s Birthday'
'{name}'
);
try {
$date = new \DateTime($birthday);
@ -146,7 +146,7 @@ class BirthdayService {
$vEvent->DTEND['VALUE'] = 'DATE';
$vEvent->{'UID'} = $doc->UID;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
$vEvent->{'SUMMARY'} = $title . ' (' . $date->format('Y') . ')';
$vEvent->{'SUMMARY'} = $title . ' (*' . $date->format('Y') . ')';
$vEvent->{'TRANSP'} = 'TRANSPARENT';
$vCal->add($vEvent);
return $vCal;

2
apps/dav/tests/unit/carddav/birthdayservicetest.php

@ -59,7 +59,7 @@ class BirthdayServiceTest extends TestCase {
$this->assertInstanceOf('Sabre\VObject\Component\VCalendar', $cal);
$this->assertTrue(isset($cal->VEVENT));
$this->assertEquals('FREQ=YEARLY', $cal->VEVENT->RRULE->getValue());
$this->assertEquals('12345\'s Birthday (1900)', $cal->VEVENT->SUMMARY->getValue());
$this->assertEquals('12345 (*1900)', $cal->VEVENT->SUMMARY->getValue());
$this->assertEquals('TRANSPARENT', $cal->VEVENT->TRANSP->getValue());
}
}

Loading…
Cancel
Save