diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php b/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php --- a/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventCancelController.php @@ -138,18 +138,54 @@ ->addSubmitButton($submit); if ($show_control) { + $start_time = phutil_tag( + 'strong', + array(), + phabricator_datetime($event->getStartDateTimeEpoch(), $viewer)); + + if ($is_cancelled) { + $this_name = pht('Reinstate Only This Event'); + $this_caption = pht( + 'Reinstate only the event which occurs on %s.', + $start_time); + + $future_name = pht('Reinstate This And All Later Events'); + $future_caption = pht( + 'Reinstate this event and all events in the series which occur '. + 'on or after %s.', + $start_time); + } else { + $this_name = pht('Cancel Only This Event'); + $this_caption = pht( + 'Cancel only the event which occurs on %s.', + $start_time); + + $future_name = pht('Cancel This And All Later Events'); + $future_caption = pht( + 'Cancel this event and all events in the series which occur '. + 'on or after %s.', + $start_time); + } + + $form = id(new AphrontFormView()) ->setViewer($viewer) ->appendControl( - id(new AphrontFormSelectControl()) - ->setLabel(pht('Cancel Events')) + id(new AphrontFormRadioButtonControl()) ->setName('mode') - ->setOptions( - array( - 'this' => pht('Only This Event'), - 'future' => pht('All Future Events'), - ))); - $dialog->appendForm($form); + ->setValue(PhabricatorCalendarEventEditEngine::MODE_THIS) + ->addButton( + PhabricatorCalendarEventEditEngine::MODE_THIS, + $this_name, + $this_caption) + ->addButton( + PhabricatorCalendarEventEditEngine::MODE_FUTURE, + $future_name, + $future_caption)); + + $dialog + ->setWidth(AphrontDialogView::WIDTH_FORM) + ->appendForm($form); } return $dialog; diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php --- a/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventEditController.php @@ -46,22 +46,34 @@ } if (!$mode) { + $start_time = phutil_tag( + 'strong', + array(), + phabricator_datetime($event->getStartDateTimeEpoch(), $viewer)); + $form = id(new AphrontFormView()) ->setViewer($viewer) ->appendControl( - id(new AphrontFormSelectControl()) - ->setLabel(pht('Edit Events')) + id(new AphrontFormRadioButtonControl()) ->setName('mode') - ->setOptions( - array( - PhabricatorCalendarEventEditEngine::MODE_THIS - => pht('Edit Only This Event'), - PhabricatorCalendarEventEditEngine::MODE_FUTURE - => pht('Edit All Future Events'), - ))); - + ->setValue(PhabricatorCalendarEventEditEngine::MODE_THIS) + ->addButton( + PhabricatorCalendarEventEditEngine::MODE_THIS, + pht('Edit Only This Event'), + pht( + 'Edit only the event which occurs at %s.', + $start_time)) + ->addButton( + PhabricatorCalendarEventEditEngine::MODE_FUTURE, + pht('Edit This And All Later Events'), + pht( + 'Edit this event and all events in the series which '. + 'occur on or after %s. This will overwrite previous '. + 'edits!', + $start_time))); return $this->newDialog() ->setTitle(pht('Edit Event')) + ->setWidth(AphrontDialogView::WIDTH_FORM) ->appendParagraph( pht( 'This event is part of a series. Which events do you '.