Path: blob/master/src/applications/differential/customfield/DifferentialTestPlanField.php
12256 views
<?php12final class DifferentialTestPlanField3extends DifferentialCoreCustomField {45public function getFieldKey() {6return 'differential:test-plan';7}89public function getFieldName() {10return pht('Test Plan');11}1213public function getFieldDescription() {14return pht('Actions performed to verify the behavior of the change.');15}1617protected function readValueFromRevision(18DifferentialRevision $revision) {19if (!$revision->getID()) {20return null;21}22return $revision->getTestPlan();23}2425public function canDisableField() {26return true;27}2829public function shouldAppearInGlobalSearch() {30return true;31}3233public function updateAbstractDocument(34PhabricatorSearchAbstractDocument $document) {35if (strlen($this->getValue())) {36$document->addField('plan', $this->getValue());37}38}3940public function shouldAppearInPropertyView() {41return true;42}4344public function renderPropertyViewLabel() {45return $this->getFieldName();46}4748public function getStyleForPropertyView() {49return 'block';50}5152public function getIconForPropertyView() {53return PHUIPropertyListView::ICON_TESTPLAN;54}5556public function renderPropertyViewValue(array $handles) {57if (!strlen($this->getValue())) {58return null;59}6061return new PHUIRemarkupView($this->getViewer(), $this->getValue());62}6364public function shouldAppearInTransactionMail() {65return true;66}6768public function updateTransactionMailBody(69PhabricatorMetaMTAMailBody $body,70PhabricatorApplicationTransactionEditor $editor,71array $xactions) {7273if (!$editor->isFirstBroadcast()) {74return;75}7677$test_plan = $this->getValue();78if (!strlen(trim($test_plan))) {79return;80}8182$body->addRemarkupSection(pht('TEST PLAN'), $test_plan);83}848586}878889