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

Remove "isCancelledEvent()" wrapper on Calendar Events

Summary: Ref T11804. The field now reads the correct value directly and we don't need this wrapper.

Test Plan: Poked around Calendar without explosions.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11804

Differential Revision: https://secure.phabricator.com/D16779
This commit is contained in:
epriestley 2016-10-31 13:42:10 -07:00
parent 91089acbe5
commit f44a9a4e48
4 changed files with 9 additions and 14 deletions

View file

@ -101,7 +101,7 @@ final class PhabricatorCalendarEventViewController
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$id = $event->getID(); $id = $event->getID();
if ($event->isCancelledEvent()) { if ($event->getIsCancelled()) {
$icon = 'fa-ban'; $icon = 'fa-ban';
$color = 'red'; $color = 'red';
$status = pht('Cancelled'); $status = pht('Cancelled');
@ -209,7 +209,7 @@ final class PhabricatorCalendarEventViewController
$cancel_label = pht('Cancel Event'); $cancel_label = pht('Cancel Event');
$reinstate_label = pht('Reinstate Event'); $reinstate_label = pht('Reinstate Event');
if ($event->isCancelledEvent()) { if ($event->getIsCancelled()) {
$curtain->addAction( $curtain->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName($reinstate_label) ->setName($reinstate_label)

View file

@ -41,7 +41,7 @@ final class PhabricatorCalendarEventPHIDType extends PhabricatorPHIDType {
->setFullName(pht('%s: %s', $monogram, $name)) ->setFullName(pht('%s: %s', $monogram, $name))
->setURI($uri); ->setURI($uri);
if ($event->isCancelledEvent()) { if ($event->getIsCancelled()) {
$handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED); $handle->setStatus(PhabricatorObjectHandle::STATUS_CLOSED);
} }
} }

View file

@ -303,7 +303,7 @@ final class PhabricatorCalendarEventSearchEngine
$item->addAttribute($event->renderEventDate($viewer, false)); $item->addAttribute($event->renderEventDate($viewer, false));
if ($event->isCancelledEvent()) { if ($event->getIsCancelled()) {
$item->setDisabled(true); $item->setDisabled(true);
} }
@ -368,7 +368,7 @@ final class PhabricatorCalendarEventSearchEngine
$event_view = id(new AphrontCalendarEventView()) $event_view = id(new AphrontCalendarEventView())
->setHostPHID($event->getHostPHID()) ->setHostPHID($event->getHostPHID())
->setEpochRange($epoch_min, $epoch_max) ->setEpochRange($epoch_min, $epoch_max)
->setIsCancelled($event->isCancelledEvent()) ->setIsCancelled($event->getIsCancelled())
->setName($event->getName()) ->setName($event->getName())
->setURI($event->getURI()) ->setURI($event->getURI())
->setIsAllDay($event->getIsAllDay()) ->setIsAllDay($event->getIsAllDay())
@ -441,7 +441,7 @@ final class PhabricatorCalendarEventSearchEngine
->setIconColor($status_color) ->setIconColor($status_color)
->setName($event->getName()) ->setName($event->getName())
->setURI($event->getURI()) ->setURI($event->getURI())
->setIsCancelled($event->isCancelledEvent()); ->setIsCancelled($event->getIsCancelled());
$day_view->addEvent($event_view); $day_view->addEvent($event_view);
} }

View file

@ -584,11 +584,6 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
return ($this->instanceOfEventPHID !== null); return ($this->instanceOfEventPHID !== null);
} }
public function isCancelledEvent() {
// TODO: Remove this wrapper.
return $this->getIsCancelled();
}
public function renderEventDate( public function renderEventDate(
PhabricatorUser $viewer, PhabricatorUser $viewer,
$show_end) { $show_end) {
@ -641,7 +636,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
public function getDisplayIcon(PhabricatorUser $viewer) { public function getDisplayIcon(PhabricatorUser $viewer) {
if ($this->isCancelledEvent()) { if ($this->getIsCancelled()) {
return 'fa-times'; return 'fa-times';
} }
@ -665,7 +660,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
} }
public function getDisplayIconColor(PhabricatorUser $viewer) { public function getDisplayIconColor(PhabricatorUser $viewer) {
if ($this->isCancelledEvent()) { if ($this->getIsCancelled()) {
return 'red'; return 'red';
} }
@ -689,7 +684,7 @@ final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO
} }
public function getDisplayIconLabel(PhabricatorUser $viewer) { public function getDisplayIconLabel(PhabricatorUser $viewer) {
if ($this->isCancelledEvent()) { if ($this->getIsCancelled()) {
return pht('Cancelled'); return pht('Cancelled');
} }