1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Edit link of an exception to a ghost event should not create new event

Summary: Fixes T8382, Edit link of an exception to a ghost event should not create new event

Test Plan: Create recurring event, open ghost, edit, save, edit again. Should edit event created after first edit, not new event.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8382

Differential Revision: https://secure.phabricator.com/D13108
This commit is contained in:
lkassianik 2015-06-02 07:29:48 -07:00
parent bf81fda036
commit b576cef710

View file

@ -135,24 +135,27 @@ final class PhabricatorCalendarEventViewController
$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));
}