mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 10:52:41 +01:00
67da5d6e4b
Summary: Same as //Subscribe//, //Unsubscribe// and //Automatically Subscribed// in differential. Manually updated library map as windows is fun! Test Plan: Subscribe, Unsubscribe! Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5809
40 lines
861 B
PHP
40 lines
861 B
PHP
<?php
|
|
|
|
final class ManiphestSubscribeController extends ManiphestController {
|
|
|
|
private $id;
|
|
private $action;
|
|
|
|
public function willProcessRequest(array $data) {
|
|
$this->id = $data['id'];
|
|
$this->action = $data['action'];
|
|
}
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
|
|
$task = id(new ManiphestTask())->load($this->id);
|
|
if (!$task) {
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
switch ($this->action) {
|
|
case 'add':
|
|
ManiphestTransactionEditor::addCC(
|
|
$task,
|
|
$user);
|
|
break;
|
|
case 'rem':
|
|
ManiphestTransactionEditor::removeCC(
|
|
$task,
|
|
$user);
|
|
break;
|
|
default:
|
|
return new Aphront400Response();
|
|
}
|
|
|
|
return id(new AphrontRedirectResponse())->setURI('/T'.$task->getID());
|
|
}
|
|
}
|