1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Just a sql patch for all day events.

Summary: Ref T8021, sql patch for all day events.

Test Plan: check schema by running `bin/storage upgrade`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T8021

Differential Revision: https://secure.phabricator.com/D12763
This commit is contained in:
lkassianik 2015-05-07 16:57:49 -07:00
parent 33e7038b96
commit 57e22e3ce5
4 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_calendar.calendar_event
ADD isAllDay BOOL NOT NULL;

View file

@ -21,6 +21,7 @@ final class PhabricatorCalendarEventEditor
$types[] = PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION; $types[] = PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION;
$types[] = PhabricatorCalendarEventTransaction::TYPE_CANCEL; $types[] = PhabricatorCalendarEventTransaction::TYPE_CANCEL;
$types[] = PhabricatorCalendarEventTransaction::TYPE_INVITE; $types[] = PhabricatorCalendarEventTransaction::TYPE_INVITE;
$types[] = PhabricatorCalendarEventTransaction::TYPE_ALL_DAY;
$types[] = PhabricatorTransactions::TYPE_COMMENT; $types[] = PhabricatorTransactions::TYPE_COMMENT;
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
@ -49,6 +50,8 @@ final class PhabricatorCalendarEventEditor
return $object->getDescription(); return $object->getDescription();
case PhabricatorCalendarEventTransaction::TYPE_CANCEL: case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
return $object->getIsCancelled(); return $object->getIsCancelled();
case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY:
return $object->getIsAllDay();
case PhabricatorCalendarEventTransaction::TYPE_INVITE: case PhabricatorCalendarEventTransaction::TYPE_INVITE:
$map = $xaction->getNewValue(); $map = $xaction->getNewValue();
$phids = array_keys($map); $phids = array_keys($map);
@ -86,6 +89,7 @@ final class PhabricatorCalendarEventEditor
case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION: case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION:
case PhabricatorCalendarEventTransaction::TYPE_CANCEL: case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
case PhabricatorCalendarEventTransaction::TYPE_INVITE: case PhabricatorCalendarEventTransaction::TYPE_INVITE:
case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY:
return $xaction->getNewValue(); return $xaction->getNewValue();
case PhabricatorCalendarEventTransaction::TYPE_STATUS: case PhabricatorCalendarEventTransaction::TYPE_STATUS:
return (int)$xaction->getNewValue(); return (int)$xaction->getNewValue();
@ -120,6 +124,9 @@ final class PhabricatorCalendarEventEditor
case PhabricatorCalendarEventTransaction::TYPE_CANCEL: case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
$object->setIsCancelled((int)$xaction->getNewValue()); $object->setIsCancelled((int)$xaction->getNewValue());
return; return;
case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY:
$object->setIsAllDay((int)$xaction->getNewValue());
return;
case PhabricatorCalendarEventTransaction::TYPE_INVITE: case PhabricatorCalendarEventTransaction::TYPE_INVITE:
case PhabricatorTransactions::TYPE_COMMENT: case PhabricatorTransactions::TYPE_COMMENT:
case PhabricatorTransactions::TYPE_VIEW_POLICY: case PhabricatorTransactions::TYPE_VIEW_POLICY:
@ -143,6 +150,7 @@ final class PhabricatorCalendarEventEditor
case PhabricatorCalendarEventTransaction::TYPE_STATUS: case PhabricatorCalendarEventTransaction::TYPE_STATUS:
case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION: case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION:
case PhabricatorCalendarEventTransaction::TYPE_CANCEL: case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY:
return; return;
case PhabricatorCalendarEventTransaction::TYPE_INVITE: case PhabricatorCalendarEventTransaction::TYPE_INVITE:
$map = $xaction->getNewValue(); $map = $xaction->getNewValue();

View file

@ -17,6 +17,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
protected $status; protected $status;
protected $description; protected $description;
protected $isCancelled; protected $isCancelled;
protected $isAllDay;
protected $mailKey; protected $mailKey;
protected $viewPolicy; protected $viewPolicy;
@ -84,6 +85,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
'status' => 'uint32', 'status' => 'uint32',
'description' => 'text', 'description' => 'text',
'isCancelled' => 'bool', 'isCancelled' => 'bool',
'isAllDay' => 'bool',
'mailKey' => 'bytes20', 'mailKey' => 'bytes20',
), ),
self::CONFIG_KEY_SCHEMA => array( self::CONFIG_KEY_SCHEMA => array(

View file

@ -9,6 +9,7 @@ final class PhabricatorCalendarEventTransaction
const TYPE_STATUS = 'calendar.status'; const TYPE_STATUS = 'calendar.status';
const TYPE_DESCRIPTION = 'calendar.description'; const TYPE_DESCRIPTION = 'calendar.description';
const TYPE_CANCEL = 'calendar.cancel'; const TYPE_CANCEL = 'calendar.cancel';
const TYPE_ALL_DAY = 'calendar.allday';
const TYPE_INVITE = 'calendar.invite'; const TYPE_INVITE = 'calendar.invite';
const MAILTAG_RESCHEDULE = 'calendar-reschedule'; const MAILTAG_RESCHEDULE = 'calendar-reschedule';
@ -37,6 +38,7 @@ final class PhabricatorCalendarEventTransaction
case self::TYPE_STATUS: case self::TYPE_STATUS:
case self::TYPE_DESCRIPTION: case self::TYPE_DESCRIPTION:
case self::TYPE_CANCEL: case self::TYPE_CANCEL:
case self::TYPE_ALL_DAY:
$phids[] = $this->getObjectPHID(); $phids[] = $this->getObjectPHID();
break; break;
case self::TYPE_INVITE: case self::TYPE_INVITE:
@ -58,6 +60,7 @@ final class PhabricatorCalendarEventTransaction
case self::TYPE_STATUS: case self::TYPE_STATUS:
case self::TYPE_DESCRIPTION: case self::TYPE_DESCRIPTION:
case self::TYPE_CANCEL: case self::TYPE_CANCEL:
case self::TYPE_ALL_DAY:
case self::TYPE_INVITE: case self::TYPE_INVITE:
return ($old === null); return ($old === null);
} }
@ -71,6 +74,7 @@ final class PhabricatorCalendarEventTransaction
case self::TYPE_END_DATE: case self::TYPE_END_DATE:
case self::TYPE_STATUS: case self::TYPE_STATUS:
case self::TYPE_DESCRIPTION: case self::TYPE_DESCRIPTION:
case self::TYPE_ALL_DAY:
case self::TYPE_CANCEL: case self::TYPE_CANCEL:
return 'fa-pencil'; return 'fa-pencil';
break; break;