private function getLineForData($data) { $action = $data->getValue('action'); $actor_phid = $data->getAuthorPHID(); $actor_link = $this->linkTo($actor_phid); $task_phid = $data->getValue('taskPHID'); $task_link = $this->linkTo($task_phid); $owner_phid = $data->getValue('ownerPHID'); $owner_link = $this->linkTo($owner_phid); $verb = ManiphestAction::getActionPastTenseVerb($action); switch ($action) { case ManiphestAction::ACTION_ASSIGN: case ManiphestAction::ACTION_REASSIGN: if ($owner_phid) { if ($owner_phid == $actor_phid) { $one_line = "{$actor_link} claimed {$task_link}"; } else { $one_line = "{$actor_link} {$verb} {$task_link} to {$owner_link}"; } } else { $one_line = "{$actor_link} placed {$task_link} up for grabs"; } break; default: $one_line = "{$actor_link} {$verb} {$task_link}"; break; } return $one_line; }
public function renderView() { $data = $this->getStoryData(); $author_phid = $data->getAuthorPHID(); $owner_phid = $data->getValue('ownerPHID'); $task_phid = $data->getValue('taskPHID'); $objects = $this->getObjects(); $action = $data->getValue('action'); $view = new PhabricatorFeedStoryView(); $verb = ManiphestAction::getActionPastTenseVerb($action); $extra = null; switch ($action) { case ManiphestAction::ACTION_ASSIGN: if ($owner_phid) { $extra = ' to ' . '<strong>' . $this->getHandle($owner_phid)->renderLink() . '</strong>'; } else { $verb = 'placed'; $extra = ' up for grabs'; } break; } $title = '<strong>' . $this->getHandle($author_phid)->renderLink() . '</strong>' . " {$verb} task " . '<strong>' . $this->getHandle($task_phid)->renderLink() . '</strong>'; $title .= $extra; $title .= '.'; $view->setTitle($title); switch ($action) { case ManiphestAction::ACTION_CREATE: $full_size = true; break; default: $full_size = false; break; } $view->setEpoch($data->getEpoch()); if ($full_size) { if (!empty($objects[$author_phid])) { $image_phid = $objects[$author_phid]->getProfileImagePHID(); $image_uri = PhabricatorFileURI::getViewURIForPHID($image_phid); $view->setImage($image_uri); } $content = phutil_escape_html(phutil_utf8_shorten($data->getValue('description'), 128)); $content = str_replace("\n", '<br />', $content); $view->appendChild($content); } else { $view->setOneLineStory(true); } return $view; }
public function renderView() { $data = $this->getStoryData(); $author_phid = $data->getAuthorPHID(); $owner_phid = $data->getValue('ownerPHID'); $task_phid = $data->getValue('taskPHID'); $action = $data->getValue('action'); $view = new PhabricatorFeedStoryView(); $verb = ManiphestAction::getActionPastTenseVerb($action); $extra = null; switch ($action) { case ManiphestAction::ACTION_ASSIGN: if ($owner_phid) { $extra = ' to ' . $this->linkTo($owner_phid); } else { $verb = 'placed'; $extra = ' up for grabs'; } break; } $title = $this->linkTo($author_phid) . " {$verb} task " . $this->linkTo($task_phid); $title .= $extra; $title .= '.'; $view->setTitle($title); switch ($action) { case ManiphestAction::ACTION_CREATE: $full_size = true; break; default: $full_size = false; break; } $view->setEpoch($data->getEpoch()); if ($full_size) { $view->setImage($this->getHandle($author_phid)->getImageURI()); $content = $this->renderSummary($data->getValue('description')); $view->appendChild($content); } else { $view->setOneLineStory(true); } return $view; }