Differential D17675 Diff 42512 src/applications/conpherence/controller/ConpherenceViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceViewController.php
| Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | if ($request->isAjax()) { | ||||
| PhabricatorPolicyCapability::CAN_EDIT); | PhabricatorPolicyCapability::CAN_EDIT); | ||||
| $content['aphlictDropdownData'] = array( | $content['aphlictDropdownData'] = array( | ||||
| $dropdown_query->getNotificationData(), | $dropdown_query->getNotificationData(), | ||||
| $dropdown_query->getConpherenceData(), | $dropdown_query->getConpherenceData(), | ||||
| ); | ); | ||||
| return id(new AphrontAjaxResponse())->setContent($content); | return id(new AphrontAjaxResponse())->setContent($content); | ||||
| } | } | ||||
| $can_join = PhabricatorPolicyFilter::hasCapability( | |||||
| $user, | |||||
| $conpherence, | |||||
| PhabricatorPolicyCapability::CAN_JOIN); | |||||
| $layout = id(new ConpherenceLayoutView()) | $layout = id(new ConpherenceLayoutView()) | ||||
| ->setUser($user) | ->setUser($user) | ||||
| ->setBaseURI($this->getApplicationURI()) | ->setBaseURI($this->getApplicationURI()) | ||||
| ->setThread($conpherence) | ->setThread($conpherence) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setSearch($search) | ->setSearch($search) | ||||
| ->setMessages($messages) | ->setMessages($messages) | ||||
| ->setReplyForm($form) | ->setReplyForm($form) | ||||
| Show All 11 Lines | return $this->newPage() | ||||
| ->setPageObjectPHIDs(array($conpherence->getPHID())) | ->setPageObjectPHIDs(array($conpherence->getPHID())) | ||||
| ->appendChild($layout); | ->appendChild($layout); | ||||
| } | } | ||||
| private function renderFormContent() { | private function renderFormContent() { | ||||
| $conpherence = $this->getConpherence(); | $conpherence = $this->getConpherence(); | ||||
| $user = $this->getRequest()->getUser(); | $user = $this->getRequest()->getUser(); | ||||
| $can_join = PhabricatorPolicyFilter::hasCapability( | |||||
| $user, | |||||
| $conpherence, | |||||
| PhabricatorPolicyCapability::CAN_JOIN); | |||||
| $participating = $conpherence->getParticipantIfExists($user->getPHID()); | $participating = $conpherence->getParticipantIfExists($user->getPHID()); | ||||
| if (!$can_join && !$participating && $user->isLoggedIn()) { | if (!$participating && $user->isLoggedIn()) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $draft = PhabricatorDraft::newFromUserAndKey( | $draft = PhabricatorDraft::newFromUserAndKey( | ||||
| $user, | $user, | ||||
| $conpherence->getPHID()); | $conpherence->getPHID()); | ||||
| $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); | $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); | ||||
| if ($user->isLoggedIn()) { | if ($user->isLoggedIn()) { | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||