2012-10-24 13:22:24 -07:00
|
|
|
<?php
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
final class PhabricatorCalendarApplication extends PhabricatorApplication {
|
2012-10-24 13:22:24 -07:00
|
|
|
|
2014-07-23 23:52:50 +10:00
|
|
|
public function getName() {
|
|
|
|
return pht('Calendar');
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
public function getShortDescription() {
|
2014-05-29 12:17:54 -07:00
|
|
|
return pht('Upcoming Events');
|
2012-10-24 13:22:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Never miss an episode ever again.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/calendar/';
|
|
|
|
}
|
|
|
|
|
2016-01-28 08:40:22 -08:00
|
|
|
public function getIcon() {
|
2015-01-24 23:41:43 -08:00
|
|
|
return 'fa-calendar';
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07: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";
|
|
|
|
}
|
|
|
|
|
2016-08-11 20:04:25 -07:00
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_UTILITIES;
|
|
|
|
}
|
|
|
|
|
2014-09-17 18:25:57 -07:00
|
|
|
public function isPrototype() {
|
2013-01-19 10:12:44 -08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-04-27 14:27:34 -07:00
|
|
|
public function getRemarkupRules() {
|
|
|
|
return array(
|
|
|
|
new PhabricatorCalendarRemarkupRule(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
Generate "stub" events earlier, so more infrastructure works with Calendar
Summary:
Ref T9275. When you create a recurring event which recurs forever, we want to avoid writing an infinite number of rows to the database.
Currently, we write a row to the database right before you edit the event. Until then, we refer to it as `E123/999` or whatever ("instance 999 of event 123").
This creates a big mess with trying to make recurring events work with EditEngine, Subscriptions, Projects, Flags, Tokens, etc -- all of this stuff assumes that whatever you're working with has a PHID.
I poked at letting this stuff work without a PHID a little bit, but that looked like a gigantic mess.
Instead, generate an event "stub" a little sooner (when you look at the event detail page). This is basically just an ID/PHID to refer to the instance.
Then, when you edit the stub, "materialize" it into a real event.
This still has some issues, but I think it's more promising than the other approach was.
Also:
- Removes dead user profile calendar controller.
- Replaces comments with EditEngine comments.
Test Plan:
- Commented on a recurring event.
- Awarded tokens to a recurring event.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9275
Differential Revision: https://secure.phabricator.com/D16248
2016-07-07 07:19:58 -07:00
|
|
|
'/E(?P<id>[1-9]\d*)(?:/(?P<sequence>\d+)/)?'
|
2015-05-28 17:27:25 -07:00
|
|
|
=> 'PhabricatorCalendarEventViewController',
|
2012-10-24 13:22:24 -07:00
|
|
|
'/calendar/' => array(
|
2015-05-05 12:51:32 -07:00
|
|
|
'(?:query/(?P<queryKey>[^/]+)/(?:(?P<year>\d+)/'.
|
|
|
|
'(?P<month>\d+)/)?(?:(?P<day>\d+)/)?)?'
|
2015-05-02 15:27:33 -07:00
|
|
|
=> 'PhabricatorCalendarEventListController',
|
2014-02-06 10:10:07 -08:00
|
|
|
'event/' => array(
|
2016-07-12 13:05:45 -07:00
|
|
|
$this->getEditRoutePattern('edit/')
|
2014-07-23 10:03:09 +10:00
|
|
|
=> 'PhabricatorCalendarEventEditController',
|
2015-05-23 19:47:23 -07:00
|
|
|
'drag/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarEventDragController',
|
Generate "stub" events earlier, so more infrastructure works with Calendar
Summary:
Ref T9275. When you create a recurring event which recurs forever, we want to avoid writing an infinite number of rows to the database.
Currently, we write a row to the database right before you edit the event. Until then, we refer to it as `E123/999` or whatever ("instance 999 of event 123").
This creates a big mess with trying to make recurring events work with EditEngine, Subscriptions, Projects, Flags, Tokens, etc -- all of this stuff assumes that whatever you're working with has a PHID.
I poked at letting this stuff work without a PHID a little bit, but that looked like a gigantic mess.
Instead, generate an event "stub" a little sooner (when you look at the event detail page). This is basically just an ID/PHID to refer to the instance.
Then, when you edit the stub, "materialize" it into a real event.
This still has some issues, but I think it's more promising than the other approach was.
Also:
- Removes dead user profile calendar controller.
- Replaces comments with EditEngine comments.
Test Plan:
- Commented on a recurring event.
- Awarded tokens to a recurring event.
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9275
Differential Revision: https://secure.phabricator.com/D16248
2016-07-07 07:19:58 -07:00
|
|
|
'cancel/(?P<id>[1-9]\d*)/'
|
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 08:39:39 -07:00
|
|
|
=> 'PhabricatorCalendarEventCancelController',
|
2015-04-29 19:48:46 -07:00
|
|
|
'(?P<action>join|decline|accept)/(?P<id>[1-9]\d*)/'
|
2015-04-29 18:18:27 -07:00
|
|
|
=> 'PhabricatorCalendarEventJoinController',
|
2016-09-15 06:27:20 -07:00
|
|
|
'export/(?P<id>[1-9]\d*)/(?P<filename>[^/]*)'
|
2016-09-14 17:16:54 -07:00
|
|
|
=> 'PhabricatorCalendarEventExportController',
|
2012-10-24 13:22:24 -07:00
|
|
|
),
|
2016-10-05 11:55:04 -07:00
|
|
|
'export/' => array(
|
|
|
|
$this->getQueryRoutePattern()
|
|
|
|
=> 'PhabricatorCalendarExportListController',
|
|
|
|
$this->getEditRoutePattern('edit/')
|
|
|
|
=> 'PhabricatorCalendarExportEditController',
|
|
|
|
'(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarExportViewController',
|
|
|
|
'ics/(?P<secretKey>[^/]+)/(?P<filename>[^/]*)'
|
|
|
|
=> 'PhabricatorCalendarExportICSController',
|
2016-10-06 14:57:43 -07:00
|
|
|
'disable/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarExportDisableController',
|
2016-10-11 11:45:57 -07:00
|
|
|
),
|
|
|
|
'import/' => array(
|
|
|
|
$this->getQueryRoutePattern()
|
|
|
|
=> 'PhabricatorCalendarImportListController',
|
|
|
|
$this->getEditRoutePattern('edit/')
|
|
|
|
=> 'PhabricatorCalendarImportEditController',
|
|
|
|
'(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarImportViewController',
|
|
|
|
'disable/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorCalendarImportDisableController',
|
2016-10-18 13:21:16 -07:00
|
|
|
'log/' => array(
|
|
|
|
$this->getQueryRoutePattern()
|
|
|
|
=> 'PhabricatorCalendarImportLogListController',
|
|
|
|
),
|
2016-10-05 11:55:04 -07:00
|
|
|
),
|
2012-10-24 13:22:24 -07:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-06-25 14:10:19 -07:00
|
|
|
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
|
|
|
|
return array(
|
|
|
|
array(
|
|
|
|
'name' => pht('Calendar User Guide'),
|
|
|
|
'href' => PhabricatorEnv::getDoclink('Calendar User Guide'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-05-01 13:26:07 -07: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.'),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2016-07-13 12:55:22 -07:00
|
|
|
protected function getCustomCapabilities() {
|
|
|
|
return array(
|
|
|
|
PhabricatorCalendarEventDefaultViewCapability::CAPABILITY => array(
|
|
|
|
'caption' => pht('Default view policy for newly created events.'),
|
|
|
|
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
|
|
|
|
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
|
|
|
|
),
|
|
|
|
PhabricatorCalendarEventDefaultEditCapability::CAPABILITY => array(
|
|
|
|
'caption' => pht('Default edit policy for newly created events.'),
|
|
|
|
'template' => PhabricatorCalendarEventPHIDType::TYPECONST,
|
|
|
|
'capability' => PhabricatorPolicyCapability::CAN_EDIT,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-10-24 13:22:24 -07:00
|
|
|
}
|