Page MenuHomePhabricator

D13108.id31671.diff
No OneTemporary

D13108.id31671.diff

diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
--- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
+++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
@@ -135,24 +135,27 @@
$event,
PhabricatorPolicyCapability::CAN_EDIT);
- if ($event->getIsRecurring() && $event->getInstanceOfEventPHID()) {
- $index = $event->getSequenceIndex();
+ $edit_label = false;
+ $edit_uri = false;
- $actions->addAction(
- id(new PhabricatorActionView())
- ->setName(pht('Edit This Instance'))
- ->setIcon('fa-pencil')
- ->setHref($this->getApplicationURI("event/edit/{$id}/{$index}/"))
- ->setDisabled(!$can_edit)
- ->setWorkflow(!$can_edit));
+ if ($event->getIsGhostEvent()) {
+ $index = $event->getSequenceIndex();
+ $edit_label = pht('Edit This Instance');
+ $edit_uri = "event/edit/{$id}/{$index}/";
+ } else if ($event->getInstanceOfEventPHID() && !$event->getIsGhostEvent()) {
+ $edit_label = pht('Edit This Instance');
+ $edit_uri = "event/edit/{$id}/";
+ } else if (!$event->getIsRecurring()) {
+ $edit_label = pht('Edit');
+ $edit_uri = "event/edit/{$id}/";
}
- if (!$event->getIsRecurring() && !$event->getIsGhostEvent()) {
+ if ($edit_label && $edit_uri) {
$actions->addAction(
id(new PhabricatorActionView())
- ->setName(pht('Edit Event'))
+ ->setName($edit_label)
->setIcon('fa-pencil')
- ->setHref($this->getApplicationURI("event/edit/{$id}/"))
+ ->setHref($this->getApplicationURI($edit_uri))
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit));
}

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 17, 12:57 AM (4 w, 37 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719918
Default Alt Text
D13108.id31671.diff (1 KB)

Event Timeline