Differential D17675 Diff 42512 src/applications/conpherence/controller/ConpherenceNewRoomController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceNewRoomController.php
| Show All 28 Lines | if ($request->isFormPost()) { | ||||
| ->setTransactionType(ConpherenceThreadTopicTransaction::TRANSACTIONTYPE) | ->setTransactionType(ConpherenceThreadTopicTransaction::TRANSACTIONTYPE) | ||||
| ->setNewValue($request->getStr('topic')); | ->setNewValue($request->getStr('topic')); | ||||
| $xactions[] = id(new ConpherenceTransaction()) | $xactions[] = id(new ConpherenceTransaction()) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) | ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) | ||||
| ->setNewValue($request->getStr('viewPolicy')); | ->setNewValue($request->getStr('viewPolicy')); | ||||
| $xactions[] = id(new ConpherenceTransaction()) | $xactions[] = id(new ConpherenceTransaction()) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) | ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) | ||||
| ->setNewValue($request->getStr('editPolicy')); | ->setNewValue($request->getStr('editPolicy')); | ||||
| $xactions[] = id(new ConpherenceTransaction()) | |||||
| ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY) | |||||
| ->setNewValue($request->getStr('joinPolicy')); | |||||
| try { | try { | ||||
| $editor | $editor | ||||
| ->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
| ->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
| ->setActor($user) | ->setActor($user) | ||||
| ->applyTransactions($conpherence, $xactions); | ->applyTransactions($conpherence, $xactions); | ||||
| return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
| ->setURI('/'.$conpherence->getMonogram()); | ->setURI('/'.$conpherence->getMonogram()); | ||||
| } catch (PhabricatorApplicationTransactionValidationException $ex) { | } catch (PhabricatorApplicationTransactionValidationException $ex) { | ||||
| $validation_exception = $ex; | $validation_exception = $ex; | ||||
| $e_title = $ex->getShortMessage( | $e_title = $ex->getShortMessage( | ||||
| ConpherenceThreadTitleTransaction::TRANSACTIONTYPE); | ConpherenceThreadTitleTransaction::TRANSACTIONTYPE); | ||||
| $conpherence->setViewPolicy($request->getStr('viewPolicy')); | $conpherence->setViewPolicy($request->getStr('viewPolicy')); | ||||
| $conpherence->setEditPolicy($request->getStr('editPolicy')); | $conpherence->setEditPolicy($request->getStr('editPolicy')); | ||||
| $conpherence->setJoinPolicy($request->getStr('joinPolicy')); | |||||
| } | } | ||||
| } else { | } else { | ||||
| if ($request->getStr('participant')) { | if ($request->getStr('participant')) { | ||||
| $participants[] = $request->getStr('participant'); | $participants[] = $request->getStr('participant'); | ||||
| } | } | ||||
| } | } | ||||
| $policies = id(new PhabricatorPolicyQuery()) | $policies = id(new PhabricatorPolicyQuery()) | ||||
| Show All 38 Lines | $form = id(new PHUIFormLayoutView()) | ||||
| ->setPolicyObject($conpherence) | ->setPolicyObject($conpherence) | ||||
| ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) | ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) | ||||
| ->setPolicies($policies)) | ->setPolicies($policies)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormPolicyControl()) | id(new AphrontFormPolicyControl()) | ||||
| ->setName('editPolicy') | ->setName('editPolicy') | ||||
| ->setPolicyObject($conpherence) | ->setPolicyObject($conpherence) | ||||
| ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) | ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) | ||||
| ->setPolicies($policies)) | |||||
| ->appendChild( | |||||
| id(new AphrontFormPolicyControl()) | |||||
| ->setName('joinPolicy') | |||||
| ->setPolicyObject($conpherence) | |||||
| ->setCapability(PhabricatorPolicyCapability::CAN_JOIN) | |||||
| ->setPolicies($policies)); | ->setPolicies($policies)); | ||||
| $dialog->appendChild($form); | $dialog->appendChild($form); | ||||
| return id(new AphrontDialogResponse())->setDialog($dialog); | return id(new AphrontDialogResponse())->setDialog($dialog); | ||||
| } | } | ||||
| } | } | ||||