1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-18 18:51:12 +01:00

Make the modal choice between "Edit This Event" and "Edit Future Events" more clear

Summary:
Fixes T11909. Ref T11816. Instead of offering a dropdown with choices between "Edit/Cancel/Reinstate This Event" and "Edit/Cancel/Reinstate Future Events", make the choice more explicit.

This dialog ends up pretty wordy but this edit is rare, so I think that's alright.

Test Plan: {F2046863}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11816, T11909

Differential Revision: https://secure.phabricator.com/D16956
This commit is contained in:
epriestley 2016-11-28 09:44:35 -08:00
parent 22a566f732
commit 5cc4f6407c
2 changed files with 66 additions and 18 deletions

View file

@ -138,18 +138,54 @@ final class PhabricatorCalendarEventCancelController
->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;

View file

@ -46,22 +46,34 @@ final class PhabricatorCalendarEventEditController
}
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 '.