diff --git a/resources/sql/autopatches/20150507.calendar.1.isallday.sql b/resources/sql/autopatches/20150507.calendar.1.isallday.sql new file mode 100644 --- /dev/null +++ b/resources/sql/autopatches/20150507.calendar.1.isallday.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + ADD isAllDay BOOL NOT NULL; diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php --- a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php +++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php @@ -21,6 +21,7 @@ $types[] = PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION; $types[] = PhabricatorCalendarEventTransaction::TYPE_CANCEL; $types[] = PhabricatorCalendarEventTransaction::TYPE_INVITE; + $types[] = PhabricatorCalendarEventTransaction::TYPE_ALL_DAY; $types[] = PhabricatorTransactions::TYPE_COMMENT; $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; @@ -49,6 +50,8 @@ return $object->getDescription(); case PhabricatorCalendarEventTransaction::TYPE_CANCEL: return $object->getIsCancelled(); + case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY: + return $object->getIsAllDay(); case PhabricatorCalendarEventTransaction::TYPE_INVITE: $map = $xaction->getNewValue(); $phids = array_keys($map); @@ -86,6 +89,7 @@ case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION: case PhabricatorCalendarEventTransaction::TYPE_CANCEL: case PhabricatorCalendarEventTransaction::TYPE_INVITE: + case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY: return $xaction->getNewValue(); case PhabricatorCalendarEventTransaction::TYPE_STATUS: return (int)$xaction->getNewValue(); @@ -120,6 +124,9 @@ case PhabricatorCalendarEventTransaction::TYPE_CANCEL: $object->setIsCancelled((int)$xaction->getNewValue()); return; + case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY: + $object->setIsAllDay((int)$xaction->getNewValue()); + return; case PhabricatorCalendarEventTransaction::TYPE_INVITE: case PhabricatorTransactions::TYPE_COMMENT: case PhabricatorTransactions::TYPE_VIEW_POLICY: @@ -143,6 +150,7 @@ case PhabricatorCalendarEventTransaction::TYPE_STATUS: case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION: case PhabricatorCalendarEventTransaction::TYPE_CANCEL: + case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY: return; case PhabricatorCalendarEventTransaction::TYPE_INVITE: $map = $xaction->getNewValue(); diff --git a/src/applications/calendar/storage/PhabricatorCalendarEvent.php b/src/applications/calendar/storage/PhabricatorCalendarEvent.php --- a/src/applications/calendar/storage/PhabricatorCalendarEvent.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEvent.php @@ -17,6 +17,7 @@ protected $status; protected $description; protected $isCancelled; + protected $isAllDay; protected $mailKey; protected $viewPolicy; @@ -84,6 +85,7 @@ 'status' => 'uint32', 'description' => 'text', 'isCancelled' => 'bool', + 'isAllDay' => 'bool', 'mailKey' => 'bytes20', ), self::CONFIG_KEY_SCHEMA => array( diff --git a/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php b/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php --- a/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php +++ b/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php @@ -9,6 +9,7 @@ const TYPE_STATUS = 'calendar.status'; const TYPE_DESCRIPTION = 'calendar.description'; const TYPE_CANCEL = 'calendar.cancel'; + const TYPE_ALL_DAY = 'calendar.allday'; const TYPE_INVITE = 'calendar.invite'; const MAILTAG_RESCHEDULE = 'calendar-reschedule'; @@ -37,6 +38,7 @@ case self::TYPE_STATUS: case self::TYPE_DESCRIPTION: case self::TYPE_CANCEL: + case self::TYPE_ALL_DAY: $phids[] = $this->getObjectPHID(); break; case self::TYPE_INVITE: @@ -58,6 +60,7 @@ case self::TYPE_STATUS: case self::TYPE_DESCRIPTION: case self::TYPE_CANCEL: + case self::TYPE_ALL_DAY: case self::TYPE_INVITE: return ($old === null); } @@ -71,6 +74,7 @@ case self::TYPE_END_DATE: case self::TYPE_STATUS: case self::TYPE_DESCRIPTION: + case self::TYPE_ALL_DAY: case self::TYPE_CANCEL: return 'fa-pencil'; break;