1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00

Adds details to Calendar event feed titles

Summary: Closes T8340

Test Plan: Verify that calendar event feed titles have more detail that before.

Reviewers: lpriestley, #blessed_reviewers, epriestley

Reviewed By: lpriestley, #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T8340

Differential Revision: https://secure.phabricator.com/D13352
This commit is contained in:
Paul Kassianik 2015-06-20 09:45:37 -07:00 committed by epriestley
parent b22fba1ab5
commit b1f64d9356
3 changed files with 71 additions and 6 deletions

View file

@ -341,10 +341,10 @@ final class PhabricatorCalendarEventEditController
$recurrence_frequency_select = id(new AphrontFormSelectControl()) $recurrence_frequency_select = id(new AphrontFormSelectControl())
->setName('frequency') ->setName('frequency')
->setOptions(array( ->setOptions(array(
'daily' => pht('Daily'), PhabricatorCalendarEvent::FREQUENCY_DAILY => pht('Daily'),
'weekly' => pht('Weekly'), PhabricatorCalendarEvent::FREQUENCY_WEEKLY => pht('Weekly'),
'monthly' => pht('Monthly'), PhabricatorCalendarEvent::FREQUENCY_MONTHLY => pht('Monthly'),
'yearly' => pht('Yearly'), PhabricatorCalendarEvent::FREQUENCY_YEARLY => pht('Yearly'),
)) ))
->setValue($frequency) ->setValue($frequency)
->setLabel(pht('Recurring Event Frequency')) ->setLabel(pht('Recurring Event Frequency'))

View file

@ -37,6 +37,12 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
private $invitees = self::ATTACHABLE; private $invitees = self::ATTACHABLE;
private $appliedViewer; private $appliedViewer;
// Frequency Constants
const FREQUENCY_DAILY = 'daily';
const FREQUENCY_WEEKLY = 'weekly';
const FREQUENCY_MONTHLY = 'monthly';
const FREQUENCY_YEARLY = 'yearly';
public static function initializeNewCalendarEvent( public static function initializeNewCalendarEvent(
PhabricatorUser $actor, PhabricatorUser $actor,
$mode) { $mode) {

View file

@ -254,11 +254,37 @@ final class PhabricatorCalendarEventTransaction
} }
return $text; return $text;
case self::TYPE_RECURRING: case self::TYPE_RECURRING:
$text = pht('%s made this event recurring.',
$this->renderHandleLink($author_phid));
return $text;
case self::TYPE_FREQUENCY: case self::TYPE_FREQUENCY:
$text = '';
switch ($new['rule']) {
case PhabricatorCalendarEvent::FREQUENCY_DAILY:
$text = pht('%s set this event to repeat daily.',
$this->renderHandleLink($author_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_WEEKLY:
$text = pht('%s set this event to repeat weekly.',
$this->renderHandleLink($author_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_MONTHLY:
$text = pht('%s set this event to repeat monthly.',
$this->renderHandleLink($author_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_YEARLY:
$text = pht('%s set this event to repeat yearly.',
$this->renderHandleLink($author_phid));
break;
}
return $text;
case self::TYPE_RECURRENCE_END_DATE: case self::TYPE_RECURRENCE_END_DATE:
$text = pht('%s has changed the recurrence end date of this event.',
$this->renderHandleLink($author_phid));
return $text;
case self::TYPE_INSTANCE_OF_EVENT: case self::TYPE_INSTANCE_OF_EVENT:
case self::TYPE_SEQUENCE_INDEX: case self::TYPE_SEQUENCE_INDEX:
return pht('Recurring event has been updated'); return pht('Recurring event has been updated.');
} }
return parent::getTitle(); return parent::getTitle();
} }
@ -438,11 +464,44 @@ final class PhabricatorCalendarEventTransaction
} }
return $text; return $text;
case self::TYPE_RECURRING: case self::TYPE_RECURRING:
$text = pht('%s made %s a recurring event.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
return $text;
case self::TYPE_FREQUENCY: case self::TYPE_FREQUENCY:
$text = '';
switch ($new['rule']) {
case PhabricatorCalendarEvent::FREQUENCY_DAILY:
$text = pht('%s set %s to repeat daily.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_WEEKLY:
$text = pht('%s set %s to repeat weekly.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_MONTHLY:
$text = pht('%s set %s to repeat monthly.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
case PhabricatorCalendarEvent::FREQUENCY_YEARLY:
$text = pht('%s set %s to repeat yearly.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid));
break;
}
return $text;
case self::TYPE_RECURRENCE_END_DATE: case self::TYPE_RECURRENCE_END_DATE:
$text = pht('%s set the recurrence end date of %s to %s.',
$this->renderHandleLink($author_phid),
$this->renderHandleLink($object_phid),
$new);
return $text;
case self::TYPE_INSTANCE_OF_EVENT: case self::TYPE_INSTANCE_OF_EVENT:
case self::TYPE_SEQUENCE_INDEX: case self::TYPE_SEQUENCE_INDEX:
return pht('Recurring event has been updated'); return pht('Recurring event has been updated.');
} }
return parent::getTitleForFeed(); return parent::getTitleForFeed();