1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-15 03:12:41 +01:00
phorge-phorge/src/applications/transactions/editfield/PhabricatorEpochEditField.php
epriestley e5256bd815 Hide time controls when editing all-day Calendar events
Summary:
Ref T11326. When an event is all-day, hide the time controls for the start/end dates. These aren't used and aren't helpful/useful.

This got a little more complicated than it used to be because EditEngine forms may have only some of these controls present.

Test Plan: Edited an all-day event; edited a normal event; swapped an event between normal and all-day.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11326

Differential Revision: https://secure.phabricator.com/D16327
2016-07-27 05:01:19 -07:00

43 lines
928 B
PHP

<?php
final class PhabricatorEpochEditField
extends PhabricatorEditField {
private $allowNull;
private $hideTime;
public function setAllowNull($allow_null) {
$this->allowNull = $allow_null;
return $this;
}
public function getAllowNull() {
return $this->allowNull;
}
public function setHideTime($hide_time) {
$this->hideTime = $hide_time;
return $this;
}
public function getHideTime() {
return $this->hideTime;
}
protected function newControl() {
return id(new AphrontFormDateControl())
->setAllowNull($this->getAllowNull())
->setIsTimeDisabled($this->getHideTime())
->setViewer($this->getViewer());
}
protected function newHTTPParameterType() {
return id(new AphrontEpochHTTPParameterType())
->setAllowNull($this->getAllowNull());
}
protected function newConduitParameterType() {
return new ConduitEpochParameterType();
}
}