Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/editengine/PhabricatorEditEngine.php
| Show First 20 Lines • Show All 1,025 Lines • ▼ Show 20 Lines | if (!$configs) { | ||||
| $create_uri = $this->getEditURI(null, 'nocreate/'); | $create_uri = $this->getEditURI(null, 'nocreate/'); | ||||
| } | } | ||||
| } else { | } else { | ||||
| $config = head($configs); | $config = head($configs); | ||||
| $form_key = $config->getIdentifier(); | $form_key = $config->getIdentifier(); | ||||
| $create_uri = $this->getEditURI(null, "form/{$form_key}/"); | $create_uri = $this->getEditURI(null, "form/{$form_key}/"); | ||||
| if (count($configs) > 1) { | if (count($configs) > 1) { | ||||
| $configs = msort($configs, 'getDisplayName'); | |||||
| $menu_icon = 'fa-caret-square-o-down'; | $menu_icon = 'fa-caret-square-o-down'; | ||||
| $dropdown = id(new PhabricatorActionListView()) | $dropdown = id(new PhabricatorActionListView()) | ||||
| ->setUser($viewer); | ->setUser($viewer); | ||||
| foreach ($configs as $config) { | foreach ($configs as $config) { | ||||
| $form_key = $config->getIdentifier(); | $form_key = $config->getIdentifier(); | ||||
| $config_uri = $this->getEditURI(null, "form/{$form_key}/"); | $config_uri = $this->getEditURI(null, "form/{$form_key}/"); | ||||
| Show All 19 Lines | final public function addActionToCrumbs(PHUICrumbsView $crumbs) { | ||||
| if ($dropdown) { | if ($dropdown) { | ||||
| $action->setDropdownMenu($dropdown); | $action->setDropdownMenu($dropdown); | ||||
| } | } | ||||
| $crumbs->addAction($action); | $crumbs->addAction($action); | ||||
| } | } | ||||
| final public function buildEditEngineCommentView($object) { | final public function buildEditEngineCommentView($object) { | ||||
| $config = $this->loadDefaultConfiguration(); | $config = $this->loadDefaultEditConfiguration(); | ||||
| if (!$config) { | |||||
| // TODO: This just nukes the entire comment form if you don't have access | |||||
| // to any edit forms. We might want to tailor this UX a bit. | |||||
| return id(new PhabricatorApplicationTransactionCommentView()) | |||||
| ->setNoPermission(true); | |||||
| } | |||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $object_phid = $object->getPHID(); | $object_phid = $object->getPHID(); | ||||
| $header_text = $this->getCommentViewHeaderText($object); | $header_text = $this->getCommentViewHeaderText($object); | ||||
| $button_text = $this->getCommentViewButtonText($object); | $button_text = $this->getCommentViewButtonText($object); | ||||
| $comment_uri = $this->getEditURI($object, 'comment/'); | $comment_uri = $this->getEditURI($object, 'comment/'); | ||||
| ▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | private function buildCommentResponse($object) { | ||||
| $controller = $this->getController(); | $controller = $this->getController(); | ||||
| $request = $controller->getRequest(); | $request = $controller->getRequest(); | ||||
| if (!$request->isFormPost()) { | if (!$request->isFormPost()) { | ||||
| return new Aphront400Response(); | return new Aphront400Response(); | ||||
| } | } | ||||
| $config = $this->loadDefaultConfiguration(); | $config = $this->loadDefaultEditConfiguration(); | ||||
| if (!$config) { | |||||
| return new Aphront404Response(); | |||||
| } | |||||
| $fields = $this->buildEditFields($object); | $fields = $this->buildEditFields($object); | ||||
| $is_preview = $request->isPreviewRequest(); | $is_preview = $request->isPreviewRequest(); | ||||
| $view_uri = $this->getObjectViewURI($object); | $view_uri = $this->getObjectViewURI($object); | ||||
| $template = $object->getApplicationTransactionTemplate(); | $template = $object->getApplicationTransactionTemplate(); | ||||
| $comment_template = $template->getApplicationTransactionCommentObject(); | $comment_template = $template->getApplicationTransactionCommentObject(); | ||||
| ▲ Show 20 Lines • Show All 406 Lines • Show Last 20 Lines | |||||