1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Remove obsolete Calendar event date storage fields

Summary: Ref T11809. These have been replaced with more flexible storage that accommodates a wider range of behaviors, including those in the ICS format and RRULEs.

Test Plan:
  - Ran migration.
  - Viewed, created, edited events.
  - Grepped for all removed names/symbols.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11809

Differential Revision: https://secure.phabricator.com/D16789
This commit is contained in:
epriestley 2016-11-01 16:27:05 -07:00
parent 6982bded71
commit 3f2f81a1c8
5 changed files with 21 additions and 91 deletions

View file

@ -384,7 +384,6 @@ return array(
'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443', 'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443',
'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9', 'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9',
'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256', 'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256',
'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f',
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '358c717b', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '358c717b',
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
@ -704,7 +703,6 @@ return array(
'javelin-behavior-project-create' => '065227cc', 'javelin-behavior-project-create' => '065227cc',
'javelin-behavior-quicksand-blacklist' => '7927a7d3', 'javelin-behavior-quicksand-blacklist' => '7927a7d3',
'javelin-behavior-read-only-warning' => 'ba158207', 'javelin-behavior-read-only-warning' => 'ba158207',
'javelin-behavior-recurring-edit' => '5f1c4d5f',
'javelin-behavior-refresh-csrf' => 'ab2f381b', 'javelin-behavior-refresh-csrf' => 'ab2f381b',
'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf', 'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf',
'javelin-behavior-releeph-request-state-change' => 'a0b57eb8', 'javelin-behavior-releeph-request-state-change' => 'a0b57eb8',

View file

@ -0,0 +1,17 @@
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP allDayDateFrom;
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP allDayDateTo;
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP dateFrom;
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP dateTo;
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP recurrenceEndDate;
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
DROP recurrenceFrequency;

View file

@ -52,14 +52,6 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
private $viewerTimezone; private $viewerTimezone;
// TODO: DEPRECATED. Remove once we're sure the migrations worked.
protected $allDayDateFrom;
protected $allDayDateTo;
protected $dateFrom;
protected $dateTo;
protected $recurrenceEndDate;
protected $recurrenceFrequency = array();
private $isGhostEvent = false; private $isGhostEvent = false;
private $stubInvitees; private $stubInvitees;
@ -95,10 +87,6 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->setEditPolicy($edit_policy) ->setEditPolicy($edit_policy)
->setSpacePHID($actor->getDefaultSpacePHID()) ->setSpacePHID($actor->getDefaultSpacePHID())
->attachInvitees(array()) ->attachInvitees(array())
->setDateFrom(0)
->setDateTo(0)
->setAllDayDateFrom(0)
->setAllDayDateTo(0)
->setStartDateTime($datetime_start) ->setStartDateTime($datetime_start)
->setEndDateTime($datetime_end) ->setEndDateTime($datetime_end)
->attachImportSource(null) ->attachImportSource(null)
@ -154,11 +142,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
->setSequenceIndex($sequence) ->setSequenceIndex($sequence)
->setIsRecurring(true) ->setIsRecurring(true)
->attachParentEvent($this) ->attachParentEvent($this)
->attachImportSource(null) ->attachImportSource(null);
->setAllDayDateFrom(0)
->setAllDayDateTo(0)
->setDateFrom(0)
->setDateTo(0);
return $child->copyFromParent($actor, $start); return $child->copyFromParent($actor, $start);
} }
@ -421,18 +405,8 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
'importSourcePHID' => 'phid?', 'importSourcePHID' => 'phid?',
'importUIDIndex' => 'bytes12?', 'importUIDIndex' => 'bytes12?',
'importUID' => 'text?', 'importUID' => 'text?',
// TODO: DEPRECATED.
'allDayDateFrom' => 'epoch',
'allDayDateTo' => 'epoch',
'dateFrom' => 'epoch',
'dateTo' => 'epoch',
'recurrenceEndDate' => 'epoch?',
), ),
self::CONFIG_KEY_SCHEMA => array( self::CONFIG_KEY_SCHEMA => array(
'key_date' => array(
'columns' => array('dateFrom', 'dateTo'),
),
'key_instance' => array( 'key_instance' => array(
'columns' => array('instanceOfEventPHID', 'sequenceIndex'), 'columns' => array('instanceOfEventPHID', 'sequenceIndex'),
'unique' => true, 'unique' => true,
@ -449,7 +423,6 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
), ),
), ),
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'recurrenceFrequency' => self::SERIALIZATION_JSON,
'parameters' => self::SERIALIZATION_JSON, 'parameters' => self::SERIALIZATION_JSON,
), ),
) + parent::getConfiguration(); ) + parent::getConfiguration();
@ -845,12 +818,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
public function newStartDateTime() { public function newStartDateTime() {
$datetime = $this->getParameter('startDateTime'); $datetime = $this->getParameter('startDateTime');
if ($datetime) { return $this->newDateTimeFromDictionary($datetime);
return $this->newDateTimeFromDictionary($datetime);
}
$epoch = $this->getDateFrom();
return $this->newDateTimeFromEpoch($epoch);
} }
public function getStartDateTimeEpoch() { public function getStartDateTimeEpoch() {
@ -859,12 +827,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
public function newEndDateTimeForEdit() { public function newEndDateTimeForEdit() {
$datetime = $this->getParameter('endDateTime'); $datetime = $this->getParameter('endDateTime');
if ($datetime) { return $this->newDateTimeFromDictionary($datetime);
return $this->newDateTimeFromDictionary($datetime);
}
$epoch = $this->getDateTo();
return $this->newDateTimeFromEpoch($epoch);
} }
public function newEndDateTime() { public function newEndDateTime() {
@ -896,11 +859,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
return $this->newDateTimeFromDictionary($datetime); return $this->newDateTimeFromDictionary($datetime);
} }
$epoch = $this->getRecurrenceEndDate(); return null;
if (!$epoch) {
return null;
}
return $this->newDateTimeFromEpoch($epoch);
} }
public function getUntilDateTimeEpoch() { public function getUntilDateTimeEpoch() {

View file

@ -18,9 +18,6 @@ final class PhabricatorCalendarEventUntilDateTransaction
$actor = $this->getActor(); $actor = $this->getActor();
$editor = $this->getEditor(); $editor = $this->getEditor();
// TODO: DEPRECATED.
$object->setRecurrenceEndDate($value);
$datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value); $datetime = PhutilCalendarAbsoluteDateTime::newFromDictionary($value);
$datetime->setIsAllDay($editor->getNewIsAllDay()); $datetime->setIsAllDay($editor->getNewIsAllDay());

View file

@ -1,41 +0,0 @@
/**
* @provides javelin-behavior-recurring-edit
*/
JX.behavior('recurring-edit', function(config) {
var checkbox = JX.$(config.isRecurring);
var frequency = JX.$(config.frequency);
var end_date = JX.$(config.recurrenceEndDate);
var end_date_checkbox = JX.DOM.find(end_date, 'input', 'calendar-enable');
JX.DOM.listen(checkbox, 'change', null, function() {
if (checkbox.checked) {
enableRecurring();
} else {
disableRecurring();
}
});
JX.DOM.listen(end_date, 'change', null, function() {
if (end_date_checkbox.checked) {
enableRecurring();
}
});
function enableRecurring() {
checkbox.checked = true;
frequency.disabled = false;
end_date.disabled = false;
}
function disableRecurring() {
checkbox.checked = false;
frequency.disabled = true;
end_date.disabled = true;
end_date_checkbox.checked = false;
JX.DOM.alterClass(end_date, 'datepicker-disabled', true);
}
});