2012-10-24 22:22:24 +02:00
|
|
|
<?php
|
|
|
|
|
2014-07-23 02:03:09 +02:00
|
|
|
final class PhabricatorCalendarApplication extends PhabricatorApplication {
|
2012-10-24 22:22:24 +02:00
|
|
|
|
2014-07-23 15:52:50 +02:00
|
|
|
public function getName() {
|
|
|
|
return pht('Calendar');
|
|
|
|
}
|
|
|
|
|
2012-10-24 22:22:24 +02:00
|
|
|
public function getShortDescription() {
|
2014-05-29 21:17:54 +02:00
|
|
|
return pht('Upcoming Events');
|
2012-10-24 22:22:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Never miss an episode ever again.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/calendar/';
|
|
|
|
}
|
|
|
|
|
2015-01-25 08:41:43 +01:00
|
|
|
public function getFontIcon() {
|
|
|
|
return 'fa-calendar';
|
|
|
|
}
|
|
|
|
|
2012-10-24 22:22:24 +02:00
|
|
|
public function getTitleGlyph() {
|
|
|
|
// Unicode has a calendar character but it's in some distant code plane,
|
|
|
|
// use "keyboard" since it looks vaguely similar.
|
|
|
|
return "\xE2\x8C\xA8";
|
|
|
|
}
|
|
|
|
|
2014-09-18 03:25:57 +02:00
|
|
|
public function isPrototype() {
|
2013-01-19 19:12:44 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-27 23:27:34 +02:00
|
|
|
public function getRemarkupRules() {
|
|
|
|
return array(
|
|
|
|
new PhabricatorCalendarRemarkupRule(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-24 22:22:24 +02:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
2015-04-27 23:26:25 +02:00
|
|
|
'/E(?P<id>[1-9]\d*)' => 'PhabricatorCalendarEventViewController',
|
2012-10-24 22:22:24 +02:00
|
|
|
'/calendar/' => array(
|
2015-05-05 21:51:32 +02:00
|
|
|
'(?:query/(?P<queryKey>[^/]+)/(?:(?P<year>\d+)/'.
|
|
|
|
'(?P<month>\d+)/)?(?:(?P<day>\d+)/)?)?'
|
2015-05-03 00:27:33 +02:00
|
|
|
=> 'PhabricatorCalendarEventListController',
|
2015-05-19 20:13:20 +02:00
|
|
|
'icon/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventEditIconController',
|
|
|
|
'icon/'
|
|
|
|
=> 'PhabricatorCalendarEventEditIconController',
|
2014-02-06 19:10:07 +01:00
|
|
|
'event/' => array(
|
2014-07-23 02:03:09 +02:00
|
|
|
'create/'
|
|
|
|
=> 'PhabricatorCalendarEventEditController',
|
|
|
|
'edit/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventEditController',
|
2015-05-24 04:47:23 +02:00
|
|
|
'drag/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventDragController',
|
Canceling calendar events should deactivate the event
Summary: Closes T7943, Canceling calendar event should deactivate the event instead of destroying data.
Test Plan: Create an event, cancel it, see changed status icon, query for active events, event should not appear, query for deactivated events, event should appear in results.
Reviewers: #blessed_reviewers, epriestley
Reviewed By: #blessed_reviewers, epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T7943
Differential Revision: https://secure.phabricator.com/D12604
2015-04-29 17:39:39 +02:00
|
|
|
'cancel/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventCancelController',
|
2015-04-30 04:48:46 +02:00
|
|
|
'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'
|
2015-04-30 03:18:27 +02:00
|
|
|
=> 'PhabricatorCalendarEventJoinController',
|
2015-05-01 02:38:04 +02:00
|
|
|
'comment/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventCommentController',
|
2012-10-24 22:22:24 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-01-30 00:41:30 +01:00
|
|
|
public function getQuickCreateItems(PhabricatorUser $viewer) {
|
|
|
|
$items = array();
|
|
|
|
|
|
|
|
$item = id(new PHUIListItemView())
|
|
|
|
->setName(pht('Calendar Event'))
|
2014-05-12 22:34:00 +02:00
|
|
|
->setIcon('fa-calendar')
|
2014-02-06 19:10:07 +01:00
|
|
|
->setHref($this->getBaseURI().'event/create/');
|
2014-01-30 00:41:30 +01:00
|
|
|
$items[] = $item;
|
|
|
|
|
|
|
|
return $items;
|
|
|
|
}
|
|
|
|
|
2015-05-01 22:26:07 +02:00
|
|
|
public function getMailCommandObjects() {
|
|
|
|
return array(
|
|
|
|
'event' => array(
|
|
|
|
'name' => pht('Email Commands: Events'),
|
|
|
|
'header' => pht('Interacting with Calendar Events'),
|
|
|
|
'object' => new PhabricatorCalendarEvent(),
|
|
|
|
'summary' => pht(
|
|
|
|
'This page documents the commands you can use to interact with '.
|
|
|
|
'events in Calendar. These commands work when creating new tasks '.
|
|
|
|
'via email and when replying to existing tasks.'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-24 22:22:24 +02:00
|
|
|
}
|