Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15483070
D12252.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D12252.id.diff
View Options
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -120,25 +120,28 @@
->setContent($result);
break;
case ConpherenceUpdateActions::METADATA:
- $updated = false;
// all metadata updates are continue requests
if (!$request->isContinueRequest()) {
break;
}
$title = $request->getStr('title');
- if ($title != $conpherence->getTitle()) {
+ $xactions[] = id(new ConpherenceTransaction())
+ ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
+ ->setNewValue($title);
+ if ($conpherence->getIsRoom()) {
+ $xactions[] = id(new ConpherenceTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
+ ->setNewValue($request->getStr('viewPolicy'));
+ $xactions[] = id(new ConpherenceTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
+ ->setNewValue($request->getStr('editPolicy'));
$xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
- ->setNewValue($title);
- $updated = true;
- if (!$request->getExists('force_ajax')) {
- $response_mode = 'redirect';
- }
+ ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY)
+ ->setNewValue($request->getStr('joinPolicy'));
}
- if (!$updated) {
- $errors[] = pht(
- 'That was a non-update. Try cancel.');
+ if (!$request->getExists('force_ajax')) {
+ $response_mode = 'redirect';
}
break;
case ConpherenceUpdateActions::LOAD:
@@ -164,6 +167,11 @@
->setCancelURI($this->getApplicationURI($conpherence_id.'/'))
->setException($ex);
}
+ // xactions had no effect...!
+ if (empty($xactions)) {
+ $errors[] = pht(
+ 'That was a non-update. Try cancel.');
+ }
}
if ($xactions || ($action == ConpherenceUpdateActions::LOAD)) {
@@ -293,6 +301,8 @@
$error_view) {
$request = $this->getRequest();
+ $user = $request->getUser();
+
$form = id(new PHUIFormLayoutView())
->appendChild($error_view)
->appendChild(
@@ -301,9 +311,38 @@
->setName('title')
->setValue($conpherence->getTitle()));
+ if ($conpherence->getIsRoom()) {
+ $title = pht('Update Room');
+ $policies = id(new PhabricatorPolicyQuery())
+ ->setViewer($user)
+ ->setObject($conpherence)
+ ->execute();
+
+ $form->appendChild(
+ id(new AphrontFormPolicyControl())
+ ->setName('viewPolicy')
+ ->setPolicyObject($conpherence)
+ ->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
+ ->setPolicies($policies))
+ ->appendChild(
+ id(new AphrontFormPolicyControl())
+ ->setName('editPolicy')
+ ->setPolicyObject($conpherence)
+ ->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
+ ->setPolicies($policies))
+ ->appendChild(
+ id(new AphrontFormPolicyControl())
+ ->setName('joinPolicy')
+ ->setPolicyObject($conpherence)
+ ->setCapability(PhabricatorPolicyCapability::CAN_JOIN)
+ ->setPolicies($policies));
+ } else {
+ $title = pht('Update Thread');
+ }
+
require_celerity_resource('conpherence-update-css');
$view = id(new AphrontDialogView())
- ->setTitle(pht('Update Conpherence'))
+ ->setTitle($title)
->addHiddenInput('action', 'metadata')
->addHiddenInput(
'latest_transaction_id',
diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
--- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php
+++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
@@ -381,7 +381,7 @@
private function getHeaderActionsConfig(ConpherenceThread $conpherence) {
if ($conpherence->getIsRoom()) {
- $rename_label = pht('Rename Room');
+ $rename_label = pht('Edit Room');
} else {
$rename_label = pht('Rename Thread');
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 10, 9:43 AM (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223549
Default Alt Text
D12252.id.diff (4 KB)
Attached To
Mode
D12252: Conpherence - add edit control for rooms
Attached
Detach File
Event Timeline
Log In to Comment