<?php

final class PhabricatorCalendarEventAllDayTransaction
  extends PhabricatorCalendarEventTransactionType {

  const TRANSACTIONTYPE = 'calendar.allday';

  public function generateOldValue($object) {
    return (int)$object->getIsAllDay();
  }

  public function generateNewValue($object, $value) {
    return (int)$value;
  }

  public function applyInternalEffects($object, $value) {
    $object->setIsAllDay($value);
  }

  public function getTitle() {
    if ($this->getNewValue()) {
      return pht(
        '%s changed this as an all day event.',
        $this->renderAuthor());
    } else {
      return pht(
        '%s conveted this from an all day event.',
        $this->renderAuthor());
    }
  }

  public function getTitleForFeed() {
    if ($this->getNewValue()) {
      return pht(
        '%s changed %s to an all day event.',
        $this->renderAuthor(),
        $this->renderObject());
    } else {
      return pht(
        '%s converted %s from an all day event.',
        $this->renderAuthor(),
        $this->renderObject());
    }
  }

}

<?php

final class PhabricatorCalendarEventAllDayTransaction
  extends PhabricatorCalendarEventTransactionType {

  const TRANSACTIONTYPE = 'calendar.allday';

  public function generateOldValue($object) {
    return (int)$object->getIsAllDay();
  }

  public function generateNewValue($object, $value) {
    return (int)$value;
  }

  public function applyInternalEffects($object, $value) {
    $object->setIsAllDay($value);
  }

  public function getTitle() {
    if ($this->getNewValue()) {
      return pht(
        '%s changed this as an all day event.',
        $this->renderAuthor());
    } else {
      return pht(
        '%s converted this from an all day event.',
        $this->renderAuthor());
    }
  }

  public function getTitleForFeed() {
    if ($this->getNewValue()) {
      return pht(
        '%s changed %s to an all day event.',
        $this->renderAuthor(),
        $this->renderObject());
    } else {
      return pht(
        '%s converted %s from an all day event.',
        $this->renderAuthor(),
        $this->renderObject());
    }
  }

}

Fix typo at calendar transaction
Fix typo at calendar transaction

Summary:
* Fixed conveted => converted
Ref T11576

Test Plan: * Looked at a page, where somebody converted an AllDay Event to a normal one

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Tags: #calendar

Maniphest Tasks: T11576

Differential Revision: https://secure.phabricator.com/D16488
