Both ghost instances and exceptions to generated ghosts should be editable
Summary: Fixes T8369, Both ghost instances and exceptions to generated ghosts should be editable Test Plan: Create recurring event, open /E{id}/1, edit, save. New exception should not be "recurring", and should be editable, as the regular ghost events. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8369 Differential Revision: https://secure.phabricator.com/D13089
This commit is contained in:
parent
9c5d9e3f47
commit
bb92819c09
|
@ -203,6 +203,7 @@ final class PhabricatorCalendarEventEditController
|
||||||
PhabricatorCalendarEventTransaction::TYPE_NAME)
|
PhabricatorCalendarEventTransaction::TYPE_NAME)
|
||||||
->setNewValue($name);
|
->setNewValue($name);
|
||||||
|
|
||||||
|
if ($this->isCreate()) {
|
||||||
$xactions[] = id(new PhabricatorCalendarEventTransaction())
|
$xactions[] = id(new PhabricatorCalendarEventTransaction())
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
PhabricatorCalendarEventTransaction::TYPE_RECURRING)
|
PhabricatorCalendarEventTransaction::TYPE_RECURRING)
|
||||||
|
@ -212,6 +213,7 @@ final class PhabricatorCalendarEventEditController
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
PhabricatorCalendarEventTransaction::TYPE_FREQUENCY)
|
PhabricatorCalendarEventTransaction::TYPE_FREQUENCY)
|
||||||
->setNewValue(array('rule' => $frequency));
|
->setNewValue(array('rule' => $frequency));
|
||||||
|
}
|
||||||
|
|
||||||
$xactions[] = id(new PhabricatorCalendarEventTransaction())
|
$xactions[] = id(new PhabricatorCalendarEventTransaction())
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
|
@ -294,12 +296,16 @@ final class PhabricatorCalendarEventEditController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$is_recurring_checkbox = null;
|
||||||
|
$recurrence_frequency_select = null;
|
||||||
|
|
||||||
$name = id(new AphrontFormTextControl())
|
$name = id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Name'))
|
->setLabel(pht('Name'))
|
||||||
->setName('name')
|
->setName('name')
|
||||||
->setValue($name)
|
->setValue($name)
|
||||||
->setError($error_name);
|
->setError($error_name);
|
||||||
|
|
||||||
|
if ($this->isCreate()) {
|
||||||
Javelin::initBehavior('recurring-edit', array(
|
Javelin::initBehavior('recurring-edit', array(
|
||||||
'isRecurring' => $is_recurring_id,
|
'isRecurring' => $is_recurring_id,
|
||||||
'frequency' => $frequency_id,
|
'frequency' => $frequency_id,
|
||||||
|
@ -325,6 +331,7 @@ final class PhabricatorCalendarEventEditController
|
||||||
->setLabel(pht('Recurring Event Frequency'))
|
->setLabel(pht('Recurring Event Frequency'))
|
||||||
->setID($frequency_id)
|
->setID($frequency_id)
|
||||||
->setDisabled(!$is_recurring);
|
->setDisabled(!$is_recurring);
|
||||||
|
}
|
||||||
|
|
||||||
Javelin::initBehavior('event-all-day', array(
|
Javelin::initBehavior('event-all-day', array(
|
||||||
'allDayID' => $all_day_id,
|
'allDayID' => $all_day_id,
|
||||||
|
@ -409,9 +416,16 @@ final class PhabricatorCalendarEventEditController
|
||||||
->addHiddenInput('next', $next_workflow)
|
->addHiddenInput('next', $next_workflow)
|
||||||
->addHiddenInput('query', $uri_query)
|
->addHiddenInput('query', $uri_query)
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->appendChild($name)
|
->appendChild($name);
|
||||||
->appendChild($is_recurring_checkbox)
|
|
||||||
->appendChild($recurrence_frequency_select)
|
if ($is_recurring_checkbox) {
|
||||||
|
$form->appendChild($is_recurring_checkbox);
|
||||||
|
}
|
||||||
|
if ($recurrence_frequency_select) {
|
||||||
|
$form->appendControl($recurrence_frequency_select);
|
||||||
|
}
|
||||||
|
|
||||||
|
$form
|
||||||
->appendChild($all_day_checkbox)
|
->appendChild($all_day_checkbox)
|
||||||
->appendChild($start_control)
|
->appendChild($start_control)
|
||||||
->appendChild($end_control)
|
->appendChild($end_control)
|
||||||
|
|
|
@ -135,7 +135,7 @@ final class PhabricatorCalendarEventViewController
|
||||||
$event,
|
$event,
|
||||||
PhabricatorPolicyCapability::CAN_EDIT);
|
PhabricatorPolicyCapability::CAN_EDIT);
|
||||||
|
|
||||||
if (($event->getIsRecurring() && $event->getIsGhostEvent())) {
|
if ($event->getIsRecurring() && $event->getIsGhostEvent()) {
|
||||||
$index = $event->getSequenceIndex();
|
$index = $event->getSequenceIndex();
|
||||||
|
|
||||||
$actions->addAction(
|
$actions->addAction(
|
||||||
|
|
|
@ -279,6 +279,9 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
|
||||||
$frequency = $this->getFrequencyUnit();
|
$frequency = $this->getFrequencyUnit();
|
||||||
$modify_key = '+'.$sequence_index.' '.$frequency;
|
$modify_key = '+'.$sequence_index.' '.$frequency;
|
||||||
|
|
||||||
|
$instance_of = ($this->getPHID()) ?
|
||||||
|
$this->getPHID() : $this->instanceOfEventPHID;
|
||||||
|
|
||||||
$date = $this->dateFrom;
|
$date = $this->dateFrom;
|
||||||
$date_time = PhabricatorTime::getDateTimeFromEpoch($date, $actor);
|
$date_time = PhabricatorTime::getDateTimeFromEpoch($date, $actor);
|
||||||
$date_time->modify($modify_key);
|
$date_time->modify($modify_key);
|
||||||
|
@ -294,7 +297,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
|
||||||
->setDateTo($date + $duration)
|
->setDateTo($date + $duration)
|
||||||
->setIsRecurring(true)
|
->setIsRecurring(true)
|
||||||
->setRecurrenceFrequency($this->recurrenceFrequency)
|
->setRecurrenceFrequency($this->recurrenceFrequency)
|
||||||
->setInstanceOfEventPHID($this->getPHID())
|
->setInstanceOfEventPHID($instance_of)
|
||||||
->setSequenceIndex($sequence_index)
|
->setSequenceIndex($sequence_index)
|
||||||
->setEditPolicy($edit_policy);
|
->setEditPolicy($edit_policy);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue